Exemplo n.º 1
0
        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 DefaultCylindricalJoint(CylindricalJointDescriptor descriptor)
 {
     Descriptor = descriptor;
 }
Exemplo n.º 3
0
 public static ICylindricalJoint CreateCylindricalJoint(this IFactory <IConstraint> factory,
                                                        CylindricalJointDescriptor descriptor)
 {
     return(factory.Create <ICylindricalJoint, CylindricalJointDescriptor>(descriptor));
 }