Appearance
Class: PrismaticJoint
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
Extends
Constructors
Constructor
new PrismaticJoint(
def):PrismaticJoint
Parameters
def
Returns
PrismaticJoint
Overrides
Constructor
new PrismaticJoint(
def,bodyA,bodyB,anchor?,axis?):PrismaticJoint
Parameters
def
bodyA
bodyB
anchor?
axis?
Returns
PrismaticJoint
Overrides
Properties
style
style:
Style={}
Styling for dev-tools.
Inherited from
TYPE
staticTYPE:"prismatic-joint"
Methods
enableLimit()
enableLimit(
flag):void
Enable/disable the joint limit.
Parameters
flag
boolean
Returns
void
enableMotor()
enableMotor(
flag):void
Enable/disable the joint motor.
Parameters
flag
boolean
Returns
void
getAnchorA()
getAnchorA():
Vec2
Get the anchor point on bodyA in world coordinates.
Returns
Overrides
getAnchorB()
getAnchorB():
Vec2
Get the anchor point on bodyB in world coordinates.
Returns
Overrides
getBodyA()
getBodyA():
Body
Get the first body attached to this joint.
Returns
Inherited from
getBodyB()
getBodyB():
Body
Get the second body attached to this joint.
Returns
Inherited from
getCollideConnected()
getCollideConnected():
boolean
Get collide connected. Note: modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap.
Returns
boolean
Inherited from
getJointSpeed()
getJointSpeed():
number
Get the current joint translation speed, usually in meters per second.
Returns
number
getJointTranslation()
getJointTranslation():
number
Get the current joint translation, usually in meters.
Returns
number
getLocalAnchorA()
getLocalAnchorA():
Vec2
The local anchor point relative to bodyA's origin.
Returns
getLocalAnchorB()
getLocalAnchorB():
Vec2
The local anchor point relative to bodyB's origin.
Returns
getLocalAxisA()
getLocalAxisA():
Vec2
The local joint axis relative to bodyA.
Returns
getLowerLimit()
getLowerLimit():
number
Get the lower joint limit, usually in meters.
Returns
number
getMaxMotorForce()
getMaxMotorForce():
number
Returns
number
getMotorForce()
getMotorForce(
inv_dt):number
Get the current motor force given the inverse time step, usually in N.
Parameters
inv_dt
number
Returns
number
getMotorSpeed()
getMotorSpeed():
number
Get the motor speed, usually in meters per second.
Returns
number
getNext()
getNext():
Joint
Get the next joint the world joint list.
Returns
Inherited from
getReactionForce()
getReactionForce(
inv_dt):Vec2
Get the reaction force on bodyB at the joint anchor in Newtons.
Parameters
inv_dt
number
Returns
Overrides
getReactionTorque()
getReactionTorque(
inv_dt):number
Get the reaction torque on bodyB in N*m.
Parameters
inv_dt
number
Returns
number
Overrides
getReferenceAngle()
getReferenceAngle():
number
Get the reference angle.
Returns
number
getType()
getType():
string
Get the type of the concrete joint.
Returns
string
Inherited from
getUpperLimit()
getUpperLimit():
number
Get the upper joint limit, usually in meters.
Returns
number
getUserData()
getUserData():
unknown
Returns
unknown
Inherited from
initVelocityConstraints()
initVelocityConstraints(
step):void
Parameters
step
Returns
void
Overrides
isActive()
isActive():
boolean
Short-cut function to determine if either body is inactive.
Returns
boolean
Inherited from
isLimitEnabled()
isLimitEnabled():
boolean
Is the joint limit enabled?
Returns
boolean
isMotorEnabled()
isMotorEnabled():
boolean
Is the joint motor enabled?
Returns
boolean
setLimits()
setLimits(
lower,upper):void
Set the joint limits, usually in meters.
Parameters
lower
number
upper
number
Returns
void
setMaxMotorForce()
setMaxMotorForce(
force):void
Set the maximum motor force, usually in N.
Parameters
force
number
Returns
void
setMotorSpeed()
setMotorSpeed(
speed):void
Set the motor speed, usually in meters per second.
Parameters
speed
number
Returns
void
setUserData()
setUserData(
data):void
Parameters
data
unknown
Returns
void
Inherited from
shiftOrigin()
shiftOrigin(
newOrigin):void
Shift the origin for any points stored in world coordinates.
Parameters
newOrigin
Returns
void
Inherited from
solvePositionConstraints()
solvePositionConstraints(
step):boolean
This returns true if the position errors are within tolerance.
Parameters
step
Returns
boolean
Overrides
Joint.solvePositionConstraints
solveVelocityConstraints()
solveVelocityConstraints(
step):void
Parameters
step
Returns
void