API Documentation for:
Show:

b2MotorJoint Class

Extends b2Joint
Defined in: b2MotorJoint:17
Module: Joints

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
)

Defined in b2MotorJoint:17

Parameters:

  • motorJointDef B2MotorJointDef

Methods

getAnchorB

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getAnchorB:304

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAnchorB

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getAnchorB:315

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAngularOffset

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Get the target angular offset, in radians.

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getCorrectionFactor

(
  • factor
)
Float public

Get the position correction factor in the range [0,1].

Parameters:

  • factor Float

Returns:

Float:

getLinearOffset

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getLinearOffset:402

Get the target linear offset, in frame A, in meters.

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getMaxForce

() Float public

Defined in getMaxForce:485

Get the maximum friction torque in N*m.

Returns:

Float:

getMaxForce

() Float public

Defined in getMaxForce:458

Get the maximum friction force in N.

Returns:

Float:

getReactionForce

(
  • invDeltaTime
  • [out=b2Vec2]
)
B2Vec2 | Object public

Get the reaction force given the inverse time step. Unit is N.

Parameters:

  • invDeltaTime Float
  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getReactionTorque

(
  • invDeltaTime
)
Float public

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:

Float:

initVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

setAngularOffset

(
  • angularOffset
)
Float public

Set the target angular offset, in radians.

Parameters:

  • angularOffset Float

Returns:

Float:

setCorrectionFactor

(
  • factor
)
Float public

Set the position correction factor in the range [0,1].

Parameters:

  • factor Float

Returns:

Float:

setLinearOffset

(
  • linearOffset
)
Float public

Defined in setLinearOffset:386

Set the target linear offset, in frame A, in meters.

Parameters:

  • linearOffset Float

Returns:

Float:

setMaxForce

(
  • force
)
Float public

Defined in setMaxForce:442

Set the maximum friction force in N.

Parameters:

  • force Float

Returns:

Float:

setMaxForce

(
  • torque
)
Float public

Defined in setMaxForce:469

Set the maximum friction torque in N*m.

Parameters:

  • torque Float

Returns:

Float:

solvePositionConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

solveVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

Properties

m_angularError

Float public

Defined in m_angularError:185

Default: 0.0

m_angularImpulse

Float public

Default: 0.0

m_angularMass

Float public

Defined in m_angularMass:260

m_angularOffset

Float public

Defined in m_angularOffset:193

Default: 0.0

m_correctionFactor

Float public

m_indexA

Int public

Defined in m_indexA:202

m_invIA

Float public

Defined in m_invIA:246

m_invIB

Float public

Defined in m_invIB:253

m_invMassA

Float public

Defined in m_invMassA:232

m_invMassB

Float public

Defined in m_invMassB:239

m_K

B2Mat22 public

Defined in m_K:136

m_linearError

B2Vec2 public

Defined in m_linearError:108

m_linearImpulse

B2Vec2 public

Defined in m_linearImpulse:59

m_linearMass

B2Mat22 public

Defined in m_linearMass:115

m_linearOffset

B2Vec2 public

Defined in m_linearOffset:52

m_localCenterA

B2Vec2 public

Defined in m_localCenterA:66

m_localCenterA

B2Vec2 public

Defined in m_localCenterA:94

m_localCenterB

B2Vec2 public

Defined in m_localCenterB:73

m_localCenterB

B2Vec2 public

Defined in m_localCenterB:101

m_maxForce

Float public

Defined in m_maxForce:146

Default: motorJointDef.maxForce.

m_maxTorque

Float public

Defined in m_maxTorque:154

m_motorSpeed

Int public

Defined in m_motorSpeed:210

m_qA

B2Rot | Null public

Defined in m_qA:122

m_qB

B2Rot | Null public

Defined in m_qB:129

m_rA

B2Vec2 public

Defined in m_rA:80

m_rA

B2Vec2 | Null public

Defined in m_rA:218

m_rB

B2Vec2 | Null public

Defined in m_rB:225

m_rB

B2Vec2 public

Defined in m_rB:87

m_type

Int public

Defined in m_type:168

Default: 0.0