Added some helper methods for constraints and btMatrix3x3,

Thanks to  francois, See Issue 466

Prevent crash in SoftBodyDemo, when picking constraints and demo-mode switches to next demo.
This commit is contained in:
erwin.coumans
2011-02-27 03:28:53 +00:00
parent e5b5126876
commit 4e8596eef5
14 changed files with 217 additions and 35 deletions

View File

@@ -143,17 +143,17 @@ public:
return m_rbB;
}
btTransform & getFrameOffsetA()
btTransform& getFrameOffsetA()
{
return m_rbAFrame;
}
btTransform & getFrameOffsetB()
btTransform& getFrameOffsetB()
{
return m_rbBFrame;
}
void setFrames(const btTransform & frameA, const btTransform & frameB);
void setFrames(const btTransform& frameA, const btTransform& frameB);
void setAngularOnly(bool angularOnly)
{
@@ -205,10 +205,13 @@ public:
btVector3 rbAxisB1 = quatRotate(rotationArc,rbAxisA1);
btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
m_rbBFrame.getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA));
m_rbBFrame.getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA));
m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
m_rbBFrame.getBasis() = m_rbB.getCenterOfMassTransform().getBasis().inverse() * m_rbBFrame.getBasis();
}
btScalar getLowerLimit() const