Merge pull request #1119 from AndrewMeadows/minor-cleanup-contraints
fix typo in btHingeConstraint method name
This commit is contained in:
@@ -516,7 +516,7 @@ int b3Generic6DofConstraint::get_limit_motor_info2(
|
|||||||
b3ConstraintInfo2 *info, int row, b3Vector3& ax1, int rotational,int rotAllowed)
|
b3ConstraintInfo2 *info, int row, b3Vector3& ax1, int rotational,int rotAllowed)
|
||||||
{
|
{
|
||||||
int srow = row * info->rowskip;
|
int srow = row * info->rowskip;
|
||||||
int powered = limot->m_enableMotor;
|
bool powered = limot->m_enableMotor;
|
||||||
int limit = limot->m_currentLimit;
|
int limit = limot->m_currentLimit;
|
||||||
if (powered || limit)
|
if (powered || limit)
|
||||||
{ // if the joint is powered, or has joint limits, add in the extra row
|
{ // if the joint is powered, or has joint limits, add in the extra row
|
||||||
@@ -584,7 +584,7 @@ int b3Generic6DofConstraint::get_limit_motor_info2(
|
|||||||
}
|
}
|
||||||
// if we're limited low and high simultaneously, the joint motor is
|
// if we're limited low and high simultaneously, the joint motor is
|
||||||
// ineffective
|
// ineffective
|
||||||
if (limit && (limot->m_loLimit == limot->m_hiLimit)) powered = 0;
|
if (limit && (limot->m_loLimit == limot->m_hiLimit)) powered = false;
|
||||||
info->m_constraintError[srow] = b3Scalar(0.f);
|
info->m_constraintError[srow] = b3Scalar(0.f);
|
||||||
if (powered)
|
if (powered)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -776,7 +776,7 @@ int btGeneric6DofConstraint::get_limit_motor_info2(
|
|||||||
btConstraintInfo2 *info, int row, btVector3& ax1, int rotational,int rotAllowed)
|
btConstraintInfo2 *info, int row, btVector3& ax1, int rotational,int rotAllowed)
|
||||||
{
|
{
|
||||||
int srow = row * info->rowskip;
|
int srow = row * info->rowskip;
|
||||||
int powered = limot->m_enableMotor;
|
bool powered = limot->m_enableMotor;
|
||||||
int limit = limot->m_currentLimit;
|
int limit = limot->m_currentLimit;
|
||||||
if (powered || limit)
|
if (powered || limit)
|
||||||
{ // if the joint is powered, or has joint limits, add in the extra row
|
{ // if the joint is powered, or has joint limits, add in the extra row
|
||||||
@@ -840,7 +840,7 @@ int btGeneric6DofConstraint::get_limit_motor_info2(
|
|||||||
}
|
}
|
||||||
// if we're limited low and high simultaneously, the joint motor is
|
// if we're limited low and high simultaneously, the joint motor is
|
||||||
// ineffective
|
// ineffective
|
||||||
if (limit && (limot->m_loLimit == limot->m_hiLimit)) powered = 0;
|
if (limit && (limot->m_loLimit == limot->m_hiLimit)) powered = false;
|
||||||
info->m_constraintError[srow] = btScalar(0.f);
|
info->m_constraintError[srow] = btScalar(0.f);
|
||||||
if (powered)
|
if (powered)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -556,11 +556,7 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf
|
|||||||
|
|
||||||
}
|
}
|
||||||
// if the hinge has joint limits or motor, add in the extra row
|
// if the hinge has joint limits or motor, add in the extra row
|
||||||
int powered = 0;
|
bool powered = getEnableAngularMotor();
|
||||||
if(getEnableAngularMotor())
|
|
||||||
{
|
|
||||||
powered = 1;
|
|
||||||
}
|
|
||||||
if(limit || powered)
|
if(limit || powered)
|
||||||
{
|
{
|
||||||
nrow++;
|
nrow++;
|
||||||
@@ -577,7 +573,7 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf
|
|||||||
btScalar histop = getUpperLimit();
|
btScalar histop = getUpperLimit();
|
||||||
if(limit && (lostop == histop))
|
if(limit && (lostop == histop))
|
||||||
{ // the joint motor is ineffective
|
{ // the joint motor is ineffective
|
||||||
powered = 0;
|
powered = false;
|
||||||
}
|
}
|
||||||
info->m_constraintError[srow] = btScalar(0.0f);
|
info->m_constraintError[srow] = btScalar(0.0f);
|
||||||
btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : normalErp;
|
btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : normalErp;
|
||||||
@@ -951,11 +947,7 @@ void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info
|
|||||||
|
|
||||||
}
|
}
|
||||||
// if the hinge has joint limits or motor, add in the extra row
|
// if the hinge has joint limits or motor, add in the extra row
|
||||||
int powered = 0;
|
bool powered = getEnableAngularMotor();
|
||||||
if(getEnableAngularMotor())
|
|
||||||
{
|
|
||||||
powered = 1;
|
|
||||||
}
|
|
||||||
if(limit || powered)
|
if(limit || powered)
|
||||||
{
|
{
|
||||||
nrow++;
|
nrow++;
|
||||||
@@ -972,7 +964,7 @@ void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info
|
|||||||
btScalar histop = getUpperLimit();
|
btScalar histop = getUpperLimit();
|
||||||
if(limit && (lostop == histop))
|
if(limit && (lostop == histop))
|
||||||
{ // the joint motor is ineffective
|
{ // the joint motor is ineffective
|
||||||
powered = 0;
|
powered = false;
|
||||||
}
|
}
|
||||||
info->m_constraintError[srow] = btScalar(0.0f);
|
info->m_constraintError[srow] = btScalar(0.0f);
|
||||||
btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : normalErp;
|
btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : normalErp;
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ public:
|
|||||||
{
|
{
|
||||||
return m_enableAngularMotor;
|
return m_enableAngularMotor;
|
||||||
}
|
}
|
||||||
inline btScalar getMotorTargetVelosity()
|
inline btScalar getMotorTargetVelocity()
|
||||||
{
|
{
|
||||||
return m_motorTargetVelocity;
|
return m_motorTargetVelocity;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,7 +364,6 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
|
|||||||
int srow;
|
int srow;
|
||||||
btScalar limit_err;
|
btScalar limit_err;
|
||||||
int limit;
|
int limit;
|
||||||
int powered;
|
|
||||||
|
|
||||||
// next two rows.
|
// next two rows.
|
||||||
// we want: velA + wA x relA == velB + wB x relB ... but this would
|
// we want: velA + wA x relA == velB + wB x relB ... but this would
|
||||||
@@ -470,11 +469,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
|
|||||||
limit_err = getLinDepth() * signFact;
|
limit_err = getLinDepth() * signFact;
|
||||||
limit = (limit_err > btScalar(0.0)) ? 2 : 1;
|
limit = (limit_err > btScalar(0.0)) ? 2 : 1;
|
||||||
}
|
}
|
||||||
powered = 0;
|
bool powered = getPoweredLinMotor();
|
||||||
if(getPoweredLinMotor())
|
|
||||||
{
|
|
||||||
powered = 1;
|
|
||||||
}
|
|
||||||
// if the slider has joint limits or motor, add in the extra row
|
// if the slider has joint limits or motor, add in the extra row
|
||||||
if (limit || powered)
|
if (limit || powered)
|
||||||
{
|
{
|
||||||
@@ -524,7 +519,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
|
|||||||
btScalar histop = getUpperLinLimit();
|
btScalar histop = getUpperLinLimit();
|
||||||
if(limit && (lostop == histop))
|
if(limit && (lostop == histop))
|
||||||
{ // the joint motor is ineffective
|
{ // the joint motor is ineffective
|
||||||
powered = 0;
|
powered = false;
|
||||||
}
|
}
|
||||||
info->m_constraintError[srow] = 0.;
|
info->m_constraintError[srow] = 0.;
|
||||||
info->m_lowerLimit[srow] = 0.;
|
info->m_lowerLimit[srow] = 0.;
|
||||||
@@ -609,11 +604,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
|
|||||||
limit = (limit_err > btScalar(0.0)) ? 1 : 2;
|
limit = (limit_err > btScalar(0.0)) ? 1 : 2;
|
||||||
}
|
}
|
||||||
// if the slider has joint limits, add in the extra row
|
// if the slider has joint limits, add in the extra row
|
||||||
powered = 0;
|
powered = getPoweredAngMotor();
|
||||||
if(getPoweredAngMotor())
|
|
||||||
{
|
|
||||||
powered = 1;
|
|
||||||
}
|
|
||||||
if(limit || powered)
|
if(limit || powered)
|
||||||
{
|
{
|
||||||
nrow++;
|
nrow++;
|
||||||
@@ -630,7 +621,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra
|
|||||||
btScalar histop = getUpperAngLimit();
|
btScalar histop = getUpperAngLimit();
|
||||||
if(limit && (lostop == histop))
|
if(limit && (lostop == histop))
|
||||||
{ // the joint motor is ineffective
|
{ // the joint motor is ineffective
|
||||||
powered = 0;
|
powered = false;
|
||||||
}
|
}
|
||||||
currERP = (m_flags & BT_SLIDER_FLAGS_ERP_LIMANG) ? m_softnessLimAng : info->erp;
|
currERP = (m_flags & BT_SLIDER_FLAGS_ERP_LIMANG) ? m_softnessLimAng : info->erp;
|
||||||
if(powered)
|
if(powered)
|
||||||
|
|||||||
Reference in New Issue
Block a user