MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnActiveTransformChanged

Method OnActiveTransformChanged

Source/Engine/Physics/Actors/RigidBody.cpp:472–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472void RigidBody::OnActiveTransformChanged()
473{
474 // Change actor transform (but with locking)
475 ASSERT(!_isUpdatingTransform);
476 _isUpdatingTransform = true;
477 Transform transform = _transform;
478 PhysicsBackend::GetRigidActorPose(_actor, transform.Translation, transform.Orientation);
479 if (transform.Translation.IsNanOrInfinity() || transform.Orientation.IsNanOrInfinity())
480 {
481 LOG(Error, "GetRigidActorPose retuned NaN/Inf transformation");
482 transform = _transform;
483 }
484 if (_parent)
485 {
486 _parent->GetTransform().WorldToLocal(transform, _localTransform);
487 }
488 else
489 {
490 _localTransform = transform;
491 }
492 OnTransformChanged();
493 _isUpdatingTransform = false;
494}
495
496void RigidBody::BeginPlay(SceneBeginData* data)
497{

Callers 2

FlushActiveTransformsFunction · 0.45
EndSimulateSceneMethod · 0.45

Calls 3

GetTransformMethod · 0.80
IsNanOrInfinityMethod · 0.45
WorldToLocalMethod · 0.45

Tested by

no test coverage detected