If someone is also wondering, the x axis is considered as the one which twists, so I've set my frames like in the example below.
.
But then I've another question
----
If I understand well, projection on axis X of rigid body B into the plane (Y, Z) of body A, must be constrained inside an ellipse (which means u²/a² + v²/b² < 1).
.
Then I would have written the test of being or not in the ellipse with:
u = btSin(swing1)
a = btSin(m_swingSpan1)
v = btSin(swing2)
b = btSin(m_swingSpan2).
I find that the parameters of SetLimit() with this change, now really means angles, whereas I am a bit surprised
with the limit my limbs can reach with the current code.
Could someone explain me the current test (EDIT: sorry it was a wrong snippet)
Code: Select all
btScalar RMaxAngle1Sq = 1.0f / (m_swingSpan1*m_swingSpan1);
btScalar RMaxAngle2Sq = 1.0f / (m_swingSpan2*m_swingSpan2);
btScalar EllipseAngle = btFabs(swing1)* RMaxAngle1Sq + btFabs(swing2) * RMaxAngle2Sq;
if (EllipseAngle > 1.0f)
{
//solve limit
}
?
thanks,
Etienne