b2MotorJoint Class
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.
Constructor
b2MotorJoint
-
motorJointDef
Parameters:
-
motorJointDef
B2MotorJointDef
Item Index
Methods
Properties
- m_angularError
- m_angularImpulse
- m_angularMass
- m_angularOffset
- m_correctionFactor
- m_indexA
- m_invIA
- m_invIB
- m_invMassA
- m_invMassB
- m_K
- m_linearError
- m_linearImpulse
- m_linearMass
- m_linearOffset
- m_localCenterA
- m_localCenterA
- m_localCenterB
- m_localCenterB
- m_maxForce
- m_maxTorque
- m_motorSpeed
- m_qA
- m_qB
- m_rA
- m_rA
- m_rB
- m_rB
- m_type
- m_bodyA
- m_bodyB
- m_collideConnected
- m_edgeA
- m_edgeB
- m_index
- m_islandFlag
- m_next
- m_prev
- m_type
- m_userData
- ParentClass
Methods
getAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getAngularOffset
-
[out=b2Vec2]
Get the target angular offset, in radians.
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getCorrectionFactor
-
factor
Get the position correction factor in the range [0,1].
Parameters:
-
factor
Float
Returns:
getLinearOffset
-
[out=b2Vec2]
Get the target linear offset, in frame A, in meters.
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getMaxForce
()
Float
public
Get the maximum friction torque in N*m.
Returns:
getMaxForce
()
Float
public
Get the maximum friction force in N.
Returns:
getReactionForce
-
invDeltaTime
-
[out=b2Vec2]
Get the reaction force given the inverse time step. Unit is N.
Parameters:
-
invDeltaTime
Float -
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getReactionTorque
-
invDeltaTime
Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.
Parameters:
-
invDeltaTime
Float
Returns:
initVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
setAngularOffset
-
angularOffset
Set the target angular offset, in radians.
Parameters:
-
angularOffset
Float
Returns:
setCorrectionFactor
-
factor
Set the position correction factor in the range [0,1].
Parameters:
-
factor
Float
Returns:
setLinearOffset
-
linearOffset
Set the target linear offset, in frame A, in meters.
Parameters:
-
linearOffset
Float
Returns:
setMaxForce
-
force
Set the maximum friction force in N.
Parameters:
-
force
Float
Returns:
setMaxForce
-
torque
Set the maximum friction torque in N*m.
Parameters:
-
torque
Float
Returns:
solvePositionConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
solveVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
Properties
m_angularError
Float
public
Default: 0.0
m_angularImpulse
Float
public
Default: 0.0
m_angularMass
Float
public
m_angularOffset
Float
public
Default: 0.0
m_correctionFactor
Float
public
m_indexA
Int
public
m_invIA
Float
public
m_invIB
Float
public
m_invMassA
Float
public
m_invMassB
Float
public
m_K
B2Mat22
public
m_linearError
B2Vec2
public
m_linearImpulse
B2Vec2
public
m_linearMass
B2Mat22
public
m_linearOffset
B2Vec2
public
m_localCenterA
B2Vec2
public
m_localCenterA
B2Vec2
public
m_localCenterB
B2Vec2
public
m_localCenterB
B2Vec2
public
m_maxForce
Float
public
Default: motorJointDef.maxForce.
m_maxTorque
Float
public
m_motorSpeed
Int
public
m_qA
B2Rot | Null
public
m_qB
B2Rot | Null
public
m_rA
B2Vec2
public
m_rA
B2Vec2 | Null
public
m_rB
B2Vec2 | Null
public
m_rB
B2Vec2
public
m_type
Int
public
Default: 0.0