btGeneric6DofSpringConstraint Spring Position

RJNelson68
Posts: 73
Joined: Tue Oct 06, 2009 3:19 pm

btGeneric6DofSpringConstraint Spring Position

Post by RJNelson68 »

Is there some way with a btGeneric6DofSpringConstraint to determine at what point it is at on an axis used as a spring?

For Example, using Axis 2 if you set the following:

springJoint.enableSpring(2, true)
springJoint.enableStiffness(2, someValue)
springJoint.enableDamping(2, someValue)
springJoint.setLinearLowerLimit(0.0, 0.0, 0.0)
springJoint.setLinearUpperLimit(0.0, 0.0, 0.5)

While the spring is moving within the limits of 0.0 to 0.5 how can I tell at what point between those values it is at?
norbie
Posts: 21
Joined: Mon Feb 11, 2013 1:57 pm

Re: btGeneric6DofSpringConstraint Spring Position

Post by norbie »

Hello,

I think you might get some kind of information from the TranslationalLimitMotor. You could try something like this:

Code: Select all

	btVector3 currentLinearDiff = constraint->getTranslationalLimitMotor()->m_currentLinearDiff;
Hope this is what you need.