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

Method CreateStaticActor

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

Source from the content-addressed store, hash-verified

273}
274
275void Collider::CreateStaticActor()
276{
277 ASSERT(_staticActor == nullptr);
278 void* scene = GetPhysicsScene()->GetPhysicsScene();
279 _staticActor = PhysicsBackend::CreateRigidStaticActor(nullptr, _transform.Translation, _transform.Orientation, scene);
280
281 // Reset local pos of the shape and link it to the actor
282 PhysicsBackend::SetShapeLocalPose(_shape, _center * GetScale(), Quaternion::Identity);
283 PhysicsBackend::AttachShape(_shape, _staticActor);
284
285 PhysicsBackend::AddSceneActor(scene, _staticActor);
286}
287
288void Collider::RemoveStaticActor()
289{

Callers

nothing calls this directly

Calls 3

GetPhysicsSceneFunction · 0.85
GetScaleFunction · 0.85
GetPhysicsSceneMethod · 0.80

Tested by

no test coverage detected