Created a bunch of "get" methods for the btConeTwistConstraint.
This commit is contained in:
@@ -171,6 +171,11 @@ public:
|
|||||||
m_angularOnly = angularOnly;
|
m_angularOnly = angularOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool getAngularOnly() const
|
||||||
|
{
|
||||||
|
return m_angularOnly;
|
||||||
|
}
|
||||||
|
|
||||||
void setLimit(int limitIndex,btScalar limitValue)
|
void setLimit(int limitIndex,btScalar limitValue)
|
||||||
{
|
{
|
||||||
switch (limitIndex)
|
switch (limitIndex)
|
||||||
@@ -196,6 +201,33 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btScalar getLimit(int limitIndex) const
|
||||||
|
{
|
||||||
|
switch (limitIndex)
|
||||||
|
{
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
return m_twistSpan;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
return m_swingSpan2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
return m_swingSpan1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
btAssert(0 && "Invalid limitIndex specified for btConeTwistConstraint");
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// setLimit(), a few notes:
|
// setLimit(), a few notes:
|
||||||
// _softness:
|
// _softness:
|
||||||
// 0->1, recommend ~0.8->1.
|
// 0->1, recommend ~0.8->1.
|
||||||
@@ -218,8 +250,8 @@ public:
|
|||||||
m_relaxationFactor = _relaxationFactor;
|
m_relaxationFactor = _relaxationFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
const btTransform& getAFrame() { return m_rbAFrame; };
|
const btTransform& getAFrame() const { return m_rbAFrame; };
|
||||||
const btTransform& getBFrame() { return m_rbBFrame; };
|
const btTransform& getBFrame() const { return m_rbBFrame; };
|
||||||
|
|
||||||
inline int getSolveTwistLimit()
|
inline int getSolveTwistLimit()
|
||||||
{
|
{
|
||||||
@@ -239,27 +271,31 @@ public:
|
|||||||
void calcAngleInfo();
|
void calcAngleInfo();
|
||||||
void calcAngleInfo2(const btTransform& transA, const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
|
void calcAngleInfo2(const btTransform& transA, const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
|
||||||
|
|
||||||
inline btScalar getSwingSpan1()
|
inline btScalar getSwingSpan1() const
|
||||||
{
|
{
|
||||||
return m_swingSpan1;
|
return m_swingSpan1;
|
||||||
}
|
}
|
||||||
inline btScalar getSwingSpan2()
|
inline btScalar getSwingSpan2() const
|
||||||
{
|
{
|
||||||
return m_swingSpan2;
|
return m_swingSpan2;
|
||||||
}
|
}
|
||||||
inline btScalar getTwistSpan()
|
inline btScalar getTwistSpan() const
|
||||||
{
|
{
|
||||||
return m_twistSpan;
|
return m_twistSpan;
|
||||||
}
|
}
|
||||||
inline btScalar getTwistAngle()
|
inline btScalar getTwistAngle() const
|
||||||
{
|
{
|
||||||
return m_twistAngle;
|
return m_twistAngle;
|
||||||
}
|
}
|
||||||
bool isPastSwingLimit() { return m_solveSwingLimit; }
|
bool isPastSwingLimit() { return m_solveSwingLimit; }
|
||||||
|
|
||||||
|
btScalar getDamping() const { return m_damping; }
|
||||||
void setDamping(btScalar damping) { m_damping = damping; }
|
void setDamping(btScalar damping) { m_damping = damping; }
|
||||||
|
|
||||||
void enableMotor(bool b) { m_bMotorEnabled = b; }
|
void enableMotor(bool b) { m_bMotorEnabled = b; }
|
||||||
|
bool isMotorEnabled() const { return m_bMotorEnabled; }
|
||||||
|
btScalar getMaxMotorImpulse() const { return m_maxMotorImpulse; }
|
||||||
|
bool IsMaxMotorImpulseNormalized() const { return m_bNormalizedMotorStrength; }
|
||||||
void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = false; }
|
void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = false; }
|
||||||
void setMaxMotorImpulseNormalized(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = true; }
|
void setMaxMotorImpulseNormalized(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = true; }
|
||||||
|
|
||||||
@@ -271,6 +307,7 @@ public:
|
|||||||
// note: if q violates the joint limits, the internal target is clamped to avoid conflicting impulses (very bad for stability)
|
// note: if q violates the joint limits, the internal target is clamped to avoid conflicting impulses (very bad for stability)
|
||||||
// note: don't forget to enableMotor()
|
// note: don't forget to enableMotor()
|
||||||
void setMotorTarget(const btQuaternion &q);
|
void setMotorTarget(const btQuaternion &q);
|
||||||
|
const btQuaternion& getMotorTarget() const [ return m_qTarget; ]
|
||||||
|
|
||||||
// same as above, but q is the desired rotation of frameA wrt frameB in constraint space
|
// same as above, but q is the desired rotation of frameA wrt frameB in constraint space
|
||||||
void setMotorTargetInConstraintSpace(const btQuaternion &q);
|
void setMotorTargetInConstraintSpace(const btQuaternion &q);
|
||||||
|
|||||||
Reference in New Issue
Block a user