internal DigitalRuneCylindricalJoint(CylindricalJointDescriptor descriptor)
        {
            WrappedCylindricalJoint = new CylindricalJoint();

            #region set RigidBodies
            if (!(descriptor.RigidBodyA is RigidBody))
                throw new ArgumentException(String.Format("The type of the property 'RigidBodyA' must be '{0}'.", typeof(RigidBody)));
            WrappedCylindricalJoint.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'.");
            WrappedCylindricalJoint.BodyB = ((RigidBody)descriptor.RigidBodyB).WrappedRigidBody;
            _rigidBodyB = descriptor.RigidBodyB;
            #endregion
            WrappedCylindricalJoint.AnchorPoseALocal = descriptor.AnchorPoseALocal.ToDigitalRune();
            WrappedCylindricalJoint.AnchorPoseBLocal = descriptor.AnchorPoseBLocal.ToDigitalRune();
            WrappedCylindricalJoint.AngularMaximum = descriptor.MaximumAngle;
            WrappedCylindricalJoint.AngularMinimum = descriptor.MinimumAngle;
            WrappedCylindricalJoint.LinearMaximum = descriptor.MaximumDistance;
            WrappedCylindricalJoint.LinearMinimum = descriptor.MinimumDistance; 


            Descriptor = descriptor;
        }
 public static ICylindricalJoint CreateCylindricalJoint(this IFactory<IConstraint> factory,
                               CylindricalJointDescriptor descriptor)
 {
     return factory.Create<ICylindricalJoint, CylindricalJointDescriptor>(descriptor);
 }
 public DefaultCylindricalJoint(CylindricalJointDescriptor descriptor)
 {
     Descriptor = descriptor;
 }