'powered' is bool not int

This commit is contained in:
Andrew Meadows
2017-05-12 15:47:03 -07:00
parent 4a1c682c3c
commit 81758bf1b3
4 changed files with 16 additions and 33 deletions

View File

@@ -364,7 +364,6 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
int srow;
btScalar limit_err;
int limit;
int powered;
// next two rows.
// we want: velA + wA x relA == velB + wB x relB ... but this would
@@ -470,13 +469,9 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
limit_err = getLinDepth() * signFact;
limit = (limit_err > btScalar(0.0)) ? 2 : 1;
}
powered = 0;
if(getPoweredLinMotor())
{
powered = 1;
}
bool powered = getPoweredLinMotor();
// if the slider has joint limits or motor, add in the extra row
if (limit || powered)
if (limit || powered)
{
nrow++;
srow = nrow * info->rowskip;
@@ -524,7 +519,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
btScalar histop = getUpperLinLimit();
if(limit && (lostop == histop))
{ // the joint motor is ineffective
powered = 0;
powered = false;
}
info->m_constraintError[srow] = 0.;
info->m_lowerLimit[srow] = 0.;
@@ -609,12 +604,8 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
limit = (limit_err > btScalar(0.0)) ? 1 : 2;
}
// if the slider has joint limits, add in the extra row
powered = 0;
if(getPoweredAngMotor())
{
powered = 1;
}
if(limit || powered)
powered = getPoweredAngMotor();
if(limit || powered)
{
nrow++;
srow = nrow * info->rowskip;
@@ -630,7 +621,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
btScalar histop = getUpperAngLimit();
if(limit && (lostop == histop))
{ // the joint motor is ineffective
powered = 0;
powered = false;
}
currERP = (m_flags & BT_SLIDER_FLAGS_ERP_LIMANG) ? m_softnessLimAng : info->erp;
if(powered)