Appearance
Class: MotorJoint
A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground.
Extends
Constructors
Constructor
new MotorJoint(
def):MotorJoint
Parameters
def
Returns
MotorJoint
Overrides
Constructor
new MotorJoint(
def,bodyA,bodyB):MotorJoint
Parameters
def
bodyA
bodyB
Returns
MotorJoint
Overrides
Properties
style
style:
Style={}
Styling for dev-tools.
Inherited from
TYPE
staticTYPE:"motor-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
getAngularOffset()
getAngularOffset():
number
Returns
number
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
getCorrectionFactor()
getCorrectionFactor():
number
Get the position correction factor in the range [0,1].
Returns
number
getLinearOffset()
getLinearOffset():
Vec2
Returns
getMaxForce()
getMaxForce():
number
Get the maximum friction force in N.
Returns
number
getMaxTorque()
getMaxTorque():
number
Get the maximum friction torque in N*m.
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
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
setAngularOffset()
setAngularOffset(
angularOffset):void
Set/get the target angular offset, in radians.
Parameters
angularOffset
number
Returns
void
setCorrectionFactor()
setCorrectionFactor(
factor):void
Set the position correction factor in the range [0,1].
Parameters
factor
number
Returns
void
setLinearOffset()
setLinearOffset(
linearOffset):void
Set/get the target linear offset, in frame A, in meters.
Parameters
linearOffset
Returns
void
setMaxForce()
setMaxForce(
force):void
Set the maximum friction force in N.
Parameters
force
number
Returns
void
setMaxTorque()
setMaxTorque(
torque):void
Set the maximum friction torque in N*m.
Parameters
torque
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