forked from bartvdbraak/blender
fixed 2 physics related bugs (friction had a typo, and jacobian calculation too)
This commit is contained in:
parent
cc8f876950
commit
d66d173c20
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user