API Documentation for:
Show:

b2RevoluteJoint Class

Extends b2Joint
Defined in: b2RevoluteJoint:18
Module: Joints

A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.

Constructor

b2RevoluteJoint

(
  • revoluteJointDef
)

Defined in b2RevoluteJoint:18

Parameters:

  • revoluteJointDef B2RevoluteJointDef

Methods

enableLimit

(
  • flag
)
Void public

Defined in enableLimit:502

Parameters:

Returns:

Void:

enableMotor

(
  • flag
)
Void public

Defined in enableMotor:436

Parameters:

Returns:

Void:

getAnchorB

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

Defined in getAnchorB:322

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAnchorB

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

Defined in getAnchorB:333

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getJointAngle

() Float public

Defined in getJointAngle:409

Returns:

Float:

getJointSpeed

() Float public

Defined in getJointSpeed:418

Returns:

Float:

getLocalAnchorA

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

Defined in getLocalAnchorA:372

The local anchor point relative to bodyA's origin.

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getLocalAnchorB

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

Defined in getLocalAnchorB:385

The local anchor point relative to bodyA's origin.

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getLowerLimit

() Float public

Defined in getLowerLimit:517

Returns:

Float:

getMaxMotorTorque

() Float public

Set the maximum friction force in N.

Returns:

Float:

getMotorSpeed

() Float public

Defined in getMotorSpeed:463

Returns:

Float:

getMotorTorque

(
  • invDeltaTime
)
Float public

Defined in getMotorTorque:450

Get the current motor torque given the inverse time step. Unit is N*m.

Parameters:

  • invDeltaTime B2Vec2 | Object=

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 due to the joint limit given the inverse time step. Unit is N*m.

Parameters:

  • invDeltaTime Float

Returns:

Float:

getReferenceAngle

() Float public

Get the reference angle.

Returns:

Float:

getUpperLimit

() Float public

Defined in getUpperLimit:526

Returns:

Float:

initVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

isLimitEnabled

() Boolean public

Defined in isLimitEnabled:493

Returns:

isMotorEnabled

() Boolean public

Defined in isMotorEnabled:427

Returns:

setLimits

(
  • lower
  • upper
)
Void public

Defined in setLimits:535

Parameters:

Returns:

Void:

setMaxMotorTorque

(
  • torque
)
Void public

Parameters:

  • torque Float

Returns:

Void:

setMotorSpeed

(
  • speed
)
Void public

Defined in setMotorSpeed:550

Parameters:

  • speed Float

Returns:

Void:

solvePositionConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

solveVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

Properties

m_enableLimit

Float public

Defined in m_enableLimit:199

m_enableMotor

Float public

Defined in m_enableMotor:213

Effective mass for motor/limit angular constraint.

Default: 0.0

m_enableMotor

Float public

Defined in m_enableMotor:206

m_impulse

B2Vec3 public

Defined in m_impulse:134

m_indexA

Int default 0 public

Defined in m_indexA:231

m_indexB

Int default 0 public

Defined in m_indexB:239

m_invMassA

Float public

Defined in m_invMassA:247

Default: 0.0

m_invMassA

Float public

Defined in m_invMassA:263

Default: 0.0

m_invMassB

Float public

Defined in m_invMassB:271

Default: 0.0

m_invMassB

Float public

Defined in m_invMassB:255

Default: 0.0

m_K

B2Mat22 public

Defined in m_K:85

m_lalcA

B2Vec2 public

Defined in m_lalcA:71

m_lalcB

B2Vec2 public

Defined in m_lalcB:78

m_limitState

int default b2Joint.e_inactiveLimit public

Defined in m_limitState:223

m_localAnchorA

B2Vec2 public

Defined in m_localAnchorA:106

m_localAnchorB

B2Vec2 public

Defined in m_localAnchorB:113

m_localCenterA

B2Vec2 public

Defined in m_localCenterA:120

m_localCenterB

B2Vec2 public

Defined in m_localCenterB:127

m_lowerAngle

Float public

Defined in m_lowerAngle:171

m_mass

B2Mat33 public

Defined in m_mass:141

Effective mass for point-to-point constraint.

m_maxMotorTorque

Float public

m_motorImpulse

Float public

Defined in m_motorImpulse:163

Default: 0.0

m_motorSpeed

Float public

Defined in m_motorSpeed:192

m_qA

B2Rot public

Defined in m_qA:57

m_qB

B2Rot public

Defined in m_qB:64

m_rA

B2Vec2 public

Defined in m_rA:92

m_rB

B2Vec2 public

Defined in m_rB:99

m_referenceAngle

Float public

m_upperAngle

Float public

Defined in m_upperAngle:178