org.jbox2d.p5
Class JointUtils
java.lang.Object
org.jbox2d.p5.JointUtils
public class JointUtils
- extends java.lang.Object
Method Summary |
static org.jbox2d.dynamics.joints.DistanceJoint |
createDistanceJoint(org.jbox2d.dynamics.Body a,
org.jbox2d.dynamics.Body b)
Creates and returns a simple distance joint between two bodies, based on
their world body positions (NOT their centers of mass). |
static org.jbox2d.dynamics.joints.DistanceJoint |
createDistanceJoint(org.jbox2d.dynamics.World w,
org.jbox2d.common.Vec2 pA,
org.jbox2d.common.Vec2 pB)
Creates a distance joint between bodies that touch the given points,
anchored at those points. |
static org.jbox2d.dynamics.joints.RevoluteJoint |
createRevoluteJoint(org.jbox2d.dynamics.Body a,
org.jbox2d.dynamics.Body b,
org.jbox2d.common.Vec2 worldCenter)
Creates a RevoluteJoint between two bodies that rotates around a given
point in World coordinates. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JointUtils
public JointUtils()
createDistanceJoint
public static org.jbox2d.dynamics.joints.DistanceJoint createDistanceJoint(org.jbox2d.dynamics.World w,
org.jbox2d.common.Vec2 pA,
org.jbox2d.common.Vec2 pB)
- Creates a distance joint between bodies that touch the given points,
anchored at those points. Returns null if there are not two different
bodies at the points given. Behavior is undetermined if more than one
body touches a point.
- Parameters:
w
- World to add joint to and read bodies frompA
- First point to attach topB
- Second point to attach to
- Returns:
- Joint created, or null if impossible to create the joint
createDistanceJoint
public static org.jbox2d.dynamics.joints.DistanceJoint createDistanceJoint(org.jbox2d.dynamics.Body a,
org.jbox2d.dynamics.Body b)
- Creates and returns a simple distance joint between two bodies, based on
their world body positions (NOT their centers of mass).
- Parameters:
a
- b
-
- Returns:
- a new DistanceJoint
createRevoluteJoint
public static org.jbox2d.dynamics.joints.RevoluteJoint createRevoluteJoint(org.jbox2d.dynamics.Body a,
org.jbox2d.dynamics.Body b,
org.jbox2d.common.Vec2 worldCenter)
- Creates a RevoluteJoint between two bodies that rotates around a given
point in World coordinates.
- Parameters:
a
- b
- worldCenter
-
- Returns: