fixed 2 physics related bugs (friction had a typo, and jacobian calculation too)

This commit is contained in:
Erwin Coumans 2006-05-09 19:03:26 +00:00
parent cc8f876950
commit d66d173c20
2 changed files with 3 additions and 3 deletions

@ -211,7 +211,7 @@ float resolveSingleFriction(
SimdScalar vrel = contactPoint.m_frictionWorldTangential0.dot(vel);
// calculate j that moves us to zero relative velocity
SimdScalar j = -vrel * contactPoint.m_jacDiagABInvTangent1;
SimdScalar j = -vrel * contactPoint.m_jacDiagABInvTangent0;
float total = contactPoint.m_accumulatedTangentImpulse0 + j;
GEN_set_min(total, limit);
GEN_set_max(total, -limit);

@ -45,7 +45,7 @@ public:
:m_jointAxis(jointAxis)
{
m_aJ = world2A*(rel_pos1.cross(m_jointAxis));
m_bJ = world2B*(rel_pos2.cross(m_jointAxis));
m_bJ = world2B*(rel_pos2.cross(-m_jointAxis));
m_0MinvJt = inertiaInvA * m_aJ;
m_1MinvJt = inertiaInvB * m_bJ;
m_Adiag = massInvA + m_0MinvJt.dot(m_aJ) + massInvB + m_1MinvJt.dot(m_bJ);
@ -76,7 +76,7 @@ public:
:m_jointAxis(jointAxis)
{
m_aJ= world2A*(rel_pos1.cross(m_jointAxis));
m_bJ = world2A*(rel_pos2.cross(m_jointAxis));
m_bJ = world2A*(rel_pos2.cross(-m_jointAxis));
m_0MinvJt = inertiaInvA * m_aJ;
m_1MinvJt = SimdVector3(0.f,0.f,0.f);
m_Adiag = massInvA + m_0MinvJt.dot(m_aJ);