Appearance
Class: DistanceJoint
A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.
Extends
Constructors
Constructor
new DistanceJoint(
def):DistanceJoint
Parameters
def
DistanceJoint definition.
Returns
DistanceJoint
Overrides
Constructor
new DistanceJoint(
def,bodyA,bodyB,anchorA?,anchorB?):DistanceJoint
Parameters
def
bodyA
bodyB
anchorA?
Anchor A in global coordination.
anchorB?
Anchor B in global coordination.
Returns
DistanceJoint
Overrides
Properties
style
style:
Style={}
Styling for dev-tools.
Inherited from
TYPE
staticTYPE:"distance-joint"
Methods
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
getDampingRatio()
getDampingRatio():
number
Returns
number
getFrequency()
getFrequency():
number
Returns
number
getLength()
getLength():
number
Get the natural length.
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
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
getType()
getType():
string
Get the type of the concrete joint.
Returns
string
Inherited from
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
setDampingRatio()
setDampingRatio(
ratio):void
Parameters
ratio
number
Returns
void
setFrequency()
setFrequency(
hz):void
Parameters
hz
number
Returns
void
setLength()
setLength(
length):void
Set the natural length. Manipulating the length can lead to non-physical behavior when the frequency is zero.
Parameters
length
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