Constructor
new Box2dDistanceJoint(objectA, objectB, anchorA, anchorB, collideopt)
Create a distance joint
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
anchorA | Vector2 | |||
anchorB | Vector2 | |||
collide | boolean | <optional> | false |
- Source
Extends
Methods
destroy()
Destroy this joint
- Overrides
- Source
getAnchorA() → {Vector2}
Get the first anchor for this joint in world coordinates
- Overrides
- Source
Returns:
- Type:
- Vector2
getAnchorB() → {Vector2}
Get the second anchor for this joint in world coordinates
- Overrides
- Source
Returns:
- Type:
- Vector2
getCollideConnected() → {boolean}
Check if the connected bodies should collide
- Overrides
- Source
Returns:
- Type:
- boolean
getDampingRatio() → {number}
Get the damping ratio
- Source
Returns:
- Type:
- number
getFrequency() → {number}
Get the frequency in Hertz
- Source
Returns:
- Type:
- number
getLength() → {number}
Get the length of the joint
- Source
Returns:
- Type:
- number
getLocalAnchorA() → {Vector2}
Get the local anchor point relative to objectA's origin
- Source
Returns:
- Type:
- Vector2
getLocalAnchorB() → {Vector2}
Get the local anchor point relative to objectB's origin
- Source
Returns:
- Type:
- Vector2
getObjectA() → {Box2dObject}
Get the first object attached to this joint
- Overrides
- Source
Returns:
- Type:
- Box2dObject
getObjectB() → {Box2dObject}
Get the second object attached to this joint
- Overrides
- Source
Returns:
- Type:
- Box2dObject
getReactionForce(time) → {Vector2}
Get the reaction force on bodyB at the joint anchor given a time step
Parameters:
Name | Type | Description |
---|---|---|
time | number |
- Overrides
- Source
Returns:
- Type:
- Vector2
getReactionTorque(time) → {number}
Get the reaction torque on bodyB in N*m given a time step
Parameters:
Name | Type | Description |
---|---|---|
time | number |
- Overrides
- Source
Returns:
- Type:
- number
isActive() → {boolean}
Check if either connected body is active
- Overrides
- Source
Returns:
- Type:
- boolean
setDampingRatio(ratio)
Set the damping ratio
Parameters:
Name | Type | Description |
---|---|---|
ratio | number |
- Source
setFrequency(hz)
Set the frequency in Hertz
Parameters:
Name | Type | Description |
---|---|---|
hz | number |
- Source
setLength(length)
Set the length of the joint
Parameters:
Name | Type | Description |
---|---|---|
length | number |
- Source