From 012d117c7e4ef74d46372716fe372e435d949436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Fri, 13 Feb 2015 12:15:54 +0100 Subject: [PATCH] Changed position constraints to be less bouncy. --- physics.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics.cc b/physics.cc index e126264..a1cf635 100644 --- a/physics.cc +++ b/physics.cc @@ -37,7 +37,7 @@ void Physics::takeUpdateStep(float timeDiff) if(allPositionConstraints[i].position != allPositionConstraints[i].body->getCenterOfMassPosition()) //if constraint != position of the body because otherwise dir = 0 { btVector3 dir = allPositionConstraints[i].position - allPositionConstraints[i].body->getCenterOfMassPosition(); - dir = dir*allPositionConstraints[i].strength; + dir = dir*allPositionConstraints[i].strength - allPositionConstraints[i].body->getLinearVelocity(); allPositionConstraints[i].body->applyCentralForce(dir*allPositionConstraints[i].strength); //apply a foce upon the object pushing it towards the constraint position } }