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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user