mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
minior optimization/cleanup
This commit is contained in:
parent
0f643b7d66
commit
d9e893ac21
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue