diff --git a/Source/Engine/Physics/Colliders/CharacterController.cpp b/Source/Engine/Physics/Colliders/CharacterController.cpp index 419b6b052..ef856bf79 100644 --- a/Source/Engine/Physics/Colliders/CharacterController.cpp +++ b/Source/Engine/Physics/Colliders/CharacterController.cpp @@ -22,9 +22,9 @@ CharacterController::CharacterController(const SpawnParams& params) , _radius(50.0f) , _height(150.0f) , _minMoveDistance(0.0f) - , _upDirection(Vector3::Up) , _isUpdatingTransform(false) - , _nonWalkableMode(CharacterController::NonWalkableModes::PreventClimbing) + , _upDirection(Vector3::Up) + , _nonWalkableMode(NonWalkableModes::PreventClimbing) , _lastFlags(CollisionFlags::None) { static_assert(sizeof(_filterData) == sizeof(PxFilterData), "Invalid filter data size."); @@ -61,7 +61,12 @@ void CharacterController::SetSlopeLimit(float value) _slopeLimit = value; if (_controller) - _controller->setSlopeLimit(cosf(value * DegreesToRadians)); + _controller->setSlopeLimit(Math::Cos(value * DegreesToRadians)); +} + +CharacterController::NonWalkableModes CharacterController::GetNonWalkableMode() const +{ + return _nonWalkableMode; } void CharacterController::SetNonWalkableMode(NonWalkableModes value) @@ -72,6 +77,11 @@ void CharacterController::SetNonWalkableMode(NonWalkableModes value) _controller->setNonWalkableMode(static_cast(value)); } +float CharacterController::GetStepOffset() const +{ + return _stepOffset; +} + void CharacterController::SetStepOffset(float value) { if (Math::NearEqual(value, _stepOffset)) diff --git a/Source/Engine/Physics/Colliders/CharacterController.h b/Source/Engine/Physics/Colliders/CharacterController.h index e3f690f8c..5b4dd3f49 100644 --- a/Source/Engine/Physics/Colliders/CharacterController.h +++ b/Source/Engine/Physics/Colliders/CharacterController.h @@ -118,10 +118,7 @@ public: /// Gets the non-walkable mode for the character controller. /// API_PROPERTY(Attributes="EditorOrder(215), DefaultValue(NonWalkableModes.PreventClimbing), EditorDisplay(\"Character Controller\")") - FORCE_INLINE NonWalkableModes GetNonWalkableMode() const - { - return _nonWalkableMode; - } + NonWalkableModes GetNonWalkableMode() const; /// /// Sets the non-walkable mode for the character controller. @@ -132,10 +129,7 @@ public: /// Gets the step height. The character will step up a stair only if it is closer to the ground than the indicated value. This should not be greater than the Character Controller’s height or it will generate an error. /// API_PROPERTY(Attributes="EditorOrder(220), DefaultValue(30.0f), Limit(0), EditorDisplay(\"Character Controller\")") - FORCE_INLINE float GetStepOffset() const - { - return _stepOffset; - } + float GetStepOffset() const; /// /// Sets the step height. The character will step up a stair only if it is closer to the ground than the indicated value. This should not be greater than the Character Controller’s height or it will generate an error.