I have implemented my own simple spring-damping system. For that I calculate forces and apply them to my rigid body.
There are nine boxes. A big one in the worlds center is the "passive" Box. On each of it's edges a smaller box is connected via a spring-damping system.
The big box in the middle of the scene should stay in the center of the eight smaller boxes. For translation this holds true.
When i start moving one of the small boxes with the mouse it starts spinning. That shouldn't happen since each corner is pulled towards one small box.
Seems if the applied force in "btRigidBody::applyForce(btVetor3 force, btVector3 rel_pos);" doesn't correctly act on the relative pos of the big box.
Please take a look at the attached sample code.
The important functions are:
Code: Select all
void calculateAndApplyForces(float dt);
void applyForce(btRigidBody* bodyActive, btRigidBody* bodyPassive, btVector3& relPos);
Best reagrds,
Jan