Add Set/Get Up direction.

This commit is contained in:
Jean-Baptiste Perrier
2021-03-30 21:43:03 +02:00
parent 6f83330321
commit 2524d93f6b
2 changed files with 21 additions and 0 deletions

View File

@@ -82,6 +82,17 @@ void CharacterController::SetStepOffset(float value)
_controller->setStepOffset(value);
}
void CharacterController::SetUpDirection(const Vector3& up)
{
if (_controller)
_controller->setUpDirection(C2P(up));
}
Vector3 CharacterController::GetUpDirection() const
{
return _controller ? P2C(_controller->getUpDirection()) : Vector3::Up;
}
void CharacterController::SetMinMoveDistance(float value)
{
_minMoveDistance = Math::Max(value, 0.0f);