Exemplo n.º 1
0
        public static RevoluteJoint CreateRevoluteJoint(World world, Body bodyA, Body bodyB, TSVector2 anchor)
        {
            TSVector2     localPoint    = bodyA.GetLocalPoint(bodyB.GetWorldPoint(anchor));
            RevoluteJoint revoluteJoint = new RevoluteJoint(bodyA, bodyB, localPoint, anchor, false);

            world.AddJoint(revoluteJoint);
            return(revoluteJoint);
        }
Exemplo n.º 2
0
 public WheelJoint(Body bodyA, Body bodyB, TSVector2 anchor, TSVector2 axis, bool useWorldCoordinates = false) : base(bodyA, bodyB)
 {
     base.JointType = JointType.Wheel;
     if (useWorldCoordinates)
     {
         this.LocalAnchorA = bodyA.GetLocalPoint(anchor);
         this.LocalAnchorB = bodyB.GetLocalPoint(anchor);
     }
     else
     {
         this.LocalAnchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(anchor));
         this.LocalAnchorB = anchor;
     }
     this.Axis = axis;
 }