Moved setting of sleepingThreshold of PositionConstraints.
This commit is contained in:
parent
12099cb4a1
commit
f05e3d301c
@ -38,7 +38,6 @@ void Physics::takeUpdateStep(float timeDiff)
|
|||||||
btVector3 dir = allPositionConstraints[i].position - allPositionConstraints[i].body->getCenterOfMassPosition();
|
btVector3 dir = allPositionConstraints[i].position - allPositionConstraints[i].body->getCenterOfMassPosition();
|
||||||
dir = dir*allPositionConstraints[i].strength - allPositionConstraints[i].body->getLinearVelocity();
|
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
|
allPositionConstraints[i].body->applyCentralForce(dir*allPositionConstraints[i].strength); //apply a foce upon the object pushing it towards the constraint position
|
||||||
allPositionConstraints[i].body->setSleepingThresholds(0,0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +90,7 @@ void Physics::addPositionConstraint(int bodyIndice, float strength, glm::vec3 po
|
|||||||
{
|
{
|
||||||
positionConstraint cons;
|
positionConstraint cons;
|
||||||
cons.body = bodies[bodyIndice];
|
cons.body = bodies[bodyIndice];
|
||||||
|
cons.body->setSleepingThresholds(0,0);
|
||||||
cons.strength = strength;
|
cons.strength = strength;
|
||||||
cons.position = btVector3(position.x,position.y,position.z);
|
cons.position = btVector3(position.x,position.y,position.z);
|
||||||
allPositionConstraints.push_back(cons);
|
allPositionConstraints.push_back(cons);
|
||||||
|
Loading…
Reference in New Issue
Block a user