Showing the changes to libraries/physics/src/ObjectActionSpring.cpp (1 of 1 file). Show all
Unified · Split
| @@ -63,8 +63,8 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) { · 62 unmodified lines | ||
| 63 | 63 | btVector3 targetVelocity(0.0f, 0.0f, 0.0f); |
| 64 | 64 | |
| 65 | 65 | float speed = (offsetLength > FLT_EPSILON) ? glm::min(offsetLength / _linearTimeScale, SPRING_MAX_SPEED) : 0.0f; |
| 66 | + targetVelocity = (-speed / offsetLength) * offset; | |
| 66 | 67 | if (speed > rigidBody->getLinearSleepingThreshold()) { |
| 67 | − targetVelocity = (-speed / offsetLength) * offset; | |
| 68 | 68 | rigidBody->activate(); |
| 69 | 69 | } |
| 70 | 70 | |
| @@ -92,8 +92,8 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) { · 21 unmodified lines | ||
| 92 | 92 | // dQ = Q1 * Q0^ |
| 93 | 93 | btQuaternion deltaQ = target * bodyRotation.inverse(); |
| 94 | 94 | float speed = deltaQ.getAngle() / _angularTimeScale; |
| 95 | + targetVelocity = speed * deltaQ.getAxis(); | |
| 95 | 96 | if (speed > rigidBody->getAngularSleepingThreshold()) { |
| 96 | − targetVelocity = speed * deltaQ.getAxis(); | |
| 97 | 97 | rigidBody->activate(); |
| 98 | 98 | } |
| 99 | 99 | } |