add support in btHingeConstraint for m_angularOnly
This commit is contained in:
@@ -358,10 +358,13 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf
|
|||||||
}
|
}
|
||||||
#endif //#if 0
|
#endif //#if 0
|
||||||
// linear (all fixed)
|
// linear (all fixed)
|
||||||
info->m_J1linearAxis[0] = 1;
|
|
||||||
info->m_J1linearAxis[skip + 1] = 1;
|
if (!m_angularOnly)
|
||||||
info->m_J1linearAxis[2 * skip + 2] = 1;
|
{
|
||||||
|
info->m_J1linearAxis[0] = 1;
|
||||||
|
info->m_J1linearAxis[skip + 1] = 1;
|
||||||
|
info->m_J1linearAxis[2 * skip + 2] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -383,10 +386,13 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf
|
|||||||
}
|
}
|
||||||
// linear RHS
|
// linear RHS
|
||||||
btScalar k = info->fps * info->erp;
|
btScalar k = info->fps * info->erp;
|
||||||
for(i = 0; i < 3; i++)
|
if (!m_angularOnly)
|
||||||
{
|
{
|
||||||
info->m_constraintError[i * skip] = k * (pivotBInW[i] - pivotAInW[i]);
|
for(i = 0; i < 3; i++)
|
||||||
}
|
{
|
||||||
|
info->m_constraintError[i * skip] = k * (pivotBInW[i] - pivotAInW[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
// make rotations around X and Y equal
|
// make rotations around X and Y equal
|
||||||
// the hinge axis should be the only unconstrained
|
// the hinge axis should be the only unconstrained
|
||||||
// rotational axis, the angular velocity of the two bodies perpendicular to
|
// rotational axis, the angular velocity of the two bodies perpendicular to
|
||||||
|
|||||||
Reference in New Issue
Block a user