Пример #1
0
 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);
 }
Пример #2
0
 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);
 }