Add some accessor methods to btHingeConstraint and btSliderConstraint, to allow conversion.
Thanks to Roman Ponomarev.
This commit is contained in:
@@ -403,3 +403,4 @@ btScalar btHingeConstraint::getHingeAngle()
|
|||||||
|
|
||||||
return btAtan2Fast( swingAxis.dot(refAxis0), swingAxis.dot(refAxis1) );
|
return btAtan2Fast( swingAxis.dot(refAxis0), swingAxis.dot(refAxis1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,23 @@ public:
|
|||||||
return m_limitSign;
|
return m_limitSign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool getAngularOnly()
|
||||||
|
{
|
||||||
|
return m_angularOnly;
|
||||||
|
}
|
||||||
|
inline bool getEnableAngularMotor()
|
||||||
|
{
|
||||||
|
return m_enableAngularMotor;
|
||||||
|
}
|
||||||
|
inline btScalar getMotorTargetVelosity()
|
||||||
|
{
|
||||||
|
return m_motorTargetVelocity;
|
||||||
|
}
|
||||||
|
inline btScalar getMaxMotorImpulse()
|
||||||
|
{
|
||||||
|
return m_maxMotorImpulse;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //HINGECONSTRAINT_H
|
#endif //HINGECONSTRAINT_H
|
||||||
|
|||||||
@@ -395,3 +395,20 @@ void btSliderConstraint::testAngLimits(void)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
btVector3 btSliderConstraint::getAncorInA(void)
|
||||||
|
{
|
||||||
|
btVector3 ancorInA;
|
||||||
|
ancorInA = m_realPivotAInW + (m_lowerLinLimit + m_upperLinLimit) * btScalar(0.5) * m_sliderAxis;
|
||||||
|
ancorInA = m_rbA.getCenterOfMassTransform().inverse() * ancorInA;
|
||||||
|
return ancorInA;
|
||||||
|
} // btSliderConstraint::getAncorInA()
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
btVector3 btSliderConstraint::getAncorInB(void)
|
||||||
|
{
|
||||||
|
btVector3 ancorInB;
|
||||||
|
ancorInB = m_frameInB.getOrigin();
|
||||||
|
return ancorInB;
|
||||||
|
} // btSliderConstraint::getAncorInB();
|
||||||
|
|||||||
@@ -204,6 +204,9 @@ public:
|
|||||||
void calculateTransforms(void);
|
void calculateTransforms(void);
|
||||||
void testLinLimits(void);
|
void testLinLimits(void);
|
||||||
void testAngLimits(void);
|
void testAngLimits(void);
|
||||||
|
// access for PE Solver
|
||||||
|
btVector3 getAncorInA(void);
|
||||||
|
btVector3 getAncorInB(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user