Constructor
new Box2dWheelJoint(objectA, objectB, anchor, worldAxis, collideopt)
Create a wheel joint
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
anchor | Vector2 | |||
worldAxis | Vector2 | |||
collide | boolean | <optional> | false |
- Source
Extends
- Box2dJoint
Methods
enableMotor(enableopt)
Enable/disable the joint motor
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enable | boolean | <optional> | true |
- Source
getJointSpeed() → {number}
Get the current joint translation speed
- Source
Returns:
- Type:
- number
getJointTranslation() → {number}
Get the current joint translation
- 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
getLocalAxisA() → {Vector2}
Get the local joint axis relative to bodyA
- Source
Returns:
- Type:
- Vector2
getMaxMotorTorque() → {number}
Get the max motor torque
- Source
Returns:
- Type:
- number
getMotorSpeed() → {number}
Get the motor speed
- Source
Returns:
- Type:
- number
getMotorTorque() → {number}
Get the motor torque for a time step
- Source
Returns:
- Type:
- number
getSpringDampingRatio() → {number}
Get the spring damping ratio
- Source
Returns:
- Type:
- number
getSpringFrequencyHz() → {number}
Get the spring frequency in Hertz
- Source
Returns:
- Type:
- number
isMotorEnabled() → {boolean}
Is the joint motor enabled?
- Source
Returns:
- Type:
- boolean
setMaxMotorTorque(torque)
Set the maximum motor torque
Parameters:
Name | Type | Description |
---|---|---|
torque | number |
- Source
setMotorSpeed(speed)
Set the motor speed
Parameters:
Name | Type | Description |
---|---|---|
speed | number |
- Source
setSpringDampingRatio(ratio)
Set the spring damping ratio
Parameters:
Name | Type | Description |
---|---|---|
ratio | number |
- Source
setSpringFrequencyHz(hz)
Set the spring frequency in Hertz
Parameters:
Name | Type | Description |
---|---|---|
hz | number |
- Source