Constructor
new Box2dMotorJoint(objectA, objectB)
Create a motor joint
Name | Type | Description |
---|---|---|
objectA | Box2dObject | |
objectB | Box2dObject |
- Source
Extends
Methods
destroy()
Destroy this joint
- Overrides
- 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
getAngularOffset() → {number}
Get the target angular offset
- Source
- Type:
- number
getCollideConnected() → {boolean}
Check if the connected bodies should collide
- Overrides
- Source
- Type:
- boolean
getCorrectionFactor() → {number}
Get the position correction factor in the range [0,1]
- Source
- Type:
- number
getLinearOffset() → {Vector2}
Get the target linear offset, in frame A, in meters.
- Source
- Type:
- Vector2
getMaxForce() → {number}
Get the maximum friction force
- Source
- Type:
- number
getMaxTorque() → {number}
Get the maximum torque
- 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
isActive() → {boolean}
Check if either connected body is active
- Overrides
- Source
- Type:
- boolean
setAngularOffset(offset)
Set the target angular offset
Name | Type | Description |
---|---|---|
offset | number |
- Source
setCorrectionFactor(factor)
Set the position correction factor in the range [0,1]
Name | Type | Description |
---|---|---|
factor | number |
- Source
setLinearOffset(offset)
Set the target linear offset, in frame A, in meters.
Name | Type | Description |
---|---|---|
offset | Vector2 |
- Source
setMaxForce(force)
Set the maximum friction force
Name | Type | Description |
---|---|---|
force | number |
- Source
setMaxTorque(torque)
Set the maximum torque
Name | Type | Description |
---|---|---|
torque | number |
- Source