Exemplo n.º 1
0
 public static RevoluteJoint CreateRevoluteJoint(this World world, Body bodyA, Body bodyB, Vector2 anchor)
 {
     Vector2 localanchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(anchor));
     RevoluteJoint joint = new RevoluteJoint(bodyA, bodyB, localanchorA, anchor);
     world.AddJoint(joint);
     return joint;
 }
Exemplo n.º 2
0
 public static RopeJoint CreateRopeJoint(this World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false)
 {
     RopeJoint ropeJoint = new RopeJoint(bodyA, bodyB, anchorA, anchorB, useWorldCoordinates);
     world.AddJoint(ropeJoint);
     return ropeJoint;
 }
Exemplo n.º 3
0
 public static PrismaticJoint CreatePrismaticJoint(this World world, Body bodyA, Body bodyB, Vector2 anchor, Vector2 axis, bool useWorldCoordinates = false)
 {
     PrismaticJoint joint = new PrismaticJoint(bodyA, bodyB, anchor, axis, useWorldCoordinates);
     world.AddJoint(joint);
     return joint;
 }
Exemplo n.º 4
0
 public static PulleyJoint CreatePulleyJoint(this World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, Vector2 worldAnchorA, Vector2 worldAnchorB, float ratio, bool useWorldCoordinates = false)
 {
     PulleyJoint pulleyJoint = new PulleyJoint(bodyA, bodyB, anchorA, anchorB, worldAnchorA, worldAnchorB, ratio, useWorldCoordinates);
     world.AddJoint(pulleyJoint);
     return pulleyJoint;
 }
Exemplo n.º 5
0
 public static GearJoint CreateGearJoint(this World world, Body bodyA, Body bodyB, Joint jointA, Joint jointB, float ratio)
 {
     GearJoint gearJoint = new GearJoint(bodyA, bodyB, jointA, jointB, ratio);
     world.AddJoint(gearJoint);
     return gearJoint;
 }
Exemplo n.º 6
0
 public static MotorJoint CreateMotorJoint(this World world, Body bodyA, Body bodyB, bool useWorldCoordinates = false)
 {
     MotorJoint joint = new MotorJoint(bodyA, bodyB, useWorldCoordinates);
     world.AddJoint(joint);
     return joint;
 }
Exemplo n.º 7
0
 public static FrictionJoint CreateFrictionJoint(this World world, Body bodyA, Body bodyB, Vector2 anchor, bool useWorldCoordinates = false)
 {
     FrictionJoint frictionJoint = new FrictionJoint(bodyA, bodyB, anchor, useWorldCoordinates);
     world.AddJoint(frictionJoint);
     return frictionJoint;
 }
Exemplo n.º 8
0
 public static FixedMouseJoint CreateFixedMouseJoint(this World world, Body body, Vector2 worldAnchor)
 {
     FixedMouseJoint joint = new FixedMouseJoint(body, worldAnchor);
     world.AddJoint(joint);
     return joint;
 }
Exemplo n.º 9
0
 public static DistanceJoint CreateDistanceJoint(this World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false)
 {
     DistanceJoint distanceJoint = new DistanceJoint(bodyA, bodyB, anchorA, anchorB, useWorldCoordinates);
     world.AddJoint(distanceJoint);
     return distanceJoint;
 }
Exemplo n.º 10
0
 public static AngleJoint CreateAngleJoint(this World world, Body bodyA, Body bodyB)
 {
     AngleJoint angleJoint = new AngleJoint(bodyA, bodyB);
     world.AddJoint(angleJoint);
     return angleJoint;
 }
Exemplo n.º 11
0
 public static WeldJoint CreateWeldJoint(this World world, Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false)
 {
     WeldJoint weldJoint = new WeldJoint(bodyA, bodyB, anchorA, anchorB, useWorldCoordinates);
     world.AddJoint(weldJoint);
     return weldJoint;
 }