# Class Joint

java.lang.Object
com.codename1.gaming.physics.box2d.dynamics.joints.Joint

Direct Known Subclasses:
  `ConstantVolumeJoint, DistanceJoint, FrictionJoint, GearJoint, MouseJoint, PrismaticJoint, PulleyJoint, RevoluteJoint, RopeJoint, WeldJoint, WheelJoint`

public abstract class Joint extends Object
The base joint class. Joints are used to constrain two bodies together in various fashions. Some joints also feature limits and motors.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Body`
  `m_bodyA`
  `protected Body`
  `m_bodyB`
  `JointEdge`
  `m_edgeA`
  `JointEdge`
  `m_edgeB`
  `boolean`
  `m_islandFlag`
  `Joint`
  `m_next`
  `Joint`
  `m_prev`
  `Object`
  `m_userData`
  `protected IWorldPool`
  `pool`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Joint(IWorldPool worldPool, JointDef def)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Joint`
  `create(World world, JointDef def)`
  `static void`
  `destroy(Joint joint)`
  `void`
  `destructor()`
  Override to handle destruction of joint
  `abstract void`
  `getAnchorA(Vec2 out)`
  get the anchor point on bodyA in world coordinates.
  `abstract void`
  `getAnchorB(Vec2 out)`
  get the anchor point on bodyB in world coordinates.
  `final Body`
  `getBodyA()`
  get the first body attached to this joint.
  `final Body`
  `getBodyB()`
  get the second body attached to this joint.
  `final boolean`
  `getCollideConnected()`
  `Joint`
  `getNext()`
  get the next joint the world joint list.
  `abstract void`
  `getReactionForce(float inv_dt, Vec2 out)`
  get the reaction force on body2 at the joint anchor in Newtons.
  `abstract float`
  `getReactionTorque(float inv_dt)`
  get the reaction torque on body2 in N*m.
  `JointType`
  `getType()`
  get the type of the concrete joint.
  `Object`
  `getUserData()`
  get the user data pointer.
  `abstract void`
  `initVelocityConstraints(SolverData data)`
  `boolean`
  `isActive()`
  Short-cut function to determine if either body is inactive.
  `void`
  `setUserData(Object data)`
  Set the user data pointer.
  `abstract boolean`
  `solvePositionConstraints(SolverData data)`
  This returns true if the position errors are within tolerance.
  `abstract void`
  `solveVelocityConstraints(SolverData data)`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### m_prev

    public Joint m_prev

  - ### m_next

    public Joint m_next

  - ### m_edgeA

    public JointEdge m_edgeA

  - ### m_edgeB

    public JointEdge m_edgeB

  - ### m_bodyA

    protected Body m_bodyA

  - ### m_bodyB

    protected Body m_bodyB

  - ### m_islandFlag

    public boolean m_islandFlag

  - ### m_userData

    public Object m_userData

  - ### pool

    protected IWorldPool pool

- ## Constructor Details

  - ### Joint

    protected Joint(IWorldPool worldPool, JointDef def)

- ## Method Details

  - ### create

    public static Joint create(World world, JointDef def)

  - ### destroy

    public static void destroy(Joint joint)

  - ### getType

    public JointType getType()
    get the type of the concrete joint.
    Returns:

  - ### getBodyA

    public final Body getBodyA()
    get the first body attached to this joint.

  - ### getBodyB

    public final Body getBodyB()
    get the second body attached to this joint.
    Returns:

  - ### getAnchorA

    public abstract void getAnchorA(Vec2 out)
    get the anchor point on bodyA in world coordinates.

  - ### getAnchorB

    public abstract void getAnchorB(Vec2 out)
    get the anchor point on bodyB in world coordinates.

  - ### getReactionForce

    public abstract void getReactionForce(float inv_dt, Vec2 out)
    get the reaction force on body2 at the joint anchor in Newtons.
    Parameters:
      `inv_dt` -

  - ### getReactionTorque

    public abstract float getReactionTorque(float inv_dt)
    get the reaction torque on body2 in N*m.
    Parameters:
      `inv_dt` -
    Returns:

  - ### getNext

    public Joint getNext()
    get the next joint the world joint list.

  - ### getUserData

    public Object getUserData()
    get the user data pointer.

  - ### setUserData

    public void setUserData(Object data)
    Set the user data pointer.

  - ### getCollideConnected

    public final boolean getCollideConnected()

  - ### isActive

    public boolean isActive()
    Short-cut function to determine if either body is inactive.
    Returns:

  - ### initVelocityConstraints

    public abstract void initVelocityConstraints(SolverData data)

  - ### solveVelocityConstraints

    public abstract void solveVelocityConstraints(SolverData data)

  - ### solvePositionConstraints

    public abstract boolean solvePositionConstraints(SolverData data)
    This returns true if the position errors are within tolerance.
    Parameters:
      `baumgarte` -
    Returns:

  - ### destructor

    public void destructor()
    Override to handle destruction of joint