mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
fix problem where grab stops on slow movement
This commit is contained in:
parent
d924e042bc
commit
72928fdbd6
1 changed files with 2 additions and 2 deletions
|
@ -63,8 +63,8 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) {
|
|||
btVector3 targetVelocity(0.0f, 0.0f, 0.0f);
|
||||
|
||||
float speed = (offsetLength > FLT_EPSILON) ? glm::min(offsetLength / _linearTimeScale, SPRING_MAX_SPEED) : 0.0f;
|
||||
targetVelocity = (-speed / offsetLength) * offset;
|
||||
if (speed > rigidBody->getLinearSleepingThreshold()) {
|
||||
targetVelocity = (-speed / offsetLength) * offset;
|
||||
rigidBody->activate();
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) {
|
|||
// dQ = Q1 * Q0^
|
||||
btQuaternion deltaQ = target * bodyRotation.inverse();
|
||||
float speed = deltaQ.getAngle() / _angularTimeScale;
|
||||
targetVelocity = speed * deltaQ.getAxis();
|
||||
if (speed > rigidBody->getAngularSleepingThreshold()) {
|
||||
targetVelocity = speed * deltaQ.getAxis();
|
||||
rigidBody->activate();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue