Created a few getters and setters for the btHingeConstraint.

This commit is contained in:
MakoEnergy
2015-05-27 16:00:30 -05:00
parent ec84ce3304
commit e48e14889c

View File

@@ -177,6 +177,7 @@ public:
// maintain a given angular target. // maintain a given angular target.
void enableMotor(bool enableMotor) { m_enableAngularMotor = enableMotor; } void enableMotor(bool enableMotor) { m_enableAngularMotor = enableMotor; }
void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; } void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; }
void setMotorTargetVelocity(btScalar motorTargetVelocity) { m_motorTargetVelocity = motorTargetVelocity; }
void setMotorTarget(const btQuaternion& qAinB, btScalar dt); // qAinB is rotation of body A wrt body B. void setMotorTarget(const btQuaternion& qAinB, btScalar dt); // qAinB is rotation of body A wrt body B.
void setMotorTarget(btScalar targetAngle, btScalar dt); void setMotorTarget(btScalar targetAngle, btScalar dt);
@@ -194,6 +195,33 @@ public:
#endif #endif
} }
btScalar getLimitSoftness() const
{
#ifdef _BT_USE_CENTER_LIMIT_
return m_limit.getSoftness();
#else
return m_limitSoftness;
#endif
}
btScalar getLimitBiasFactor() const
{
#ifdef _BT_USE_CENTER_LIMIT_
return m_limit.getBiasFactor();
#else
return m_biasFactor;
#endif
}
btScalar getLimitRelaxationFactor() const
{
#ifdef _BT_USE_CENTER_LIMIT_
return m_limit.getRelaxationFactor();
#else
return m_relaxationFactor;
#endif
}
void setAxis(btVector3& axisInA) void setAxis(btVector3& axisInA)
{ {
btVector3 rbAxisA1, rbAxisA2; btVector3 rbAxisA1, rbAxisA2;
@@ -297,7 +325,9 @@ public:
// access for UseFrameOffset // access for UseFrameOffset
bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; } bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; } void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
// access for UseReferenceFrameA
bool getUseReferenceFrameA() const { return m_useReferenceFrameA; }
void setUseReferenceFrameA(bool useReferenceFrameA) { m_useReferenceFrameA = useReferenceFrameA; }
///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). ///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5).
///If no axis is provided, it uses the default axis for this constraint. ///If no axis is provided, it uses the default axis for this constraint.
@@ -305,6 +335,11 @@ public:
///return the local value of parameter ///return the local value of parameter
virtual btScalar getParam(int num, int axis = -1) const; virtual btScalar getParam(int num, int axis = -1) const;
virtual int getFlags() const
{
return m_flags;
}
virtual int calculateSerializeBufferSize() const; virtual int calculateSerializeBufferSize() const;
///fills the dataBuffer and returns the struct name (and 0 on failure) ///fills the dataBuffer and returns the struct name (and 0 on failure)