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

Method SetCenter

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

Source from the content-addressed store, hash-verified

46}
47
48void Collider::SetCenter(const Vector3& value)
49{
50 if (value == _center)
51 return;
52 _center = value;
53 if (_staticActor)
54 PhysicsBackend::SetShapeLocalPose(_shape, _center * GetScale(), Quaternion::Identity);
55 else if (const RigidBody* rigidBody = GetAttachedRigidBody())
56 PhysicsBackend::SetShapeLocalPose(_shape, (_localTransform.Translation + _localTransform.Orientation * _center) * rigidBody->GetScale(), _localTransform.Orientation);
57 UpdateBounds();
58}
59
60void Collider::SetContactOffset(float value)
61{

Callers

nothing calls this directly

Calls 1

GetScaleFunction · 0.85

Tested by

no test coverage detected