Package org.jbox2d.dynamics.joints
Class Joint
java.lang.Object
org.jbox2d.dynamics.joints.Joint
- Direct Known Subclasses:
ConstantVolumeJoint
,DistanceJoint
,FrictionJoint
,GearJoint
,MouseJoint
,PrismaticJoint
,PulleyJoint
,RevoluteJoint
,RopeJoint
,WeldJoint
,WheelJoint
public abstract class Joint
extends java.lang.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
FieldsModifier and TypeFieldDescriptionprotected Body
protected Body
private boolean
boolean
private final JointType
java.lang.Object
protected IWorldPool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Joint
static void
void
Override to handle destruction of jointabstract 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
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.getType()
get the type of the concrete joint.java.lang.Object
get the user data pointer.abstract void
boolean
isActive()
Short-cut function to determine if either body is inactive.void
setUserData
(java.lang.Object data) Set the user data pointer.abstract boolean
This returns true if the position errors are within tolerance.abstract void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
m_type
-
m_prev
-
m_next
-
m_edgeA
-
m_edgeB
-
m_bodyA
-
m_bodyB
-
m_islandFlag
public boolean m_islandFlag -
m_collideConnected
private boolean m_collideConnected -
m_userData
public java.lang.Object m_userData -
pool
-
-
Constructor Details
-
Joint
-
-
Method Details
-
create
-
destroy
-
getType
get the type of the concrete joint.- Returns:
-
getBodyA
get the first body attached to this joint. -
getBodyB
get the second body attached to this joint.- Returns:
-
getAnchorA
get the anchor point on bodyA in world coordinates. -
getAnchorB
get the anchor point on bodyB in world coordinates. -
getReactionForce
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
get the next joint the world joint list. -
getUserData
public java.lang.Object getUserData()get the user data pointer. -
setUserData
public void setUserData(java.lang.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
-
solveVelocityConstraints
-
solvePositionConstraints
This returns true if the position errors are within tolerance.- Parameters:
baumgarte
-- Returns:
-
destructor
public void destructor()Override to handle destruction of joint
-