From d9e893ac2117dbfd4276a50cbc662c0aaabe206c Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 8 May 2017 11:02:11 -0700 Subject: [PATCH] minior optimization/cleanup --- libraries/physics/src/CharacterController.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index efe51f8692..fe6f882d47 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -271,11 +271,11 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar _followTime += dt; if (_steppingUp) { - // compute a stepUpSpeed that will reach the top of the step in the time it would take - // to move over the _stepPoint at target speed - float horizontalDistance = (_stepPoint - _stepPoint.dot(_currentUp) * _currentUp).length(); float horizontalTargetSpeed = (_targetVelocity - _targetVelocity.dot(_currentUp) * _currentUp).length(); if (horizontalTargetSpeed > FLT_EPSILON) { + // compute a stepUpSpeed that will reach the top of the step in the time it would take + // to move over the _stepPoint at target speed + float horizontalDistance = (_stepPoint - _stepPoint.dot(_currentUp) * _currentUp).length(); float timeToStep = horizontalDistance / horizontalTargetSpeed; float stepUpSpeed = _stepHeight / timeToStep;