btGeneric6DofSpringConstraints

Post Reply
Xcoder77
Posts: 6
Joined: Mon May 30, 2011 8:00 am

btGeneric6DofSpringConstraints

Post 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
Mako_energy02
Posts: 171
Joined: Sun Jan 17, 2010 4:47 am

Re: btGeneric6DofSpringConstraints

Post 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".
Xcoder77
Posts: 6
Joined: Mon May 30, 2011 8:00 am

Re: btGeneric6DofSpringConstraints

Post by Xcoder77 »

Thank you for The Reply I think I understand Now
Post Reply