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

Method OnTransformChanged

Source/Engine/Physics/Colliders/Collider.cpp:405–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void Collider::OnTransformChanged()
406{
407 // Base
408 PhysicsColliderActor::OnTransformChanged();
409
410 if (_staticActor)
411 {
412 PhysicsBackend::SetRigidActorPose(_staticActor, _transform.Translation, _transform.Orientation);
413 }
414 else if (const RigidBody* rigidBody = GetAttachedRigidBody())
415 {
416 const Vector3 localPosePos = (_localTransform.Translation + _localTransform.Orientation * _center) * rigidBody->GetScale();
417 if (_cachedLocalPosePos != localPosePos || _cachedLocalPoseRot != _localTransform.Orientation)
418 {
419 _cachedLocalPosePos = localPosePos;
420 _cachedLocalPoseRot = _localTransform.Orientation;
421 PhysicsBackend::SetShapeLocalPose(_shape, localPosePos, _cachedLocalPoseRot);
422 }
423 }
424
425 const float scale = GetScale().GetAbsolute().MaxValue();
426 if (_cachedScale != scale)
427 UpdateGeometry();
428 UpdateBounds();
429}
430
431void Collider::OnLayerChanged()
432{

Callers

nothing calls this directly

Calls 3

GetScaleFunction · 0.85
MaxValueMethod · 0.45
GetAbsoluteMethod · 0.45

Tested by

no test coverage detected