Showing the changes to libraries/physics/src/ObjectActionSpring.cpp (1 of 4 files). Show all
Unified · Split
| @@ -45,10 +45,9 @@ bool ObjectActionSpring::getTarget(float deltaTimeStep, glm::quat& rotation, glm · 44 unmodified lines | ||
| 45 | 45 | position = _desiredPositionalTarget; |
| 46 | 46 | linearVelocity = glm::vec3(); |
| 47 | 47 | angularVelocity = glm::vec3(); |
| 48 | − return true; | |
| 48 | + return true; | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | − | |
| 52 | 51 | bool ObjectActionSpring::prepareForSpringUpdate(btScalar deltaTimeStep) { |
| 53 | 52 | glm::quat rotation; |
| 54 | 53 | glm::vec3 position; |
| @@ -140,10 +139,13 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) { · 85 unmodified lines | ||
| 140 | 139 | float speed = glm::min(offsetLength / _linearTimeScale, SPRING_MAX_SPEED); |
| 141 | 140 | targetVelocity = (-speed / offsetLength) * offset; |
| 142 | 141 | if (speed > rigidBody->getLinearSleepingThreshold()) { |
| 142 | + qDebug() << "HERE"; | |
| 143 | + forceBodyNonStatic(); | |
| 143 | 144 | rigidBody->activate(); |
| 144 | 145 | } |
| 145 | 146 | } |
| 146 | 147 | // this action is aggresively critically damped and defeats the current velocity |
| 148 | + qDebug() << targetVelocity.x() << targetVelocity.y() << targetVelocity.z(); | |
| 147 | 149 | rigidBody->setLinearVelocity(targetVelocity); |
| 148 | 150 | } |
| 149 | 151 | |