Constructor
new Box2dTargetJoint(object, fixedObject, worldPos)
Create a target joint
Parameters:
Name | Type | Description |
---|---|---|
object | Box2dObject | |
fixedObject | Box2dObject | |
worldPos | Vector2 |
- 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
getFrequency() → {number}
Gets the joint frequency in Hertz
- Source
Returns:
- Type:
- number
getMaxForce() → {number}
Gets the maximum force in Newtons
- Source
Returns:
- Type:
- number
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
getTarget() → {Vector2}
Get the target point in world coordinates
- Source
Returns:
- Type:
- Vector2
isActive() → {boolean}
Check if either connected body is active
- Overrides
- Source
Returns:
- Type:
- boolean
setFrequency(hz)
Sets the joint frequency in Hertz
Parameters:
Name | Type | Description |
---|---|---|
hz | number |
- Source
setMaxForce(force)
Sets the maximum force in Newtons
Parameters:
Name | Type | Description |
---|---|---|
force | number |
- Source
setTarget(pos)
Set the target point in world coordinates
Parameters:
Name | Type | Description |
---|---|---|
pos | Vector2 |
- Source