API Documentation for:
Show:

b2GearJoint Class

Extends b2Joint
Defined in: b2GearJoint:17
Module: Joints

A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinateA + ratio * coordinateB = constant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length. warning You have to manually destroy the gear joint if jointA or jointB is destroyed.

Constructor

b2GearJoint

(
  • gearJointDef
)

Defined in b2GearJoint:17

Parameters:

  • gearJointDef B2GearJointDef

Methods

getAnchorA

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

Defined in getAnchorA:952

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAnchorB

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

Defined in getAnchorB:963

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getJoint1

() b2Joint public

Defined in getJoint1:1002

Get the first joint.

Returns:

getJoint1

() b2Joint public

Defined in getJoint1:1013

Get the second joint.

Returns:

getRatio

() Float public

Defined in getRatio:1024

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:

setRatio

(
  • ratio
)
Float public

Defined in setRatio:1033

Parameters:

  • ratio Float

Returns:

Float:

solvePositionConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

Properties

m_bodyA

B2Body public

Defined in m_bodyA:484

Body A is connected to body C.

m_bodyA

B2Body public

Defined in m_bodyA:433

m_bodyB

B2Body public

Defined in m_bodyB:504

Body B is connected to body D.

m_bodyC

B2Body public

Defined in m_bodyC:474

Body A is connected to body C.

m_bodyD

B2Body public

Defined in m_bodyD:494

Body B is connected to body D.

m_iA

Int public

Defined in m_iA:291

Default: 0.0

m_iB

Int public

Defined in m_iB:299

Default: 0.0

m_iB

Int public

Defined in m_iB:307

Default: 0.0

m_iC

Int public

Defined in m_iC:315

Default: 0.0

m_iD

Int public

Defined in m_iD:323

Default: 0.0

m_impulse

Number public

Defined in m_impulse:449

Default: 0.0

m_indexA

Int public

Defined in m_indexA:227

Default: 0

m_indexB

Int public

Defined in m_indexB:235

Default: 0

m_indexC

Int public

Defined in m_indexC:243

Default: 0

m_indexD

Int public

Defined in m_indexD:251

Default: 0

m_joint1

b2Joint public

Defined in m_joint1:419

m_joint1

b2Joint public

Defined in m_joint1:426

m_JvAC

B2Vec2 public

Defined in m_JvAC:130

m_JvAC

Float public

Defined in m_JvAC:331

Default: 0.0

m_JvBD

B2Vec2 public

Defined in m_JvBD:137

m_JvBD

Float public

Defined in m_JvBD:339

Default: 0.0

m_JwA

Float public

Defined in m_JwA:347

Default: 0.0

m_JwB

Float public

Defined in m_JwB:355

Default: 0.0

m_JwC

Float public

Defined in m_JwC:363

Default: 0.0

m_JwD

Float public

Defined in m_JwD:371

Default: 0.0

m_lalcA

B2Vec2 public

Defined in m_lalcA:172

m_lalcB

B2Vec2 public

Defined in m_lalcB:179

m_lalcC

B2Vec2 public

Defined in m_lalcC:186

m_lalcD

B2Vec2 public

Defined in m_lalcD:193

m_lcA

B2Vec2 public

Defined in m_lcA:102

m_lcB

B2Vec2 public

Defined in m_lcB:109

m_lcC

B2Vec2 public

Defined in m_lcC:116

m_lcD

B2Vec2 public

Defined in m_lcD:123

m_localAnchorA

B2Vec2 public

Defined in m_localAnchorA:60

m_localAnchorB

B2Vec2 public

Defined in m_localAnchorB:67

m_localAnchorC

B2Vec2 public

Defined in m_localAnchorC:74

m_localAnchorD

B2Vec2 public

Defined in m_localAnchorD:81

m_localAxisC

B2Vec2 public

Defined in m_localAxisC:88

m_localAxisD

B2Vec2 public

Defined in m_localAxisD:95

m_mA

Int public

Defined in m_mA:259

Default: 0.0

m_mass

Float public

Defined in m_mass:379

Default: 0.0

m_mass

B2Rot public

Defined in m_mass:387

Default: 0.0

m_mB

Int public

Defined in m_mB:267

Default: 0.0

m_mC

Int public

Defined in m_mC:275

Default: 0.0

m_mD

Int public

Defined in m_mD:283

Default: 0.0

m_qA

B2Rot public

Defined in m_qA:144

m_qB

B2Rot public

Defined in m_qB:151

m_qB

B2Rot public

Defined in m_qB:395

Default: 0.0

m_qC

B2Rot public

Defined in m_qC:403

Default: 0.0

m_qC

B2Rot public

Defined in m_qC:158

m_qD

B2Rot public

Defined in m_qD:411

Default: 0.0

m_qD

B2Rot public

Defined in m_qD:165

m_ratio

Float public

Defined in m_ratio:441

m_referenceAngleA

Float public

Default: 0.0

m_referenceAngleB

Float public

Default: 0.0

m_referenceAngleB

Float public

Default: 0.0

m_typeA

Int public

Defined in m_typeA:460

m_typeA

Int public

Defined in m_typeA:467