Page 1 of 1

btGeneric6DofSpringConstraints

Posted: Mon Jul 11, 2011 6:15 pm
by Xcoder77
Hi, Im not sure if this is the proper way to setup a spring constraint this is what i am trying to do and it seems to have no effect

hingeCS4->setAngularUpperLimit(btVector3(0,0,0));
hingeCS4->setAngularLowerLimit(btVector3(0,0,0));
hingeCS4->setLinearUpperLimit(btVector3(0,2,0));
hingeCS4->setLinearLowerLimit(btVector3(0,-2,0));


hingeCS4->enableSpring(0, true);
hingeCS4->setStiffness(0, 38.478f); // period 1 sec for !kG body
hingeCS4->setDamping(0, 0.01f); // add some damping
hingeCS4->setEquilibriumPoint(); // set current position as equilibrium point

Re: btGeneric6DofSpringConstraints

Posted: Mon Jul 11, 2011 9:27 pm
by Mako_energy02
Read the detailed class description of the Spring constraint here:
http://bulletphysics.com/Bullet/BulletF ... raint.html

You are enabling the wrong spring. You are enabling the X-axis linear spring but also locking it when setting the limits. When passing in the index for which spring to enable/set settings for, pass in "1" instead of "0".

Re: btGeneric6DofSpringConstraints

Posted: Mon Jul 11, 2011 9:38 pm
by Xcoder77
Thank you for The Reply I think I understand Now