Bug report on tGeneric6DOFSpringConstraint with solution

Post Reply
thloh85
Posts: 26
Joined: Mon Feb 09, 2009 10:07 am

Bug report on tGeneric6DOFSpringConstraint with solution

Post by thloh85 »

Small fix

btGeneric6DOFSpringConstraint's setEquilibriumPoint has an issue. It's too small of a fix, I'm lazy to create a patch.

Code: Select all

void btGeneric6DofSpringConstraint::setEquilibriumPoint(int index)
{
	btAssert((index >= 0) && (index < 6));
	calculateTransforms();
	if(index < 3)
	{
		m_equilibriumPoint[index] = m_calculatedLinearDiff[index];
	}
	else
	{
		m_equilibriumPoint[index + 3] = m_calculatedAxisAngleDiff[index];
	}
}
Alter
m_equilibriumPoint[index + 3] = m_calculatedAxisAngleDiff[index];
to
m_equilibriumPoint[index] = m_calculatedAxisAngleDiff[index - 3];

Let me know if there's anything wrong with my code.

Thanks.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bug report on tGeneric6DOFSpringConstraint with solution

Post by Erwin Coumans »

Good point, this was already fixed a while back, exactly as you mentioned:

http://code.google.com/p/bullet/source/ ... 875&r=1826

Can you try out the latest trunk (there is a zipped trunk archive that should have this fix included).
Thanks for the report anyway,
Erwin
Post Reply