Bug in the sign of linear motor force for btSliderConstraint fixed

This commit is contained in:
rponom
2009-01-09 00:32:06 +00:00
parent bdfd9784ed
commit 682dd3262b
2 changed files with 8 additions and 7 deletions

View File

@@ -344,7 +344,8 @@ void btSliderConstraint::getInfo2(btConstraintInfo2* info)
info->cfm[nrow] = btScalar(0.0);
btScalar tag_vel = getTargetLinMotorVelocity();
btScalar mot_fact = getMotorFactor(m_linPos, m_lowerLinLimit, m_upperLinLimit, tag_vel, info->fps * info->erp);
info->m_constraintError[srow] += mot_fact * getTargetLinMotorVelocity();
// info->m_constraintError[srow] += mot_fact * getTargetLinMotorVelocity();
info->m_constraintError[srow] -= signFact * mot_fact * getTargetLinMotorVelocity();
info->m_lowerLimit[srow] += -getMaxLinMotorForce() * info->fps;
info->m_upperLimit[srow] += getMaxLinMotorForce() * info->fps;
}