Beispiel #1
0
 //!@}
 public Generic6DofConstraint(RigidBody rbA, RigidBody rbB, btTransform frameInA, btTransform frameInB, bool useLinearReferenceFrameA)
     : base(TypedConstraintType.D6_CONSTRAINT_TYPE, rbA, rbB)
 {
     m_linearLimits = new TranslationalLimitMotor();
     m_angularLimits = new RotationalLimitMotor[3];
     for (int i = 0; i < m_angularLimits.Length; i++)
         m_angularLimits[i] = new RotationalLimitMotor();
     m_frameInA = frameInA;
     m_frameInB = frameInB;
     m_useLinearReferenceFrameA = useLinearReferenceFrameA;
     m_useOffsetForConstraintFrame = D6_USE_FRAME_OFFSET;
     m_flags = bt6DofFlags.BT_6DOF_FLAGS_NONE;
     m_useSolveConstraintObsolete = D6_USE_OBSOLETE_METHOD;
     calculateTransforms();
 }
Beispiel #2
0
 public Generic6DofConstraint(RigidBody rbB, btTransform frameInB, bool useLinearReferenceFrameB)
     : base(TypedConstraintType.D6_CONSTRAINT_TYPE, getFixedBody(), rbB)
 {
     m_linearLimits = new TranslationalLimitMotor();
     m_angularLimits = new RotationalLimitMotor[3];
     for (int i = 0; i < m_angularLimits.Length; i++)
         m_angularLimits[i] = new RotationalLimitMotor();
     m_frameInB = frameInB;
     m_useLinearReferenceFrameA = useLinearReferenceFrameB;
     m_useOffsetForConstraintFrame = D6_USE_FRAME_OFFSET;
     m_flags = bt6DofFlags.BT_6DOF_FLAGS_NONE;
     m_useSolveConstraintObsolete = false;
     ///not providing rigidbody A means implicitly using worldspace for body A
     m_frameInA = rbB.CenterOfMassTransform * m_frameInB;
     calculateTransforms();
 }