public Joint(World world, dJointID ptr, OdeJoint.JointType type) { this.world = world; this.type = type; this.ptr = ptr; id = InstanceMap.Add(this); ode.dJointSetData(ptr, (IntPtr)id); }
public static Joint Create(World world, OdeJoint.JointType type) { if (type == OdeJoint.JointType.Hinge) { return(new HingeJoint(world, ode.dJointCreateHinge(world.ptr, world.jointgroup))); } else if (type == OdeJoint.JointType.Ball) { return(new BallJoint(world, ode.dJointCreateBall(world.ptr, world.jointgroup))); } else if (type == OdeJoint.JointType.AMotor) { return(new AMotor(world, ode.dJointCreateAMotor(world.ptr, world.jointgroup))); } else if (type == OdeJoint.JointType.Universal) { return(new UniversalJoint(world, ode.dJointCreateUniversal(world.ptr, world.jointgroup))); } return(null); }