History

minior optimization/cleanup

Andrew Meadows committed 9 years ago

Commit d9e893a1 parent 0f643b71 file · +3 −3Browse files

Showing the changes to libraries/physics/src/CharacterController.cpp (1 of 1 file). Show all

Unified · Split

libraries/physics/src/CharacterController.cpp+3−3
@@ -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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t