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

Method AddMovement

Source/Engine/Physics/Colliders/CharacterController.cpp:372–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372void CharacterController::AddMovement(const Vector3& translation, const Quaternion& rotation)
373{
374 Vector3 displacement = translation;
375 if (_autoGravity)
376 {
377 // Apply gravity
378 const float deltaTime = Time::GetCurrentSafe()->DeltaTime.GetTotalSeconds();
379 displacement += GetPhysicsScene()->GetGravity() * deltaTime;
380 }
381
382 if (!displacement.IsZero())
383 {
384 Move(displacement);
385 }
386
387 if (!rotation.IsIdentity())
388 {
389 SetOrientation(GetOrientation() * rotation);
390 }
391}
392
393bool CharacterController::CanAttach(RigidBody* rigidBody) const
394{

Callers

nothing calls this directly

Calls 6

GetPhysicsSceneFunction · 0.85
GetOrientationFunction · 0.85
GetGravityMethod · 0.80
IsIdentityMethod · 0.80
MoveFunction · 0.50
IsZeroMethod · 0.45

Tested by

no test coverage detected