4.0 KiB
Class: abstract Joint
The base joint class. Joints are used to constraint two bodies together in various fashions. Some joints also feature limits and motors.
Extended by
DistanceJointFrictionJointGearJointMotorJointMouseJointPrismaticJointPulleyJointRevoluteJointRopeJointWeldJointWheelJoint
Constructors
new Joint()
new Joint(
def):Joint
Parameters
• def: JointDef
Returns
new Joint()
new Joint(
def,bodyA,bodyB):Joint
Parameters
• def: JointOpt
• bodyA: Body
• bodyB: Body
Returns
Properties
style
style:
Style={}
Styling for dev-tools.
Methods
getAnchorA()
abstractgetAnchorA():Vec2
Get the anchor point on bodyA in world coordinates.
Returns
getAnchorB()
abstractgetAnchorB():Vec2
Get the anchor point on bodyB in world coordinates.
Returns
getBodyA()
getBodyA():
Body
Get the first body attached to this joint.
Returns
getBodyB()
getBodyB():
Body
Get the second body attached to this joint.
Returns
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
getNext()
getNext():
Joint
Get the next joint the world joint list.
Returns
getReactionForce()
abstractgetReactionForce(inv_dt):Vec2
Get the reaction force on bodyB at the joint anchor in Newtons.
Parameters
• inv_dt: number
Returns
getReactionTorque()
abstractgetReactionTorque(inv_dt):number
Get the reaction torque on bodyB in N*m.
Parameters
• inv_dt: number
Returns
number
getType()
getType():
string
Get the type of the concrete joint.
Returns
string
getUserData()
getUserData():
unknown
Returns
unknown
initVelocityConstraints()
abstractinitVelocityConstraints(step):void
Parameters
• step: TimeStep
Returns
void
isActive()
isActive():
boolean
Short-cut function to determine if either body is inactive.
Returns
boolean
setUserData()
setUserData(
data):void
Parameters
• data: unknown
Returns
void
shiftOrigin()
shiftOrigin(
newOrigin):void
Shift the origin for any points stored in world coordinates.
Parameters
• newOrigin: Vec2Value
Returns
void
solvePositionConstraints()
abstractsolvePositionConstraints(step):boolean
This returns true if the position errors are within tolerance.
Parameters
• step: TimeStep
Returns
boolean
solveVelocityConstraints()
abstractsolveVelocityConstraints(step):void
Parameters
• step: TimeStep
Returns
void