Constructor
new Box2dGearJoint(objectA, objectB, joint1, joint2, ratioopt)
Create a gear joint
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
joint1 | Box2dJoint | |||
joint2 | Box2dJoint | |||
ratio | ratio | <optional> | 1 |
- 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
getJoint1() → {Box2dJoint}
Get the first joint
- Source
Returns:
- Type:
- Box2dJoint
getJoint2() → {Box2dJoint}
Get the second joint
- Source
Returns:
- Type:
- Box2dJoint
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
getRatio() → {number}
Get the gear ratio
- Source
Returns:
- Type:
- number
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
setRatio(ratio)
Set the gear ratio
Parameters:
Name | Type | Description |
---|---|---|
ratio | number |
- Source