Constructor
new Box2dWheelJoint(objectA, objectB, anchoropt, worldAxisopt, collideopt)
Create a wheel joint
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
anchor | Vector2 | <optional> | World position, objectB's position if not given | |
worldAxis | Vector2 | <optional> | ||
collide | boolean | <optional> | false |
- Source
Extends
- Box2dJoint
Methods
enableMotor(enableopt)
Enable/disable the joint motor
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enable | boolean | <optional> | true |
- Source
getJointSpeed() → {number}
Get the current joint rotation speed in radians per second, clockwise like angle, which is what this version of Box2D measures for a wheel joint
- Source
- Type:
- number
getJointTranslation() → {number}
Get the current joint translation
- 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
getLocalAxisA() → {Vector2}
Get the local joint axis relative to bodyA
- Source
- Type:
- Vector2
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
getSpringDampingRatio() → {number}
Get the spring damping ratio
- Source
- Type:
- number
getSpringFrequencyHz() → {number}
Get the spring frequency in Hertz
- Source
- Type:
- number
isMotorEnabled() → {boolean}
Is the joint motor enabled?
- Source
- Type:
- boolean
setMaxMotorTorque(torque)
Set the maximum motor torque, a magnitude
| Name | Type | Description |
|---|---|---|
torque | number |
- Source
setMotorSpeed(speed)
Set the motor speed, the wheel's turn in radians per second, clockwise like angle
| Name | Type | Description |
|---|---|---|
speed | number |
- Source
setSpringDampingRatio(ratio)
Set the spring damping ratio
| Name | Type | Description |
|---|---|---|
ratio | number |
- Source
setSpringFrequencyHz(hz)
Set the spring frequency in Hertz
| Name | Type | Description |
|---|---|---|
hz | number |
- Source