b2Joint Class
Abstract base joint class.
Joints are used to constraint two bodies together in various fashions. Some joints also feature limits and motors.
Constructor
b2Joint
-
jointDef
Parameters:
-
jointDef
B2JointDef
Item Index
Methods
Methods
create
-
b2JointDef
-
allocator
Create a joint from a joint definition.
Parameters:
-
b2JointDef
B2JointDef -
allocator
B2JointDef
Returns:
b2Joint
destroy
-
b2JointDef
-
allocator
Callback function called during World.step upon b2Joint destruction. Override this method to define your joint destruction behaviour.
NOTE: b2JointFactory.destroy(joint, allocator){ b2Joint.destroy(joint, allocator); }
getAnchorA
-
out
Get the anchor point on bodyA in world coordinates.
Parameters:
-
out
B2Vec2reusable object
Returns:
out
getAnchorB
-
out
Get the anchor point on bodyB in world coordinates.
Parameters:
-
out
B2Vec2reusable object
Returns:
out
getBodyA
()
B2Body
public
Get the first body attached to this joint.
Returns:
getBodyB
()
B2Body
public
Get the second body attached to this joint.
Returns:
getCollideConnected
()
Boolean
public
Get collide connected.
Note: modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap.
Returns:
getReactionForce
-
invDeltaTime
-
out
Get the reaction force on bodyB at the joint anchor in Newtons.
Parameters:
-
invDeltaTime
Number -
out
B2Vec2reusable object
Returns:
getReactionTorque
()
Float
public
Get the reaction torque on bodyB in N*m.
Returns:
getType
()
Int
public
Get the type of the concrete joint.
Returns:
getUserData
()
public
Get the application specific user data reference.
NOTE: Using the addPhysicsJS framework m_userData is managed for you extending either a createjs.container or createjs.movieClip class.
Returns:
initVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
setUserData
()
Void
public
Set the application specific userdata reference.
NOTE: Using the addPhysicsJS framework m_userData is managed for you extending either a createjs.container or createjs.movieClip class.
Returns:
shiftOrigin
-
newOrigin
Shift the origin for any points stored in world coordinates.
Parameters:
-
newOrigin
B2Vec2
Returns:
solveVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
solveVelocityConstraints
-
data
This returns true if the position errors are within tolerance.
Parameters:
-
data
B2SolverData
Returns:
Properties
m_bodyA
B2Body
public
'this' joint instance's body A.
Default: b2jointDef.bodyA
m_bodyB
B2Body
public
'this' joint instance's body B.
Default: b2jointDef.bodyB
m_collideConnected
Boolean
public
Will body A be able to collide with body B, or not?
Default: b2jointDef.collideConnected
m_edgeA
B2JointEdge
public
A joint edge belongs to a doubly linked list maintained in each attached body. Each joint has two joint nodes, one for each attached body.
m_edgeB
B2JointEdge
public
A joint edge belongs to a doubly linked list maintained in each attached body. Each joint has two joint nodes, one for each attached body.
m_index
Int
public
Default: false
m_next
b2Joint | Null
public
Next joint in the world's joint linked-list. May be null if 'this' joint instance is the head of the linked-list.
Default: null
m_type
Int
public
Joint type: distance, wheel (line), mouse, prismatic, pulley, revolute, weld, friction, gear, rope, motor, and (constant) area.
Default: b2jointDef.type
m_userData
public
Application specific data.
NOTE: Using the addPhysicsJS framework m_userData is managed for you extending either a createjs.container or createjs.movieClip class.
Default: b2jointDef.userData
ParentClass
Constructor
public
Super class constructor function reference for sub classes.
NOTE: Explicit declaration to protect against sub-classes inheriting a prototype.constructor value other than this.