Constructor
new Box2dRevoluteJoint(objectA, objectB, anchor, collideopt)
Create a revolute joint
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
anchor | Vector2 | |||
collide | boolean | <optional> | false |
- Source
Extends
Methods
destroy()
Destroy this joint
- Overrides
- Source
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
getAnchorA() → {Vector2}
Get the first anchor for this joint in world coordinates
- Overrides
- Source
- Type:
- Vector2
getAnchorB() → {Vector2}
Get the second anchor for this joint in world coordinates
- Overrides
- Source
- Type:
- Vector2
getCollideConnected() → {boolean}
Check if the connected bodies should collide
- Overrides
- Source
- Type:
- boolean
getJointAngle() → {number}
Get the current joint angle
- Source
- Type:
- number
getJointSpeed() → {number}
Get the current joint angle speed in radians per second
- 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
- Source
- Type:
- number
getMaxMotorTorque() → {number}
Get the max motor torque
- Source
- Type:
- number
getMotorSpeed() → {number}
Get the motor speed
- Source
- Type:
- number
getMotorTorque(time) → {number}
Get the motor torque given a time step
Name | Type | Description |
---|---|---|
time | number |
- Source
- Type:
- number
getObjectA() → {Box2dObject}
Get the first object attached to this joint
- Overrides
- Source
- Type:
- Box2dObject
getObjectB() → {Box2dObject}
Get the second object attached to this joint
- Overrides
- Source
- Type:
- Box2dObject
getReactionForce(time) → {Vector2}
Get the reaction force on bodyB at the joint anchor given a time step
Name | Type | Description |
---|---|---|
time | number |
- Overrides
- Source
- Type:
- Vector2
getReactionTorque(time) → {number}
Get the reaction torque on bodyB in N*m given a time step
Name | Type | Description |
---|---|---|
time | number |
- Overrides
- 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
- Source
- Type:
- number
isActive() → {boolean}
Check if either connected body is active
- Overrides
- Source
- Type:
- boolean
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
Name | Type | Description |
---|---|---|
min | number | |
max | number |
- Source
setMaxMotorTorque(torque)
Set the motor torque
Name | Type | Description |
---|---|---|
torque | number |
- Source
setMotorSpeed(speed)
Set the motor speed
Name | Type | Description |
---|---|---|
speed | number |
- Source