b2RevoluteJoint Class
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
Parameters:
-
revoluteJointDef
B2RevoluteJointDef
Item Index
Methods
- enableLimit
- enableMotor
- getAnchorB
- getAnchorB
- getJointAngle
- getJointSpeed
- getLocalAnchorA
- getLocalAnchorB
- getLowerLimit
- getMaxMotorTorque
- getMotorSpeed
- getMotorTorque
- getReactionForce
- getReactionTorque
- getReferenceAngle
- getUpperLimit
- initVelocityConstraints
- isLimitEnabled
- isMotorEnabled
- setLimits
- setMaxMotorTorque
- setMotorSpeed
- solvePositionConstraints
- solveVelocityConstraints
- create static
- destroy static
- getAnchorA
- getAnchorB
- getBodyA
- getBodyB
- getCollideConnected
- getNext
- getReactionForce
- getReactionTorque
- getType
- getUserData
- initVelocityConstraints
- isActive
- setUserData
- shiftOrigin
- solveVelocityConstraints
- solveVelocityConstraints
Properties
- m_enableLimit
- m_enableMotor
- m_enableMotor
- m_impulse
- m_indexA
- m_indexB
- m_invMassA
- m_invMassA
- m_invMassB
- m_invMassB
- m_K
- m_lalcA
- m_lalcB
- m_limitState
- m_localAnchorA
- m_localAnchorB
- m_localCenterA
- m_localCenterB
- m_lowerAngle
- m_mass
- m_maxMotorTorque
- m_motorImpulse
- m_motorSpeed
- m_qA
- m_qB
- m_rA
- m_rB
- m_referenceAngle
- m_upperAngle
- 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
getJointAngle
()
Float
public
Returns:
getJointSpeed
()
Float
public
Returns:
getLocalAnchorA
-
[out=b2Vec2]
The local anchor point relative to bodyA's origin.
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getLocalAnchorB
-
[out=b2Vec2]
The local anchor point relative to bodyA's origin.
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getLowerLimit
()
Float
public
Returns:
getMaxMotorTorque
()
Float
public
Set the maximum friction force in N.
Returns:
getMotorSpeed
()
Float
public
Returns:
getMotorTorque
-
invDeltaTime
Get the current motor torque given the inverse time step. Unit is N*m.
Parameters:
-
invDeltaTime
B2Vec2 | Object=
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 due to the joint limit given the inverse time step. Unit is N*m.
Parameters:
-
invDeltaTime
Float
Returns:
getReferenceAngle
()
Float
public
Get the reference angle.
Returns:
getUpperLimit
()
Float
public
Returns:
initVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
setMaxMotorTorque
-
torque
Parameters:
-
torque
Float
Returns:
setMotorSpeed
-
speed
Parameters:
-
speed
Float
Returns:
solvePositionConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
solveVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
Properties
m_enableLimit
Float
public
m_enableMotor
Float
public
Effective mass for motor/limit angular constraint.
Default: 0.0
m_enableMotor
Float
public
m_impulse
B2Vec3
public
m_indexA
Int
default 0
public
m_indexB
Int
default 0
public
m_invMassA
Float
public
Default: 0.0
m_invMassA
Float
public
Default: 0.0
m_invMassB
Float
public
Default: 0.0
m_invMassB
Float
public
Default: 0.0
m_K
B2Mat22
public
m_lalcA
B2Vec2
public
m_lalcB
B2Vec2
public
m_limitState
int
default b2Joint.e_inactiveLimit
public
m_localAnchorA
B2Vec2
public
m_localAnchorB
B2Vec2
public
m_localCenterA
B2Vec2
public
m_localCenterB
B2Vec2
public
m_lowerAngle
Float
public
m_mass
B2Mat33
public
Effective mass for point-to-point constraint.
m_maxMotorTorque
Float
public
m_motorImpulse
Float
public
Default: 0.0