Showing the changes to libraries/physics/src/CharacterController.cpp (1 of 1 file). Show all
Unified · Split
| @@ -271,11 +271,11 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar · 270 unmodified lines | |||
| 271 | _followTime += dt; | 271 | _followTime += dt; |
| 272 | 272 | ||
| 273 | if (_steppingUp) { | 273 | if (_steppingUp) { |
| 274 | // compute a stepUpSpeed that will reach the top of the step in the time it would take | ||
| 275 | // to move over the _stepPoint at target speed | ||
| 276 | float horizontalDistance = (_stepPoint - _stepPoint.dot(_currentUp) * _currentUp).length(); | ||
| 277 | float horizontalTargetSpeed = (_targetVelocity - _targetVelocity.dot(_currentUp) * _currentUp).length(); | 274 | float horizontalTargetSpeed = (_targetVelocity - _targetVelocity.dot(_currentUp) * _currentUp).length(); |
| 278 | if (horizontalTargetSpeed > FLT_EPSILON) { | 275 | if (horizontalTargetSpeed > FLT_EPSILON) { |
| 276 | // compute a stepUpSpeed that will reach the top of the step in the time it would take | ||
| 277 | // to move over the _stepPoint at target speed | ||
| 278 | float horizontalDistance = (_stepPoint - _stepPoint.dot(_currentUp) * _currentUp).length(); | ||
| 279 | float timeToStep = horizontalDistance / horizontalTargetSpeed; | 279 | float timeToStep = horizontalDistance / horizontalTargetSpeed; |
| 280 | float stepUpSpeed = _stepHeight / timeToStep; | 280 | float stepUpSpeed = _stepHeight / timeToStep; |
| 281 | 281 | ||