internal DigitalRuneHingeJoint(HingeJointDescriptor descriptor) { WrappedHingeJoint = new HingeJoint(); #region set RigidBodies if (!(descriptor.RigidBodyA is RigidBody)) throw new ArgumentException(String.Format("The type of the property 'RigidBodyA' must be '{0}'.", typeof(RigidBody))); WrappedHingeJoint.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'."); WrappedHingeJoint.BodyB = ((RigidBody)descriptor.RigidBodyB).WrappedRigidBody; _rigidBodyB = descriptor.RigidBodyB; #endregion WrappedHingeJoint.AnchorPoseALocal = descriptor.AnchorPoseALocal.ToDigitalRune(); WrappedHingeJoint.AnchorPoseBLocal = descriptor.AnchorPoseBLocal.ToDigitalRune(); WrappedHingeJoint.Maximum = descriptor.MaximumAngle; WrappedHingeJoint.Minimum = descriptor.MinimumAngle; Descriptor = descriptor; }
public static IHingeJoint CreateHingeJoint(this IFactory<IConstraint> factory, HingeJointDescriptor descriptor) { return factory.Create<IHingeJoint, HingeJointDescriptor>(descriptor); }
public DefaultHingeJoint(HingeJointDescriptor descriptor) { Descriptor = descriptor; }