Page 1 of 1

damped Generic6DofSpringConstraint under gravity unstable

Posted: Thu Mar 22, 2012 3:30 pm
by alex-weej
I've noticed that the Generic6DofSpringConstraint does not reach an equilibrium state when gravity is applied. I'm using the code

Code: Select all

			pGen6Dof->enableSpring(5, true);
			pGen6Dof->setEquilibriumPoint(5, 0);
			pGen6Dof->setStiffness(5, 200);
			pGen6Dof->setDamping(5, 0.0005);
			pGen6Dof->setAngularLowerLimit(btVector3(0, 0, 1));
			pGen6Dof->setAngularUpperLimit(btVector3(0, 0, 0));
			pGen6Dof->setLinearLowerLimit(btVector3(0, 0, 0));
			pGen6Dof->setLinearUpperLimit(btVector3(0, 0, 0));
to add an angular spring constraint to a body about a point 5 units from the origin, with a large amount of damping. Under gravity, the asymptotic state is an oscillation - the amplitude being dependent on the damping constant.

Any ideas before I post a bug?

Thanks

Re: damped Generic6DofSpringConstraint under gravity unstabl

Posted: Fri Mar 23, 2012 9:26 am
by note173
For some reason btGeneric6DofSpringConstraint does have only static (velocity-independent) friction. I"d suggest to subclass btGeneric6DofSpringConstraint and modify friction force calculation. There is even an example on this forum somewhere.