API Documentation for:
Show:

b2Joint Class

Defined in: b2Joint:17
Module: Joints

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
)

Defined in b2Joint:17

Parameters:

  • jointDef B2JointDef

Methods

create

(
  • b2JointDef
  • allocator
)
static

Defined in create:235

Create a joint from a joint definition.

Parameters:

  • b2JointDef B2JointDef
  • allocator B2JointDef

Returns:

b2Joint

destroy

(
  • b2JointDef
  • allocator
)
static

Defined in destroy:248

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); }

Parameters:

getAnchorA

(
  • out
)
B2Vec2 public

Defined in getAnchorA:298

Get the anchor point on bodyA in world coordinates.

Parameters:

  • out B2Vec2

    reusable object

Returns:

B2Vec2:

out

getAnchorB

(
  • out
)
B2Vec2 public

Defined in getAnchorB:311

Get the anchor point on bodyB in world coordinates.

Parameters:

  • out B2Vec2

    reusable object

Returns:

B2Vec2:

out

getBodyA

() B2Body public

Defined in getBodyA:276

Get the first body attached to this joint.

Returns:

B2Body:

getBodyB

() B2Body public

Defined in getBodyB:287

Get the second body attached to this joint.

Returns:

B2Body:

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:

getNext

() b2Joint public

Defined in getNext:350

Get the next joint in the world joint list.

Returns:

getReactionForce

(
  • invDeltaTime
  • out
)
B2Vec2 public

Get the reaction force on bodyB at the joint anchor in Newtons.

Parameters:

  • invDeltaTime Number
  • out B2Vec2

    reusable object

Returns:

B2Vec2:

getReactionTorque

() Float public

Get the reaction torque on bodyB in N*m.

Returns:

Float:

getType

() Int public

Defined in getType:265

Get the type of the concrete joint.

Returns:

Int:

getUserData

() public

Defined in getUserData:361

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
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

isActive

() Boolean public

Defined in isActive:414

Short-cut function to determine if either body is inactive.

Returns:

setUserData

() Void public

Defined in setUserData:380

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:

Void:

shiftOrigin

(
  • newOrigin
)
Void public

Defined in shiftOrigin:456

Shift the origin for any points stored in world coordinates.

Parameters:

  • newOrigin B2Vec2

Returns:

Void:

solveVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

solveVelocityConstraints

(
  • data
)
Void public

This returns true if the position errors are within tolerance.

Parameters:

  • data B2SolverData

Returns:

Void:

Properties

m_bodyA

B2Body public

Defined in m_bodyA:107

'this' joint instance's body A.

Default: b2jointDef.bodyA

m_bodyB

B2Body public

Defined in m_bodyB:117

'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

Defined in m_edgeA:51

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

Defined in m_edgeB:62

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

Defined in m_index:145

Default: false

m_islandFlag

Boolean public

Defined in m_islandFlag:137

Default: false

m_next

b2Joint | Null public

Defined in m_next:96

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_prev

b2Joint | Null public

Defined in m_prev:86

Previous joint in the world's joint linked-list.

Default: null

m_type

Int public

Defined in m_type:75

Joint type: distance, wheel (line), mouse, prismatic, pulley, revolute, weld, friction, gear, rope, motor, and (constant) area.

Default: b2jointDef.type

m_userData

public

Defined in m_userData:153

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

Defined in ParentClass:209

Super class constructor function reference for sub classes.

NOTE: Explicit declaration to protect against sub-classes inheriting a prototype.constructor value other than this.