Constructor
new Box2dPrismaticJoint(objectA, objectB, anchor, worldAxis, collideopt)
Create a prismatic joint
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
objectA | Box2dObject | |||
objectB | Box2dObject | |||
anchor | Vector2 | |||
worldAxis | 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
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
getLowerLimit() → {number}
Get the lower joint limit
- Source
Returns:
- Type:
- number
getMaxMotorForce() → {number}
Get the maximum motor force
- Source
Returns:
- Type:
- number
getMotorForce(time) → {number}
Get the motor force given a time step
Parameters:
Name | Type | Description |
---|---|---|
time | number |
- Source
Returns:
- Type:
- number
getMotorSpeed() → {number}
Get the motor speed
- Source
Returns:
- Type:
- number
getReferenceAngle() → {number}
Get the reference angle
- 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 motor enabled?
- Source
Returns:
- Type:
- boolean
setLimits(min, max)
Set the joint limits
Parameters:
Name | Type | Description |
---|---|---|
min | number | |
max | number |
- Source
setMaxMotorForce(force)
Set the maximum motor force
Parameters:
Name | Type | Description |
---|---|---|
force | number |
- Source
setMotorSpeed(speed)
Set the motor speed
Parameters:
Name | Type | Description |
---|---|---|
speed | number |
- Source