damped Generic6DofSpringConstraint under gravity unstable

Post Reply
Posts: 7
Joined: Thu Mar 01, 2012 10:07 pm

damped Generic6DofSpringConstraint under gravity unstable

Post 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?

Posts: 16
Joined: Wed Jan 25, 2012 6:32 pm

Re: damped Generic6DofSpringConstraint under gravity unstabl

Post 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.
Post Reply