Usually m_contactNormal2 == -m_contactNormal1, but not always, so

use a separate contactNormal1/contactNormal2 for each body in btSolverConstraint.

Thanks to Richard McDaniel for the patch.
This commit is contained in:
erwin.coumans
2012-12-12 23:21:51 +00:00
parent fe92502332
commit 1d4a5d950d
8 changed files with 111 additions and 86 deletions

View File

@@ -781,17 +781,16 @@ int btGeneric6DofConstraint::get_limit_motor_info2(
if (powered || limit)
{ // if the joint is powered, or has joint limits, add in the extra row
btScalar *J1 = rotational ? info->m_J1angularAxis : info->m_J1linearAxis;
btScalar *J2 = rotational ? info->m_J2angularAxis : 0;
btScalar *J2 = rotational ? info->m_J2angularAxis : info->m_J2linearAxis;
J1[srow+0] = ax1[0];
J1[srow+1] = ax1[1];
J1[srow+2] = ax1[2];
if(rotational)
{
J2[srow+0] = -ax1[0];
J2[srow+1] = -ax1[1];
J2[srow+2] = -ax1[2];
}
if((!rotational))
J2[srow+0] = -ax1[0];
J2[srow+1] = -ax1[1];
J2[srow+2] = -ax1[2];
if((!rotational))
{
if (m_useOffsetForConstraintFrame)
{