| 370 | } |
| 371 | |
| 372 | void 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 | |
| 393 | bool CharacterController::CanAttach(RigidBody* rigidBody) const |
| 394 | { |
nothing calls this directly
no test coverage detected