示例#1
0
 /// <summary>
 /// Creates a weld joint
 /// </summary>
 /// <param name="bodyA"></param>
 /// <param name="bodyB"></param>
 /// <param name="worldAnchor">World space coordinates of weld joint</param>
 /// <returns></returns>
 public static FSWeldJoint CreateWeldJoint(FSBody bodyA, FSBody bodyB, FVector2 worldAnchor)
 {
     FSWeldJoint joint = new FSWeldJoint(bodyA, bodyB, bodyA.GetLocalPoint(worldAnchor),
                                     bodyB.GetLocalPoint(worldAnchor));
     return joint;
 }
示例#2
0
 /// <summary>
 /// Creates a prsimatic joint
 /// </summary>
 /// <param name="bodyA"></param>
 /// <param name="bodyB"></param>
 /// <param name="localanchorB"></param>
 /// <param name="axis"></param>
 /// <returns></returns>
 public static FSPrismaticJoint CreatePrismaticJoint(FSBody bodyA, FSBody bodyB, FVector2 localanchorB, FVector2 axis)
 {
     FVector2 localanchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(localanchorB));
     FSPrismaticJoint joint = new FSPrismaticJoint(bodyA, bodyB, localanchorA, localanchorB, axis);
     return joint;
 }
示例#3
0
 /// <summary>
 /// Creates a revolute joint.
 /// </summary>
 /// <param name="bodyA"></param>
 /// <param name="bodyB"></param>
 /// <param name="localAnchorB">The anchor of bodyB in local coordinates</param>
 /// <returns></returns>
 public static FSRevoluteJoint CreateRevoluteJoint(FSBody bodyA, FSBody bodyB, FVector2 localAnchorB)
 {
     FVector2 localanchorA = bodyA.GetLocalPoint(bodyB.GetWorldPoint(localAnchorB));
     FSRevoluteJoint joint = new FSRevoluteJoint(bodyA, bodyB, localanchorA, localAnchorB);
     return joint;
 }