Constructor
new Box2dRevoluteJoint(objectA, objectB, anchoropt, collideopt)
Create a revolute joint
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
anchor | Vector2 | <optional> | World position, objectB's position if not given | |
collide | boolean | <optional> | false |
- Source
Extends
- Box2dJoint
Methods
enableLimit(enableopt)
Enable/disable the joint limit
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enable | boolean | <optional> | true |
- Source
enableMotor(enableopt)
Enable/disable the joint motor
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enable | boolean | <optional> | true |
- Source
getJointAngle() → {number}
Get the current joint angle, clockwise like angle
- Source
- Type:
- number
getJointSpeed() → {number}
Get the current joint angle speed in radians per second, clockwise like angle
- Source
- Type:
- number
getLocalAnchorA() → {Vector2}
Get the local anchor point relative to objectA's origin
- Source
- Type:
- Vector2
getLocalAnchorB() → {Vector2}
Get the local anchor point relative to objectB's origin
- Source
- Type:
- Vector2
getLowerLimit() → {number}
Get the lower joint limit, clockwise like angle
- Source
- Type:
- number
getMaxMotorTorque() → {number}
Get the max motor torque
- Source
- Type:
- number
getMotorSpeed() → {number}
Get the motor speed, clockwise like angle
- Source
- Type:
- number
getMotorTorque(timeopt) → {number}
Get the motor torque over the last step, clockwise like angle
| Name | Type | Attributes | Description |
|---|---|---|---|
time | number | <optional> | The step length in seconds, the world steps by timeDelta |
- Source
- Type:
- number
getReferenceAngle() → {number}
Get the reference angle, objectB angle minus objectA angle in the reference state
- Source
- Type:
- number
getUpperLimit() → {number}
Get the upper joint limit, clockwise like angle
- Source
- Type:
- number
isLimitEnabled() → {boolean}
Is the joint limit enabled?
- Source
- Type:
- boolean
isMotorEnabled() → {boolean}
Is the joint motor enabled?
- Source
- Type:
- boolean
setLimits(min, max)
Set the joint limits, clockwise like angle
| Name | Type | Description |
|---|---|---|
min | number | |
max | number |
- Source
setMaxMotorTorque(torque)
Set the max motor torque, a magnitude
| Name | Type | Description |
|---|---|---|
torque | number |
- Source
setMotorSpeed(speed)
Set the motor speed, clockwise like angle
| Name | Type | Description |
|---|---|---|
speed | number |
- Source