internal DigitalRuneNoRotationJoint(NoRotationJointDescriptor descriptor)
        {
            WrappedNoRotationJoint = new NoRotationConstraint();

            #region set RigidBodies
            if (!(descriptor.RigidBodyA is RigidBody))
                throw new ArgumentException(String.Format("The type of the property 'RigidBodyA' must be '{0}'.", typeof(RigidBody)));
            WrappedNoRotationJoint.BodyA = ((RigidBody)descriptor.RigidBodyA).WrappedRigidBody;
            _rigidBodyA = descriptor.RigidBodyA;

            if (!(descriptor.RigidBodyB is RigidBody))
                throw new ArgumentException("The type of the property 'RigidBodyB' must be 'System.Physics.DigitalRune.RigidBody'.");
            WrappedNoRotationJoint.BodyB = ((RigidBody)descriptor.RigidBodyB).WrappedRigidBody;
            _rigidBodyB = descriptor.RigidBodyB;
            #endregion
            WrappedNoRotationJoint.AnchorOrientationALocal = descriptor.AnchorOrientationALocal.ToDigitalRune();
            WrappedNoRotationJoint.AnchorOrientationBLocal = descriptor.AnchorOrientationBLocal.ToDigitalRune();


            Descriptor = descriptor;
        }
Exemplo n.º 2
0
 public static INoRotationJoint CreateNoRotationJoint(this IFactory<IConstraint> factory,
                                    NoRotationJointDescriptor descriptor)
 {
     return factory.Create<INoRotationJoint, NoRotationJointDescriptor>(descriptor);
 }
 public DefaultNoRotationJoint(NoRotationJointDescriptor descriptor)
 {
     Descriptor = descriptor;
 }