Constructor
new Box2dRevoluteJoint(objectA, objectB, anchor, collideopt)
Create a revolute joint
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
anchor | Vector2 | |||
collide | boolean | <optional> | false |
- Source
Extends
- Box2dJoint
Methods
enableLimit(enableopt)
Enable/disable the joint limit
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enable | boolean | <optional> | true |
- Source
enableMotor(enableopt)
Enable/disable the joint motor
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enable | boolean | <optional> | true |
- Source
getJointAngle() → {number}
Get the current joint angle
- Source
Returns:
- Type:
- number
getJointSpeed() → {number}
Get the current joint angle speed in radians per second
- 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
getLowerLimit() → {number}
Get the lower joint limit
- Source
Returns:
- Type:
- number
getMaxMotorTorque() → {number}
Get the max motor torque
- Source
Returns:
- Type:
- number
getMotorSpeed() → {number}
Get the motor speed
- Source
Returns:
- Type:
- number
getMotorTorque(time) → {number}
Get the motor torque given a time step
Parameters:
Name | Type | Description |
---|---|---|
time | number |
- Source
Returns:
- Type:
- number
getReferenceAngle() → {number}
Get the reference angle, objectB angle minus objectA angle in the reference state
- Source
Returns:
- Type:
- number
getUpperLimit() → {number}
Get the upper joint limit
- Source
Returns:
- Type:
- number
isLimitEnabled() → {boolean}
Is the joint limit enabled?
- Source
Returns:
- Type:
- boolean
isMotorEnabled() → {boolean}
Is the joint motor enabled?
- Source
Returns:
- Type:
- boolean
setLimits(min, max)
Set the joint limits
Parameters:
Name | Type | Description |
---|---|---|
min | number | |
max | number |
- Source
setMaxMotorTorque(torque)
Set the motor torque
Parameters:
Name | Type | Description |
---|---|---|
torque | number |
- Source
setMotorSpeed(speed)
Set the motor speed
Parameters:
Name | Type | Description |
---|---|---|
speed | number |
- Source