Some improvements for the btConeTwistConstraint:

- member m_fixThresh was added;
- one of two swing rotations become fixed if the corresponding limit is less than m_fixThresh value;
This commit is contained in:
rponom
2009-02-18 19:46:42 +00:00
parent 4236764cfb
commit 8295114c68
2 changed files with 138 additions and 26 deletions

View File

@@ -48,6 +48,8 @@ public:
btScalar m_swingSpan2;
btScalar m_twistSpan;
btScalar m_fixThresh;
btVector3 m_swingAxis;
btVector3 m_twistAxis;
@@ -196,6 +198,9 @@ public:
void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = false; }
void setMaxMotorImpulseNormalized(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = true; }
btScalar getFixThresh() { return m_fixThresh; }
void setFixThresh(btScalar fixThresh) { m_fixThresh = fixThresh; }
// setMotorTarget:
// q: the desired rotation of bodyA wrt bodyB.
// note: if q violates the joint limits, the internal target is clamped to avoid conflicting impulses (very bad for stability)