code-google-com / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Error in setting equilibrium point of 6DOFSpringConstraint #299

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I want to implement a muscle constraint for Bullet and had a look at the
6DOFSpringConstraint to get an understanding of the implementation details
of constraints in Bullet. There I stumbled on the setEquilibriumPoint method:

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];
        }
}

Maybe I am wrong but the second part (angular equilibrium points) seems to
have a bug. The m_equilibriumPoint is an array of size 6 (0-2: linear
equilibriums, 3-5: angular equilibriums). Hence the index for setting the
angular equilibrium points should not be "index + 3", but just "index".

Original issue reported on code.google.com by steffen....@gmail.com on 4 Nov 2009 at 2:00

GoogleCodeExporter commented 9 years ago

Roman, can you look into this?

Original comment by erwin.coumans on 5 Nov 2009 at 5:01

GoogleCodeExporter commented 9 years ago
Definitely a bug. 
Hopefully this function was not used in bullet demos :-)
Fixed as of r1826

Original comment by rpo...@gmail.com on 5 Nov 2009 at 6:37

GoogleCodeExporter commented 9 years ago
Great. Just one more question. Would it be possible to add a second parameter 
to the
setEquilibriumPoint method or to overload it to be able to set the resting 
length
explicitly?

Original comment by steffen....@gmail.com on 5 Nov 2009 at 6:44