b2GearJoint Class
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
Parameters:
-
gearJointDef
B2GearJointDef
Item Index
Methods
- getAnchorA
- getAnchorB
- getJoint1
- getJoint1
- getRatio
- getReactionForce
- getReactionTorque
- initVelocityConstraints
- setRatio
- solvePositionConstraints
- create static
- destroy static
- getAnchorA
- getAnchorB
- getBodyA
- getBodyB
- getCollideConnected
- getNext
- getReactionForce
- getReactionTorque
- getType
- getUserData
- initVelocityConstraints
- isActive
- setUserData
- shiftOrigin
- solveVelocityConstraints
- solveVelocityConstraints
Properties
- m_bodyA
- m_bodyA
- m_bodyB
- m_bodyC
- m_bodyD
- m_iA
- m_iB
- m_iB
- m_iC
- m_iD
- m_impulse
- m_indexA
- m_indexB
- m_indexC
- m_indexD
- m_joint1
- m_joint1
- m_JvAC
- m_JvAC
- m_JvBD
- m_JvBD
- m_JwA
- m_JwB
- m_JwC
- m_JwD
- m_lalcA
- m_lalcB
- m_lalcC
- m_lalcD
- m_lcA
- m_lcB
- m_lcC
- m_lcD
- m_localAnchorA
- m_localAnchorB
- m_localAnchorC
- m_localAnchorD
- m_localAxisC
- m_localAxisD
- m_mA
- m_mass
- m_mass
- m_mB
- m_mC
- m_mD
- m_qA
- m_qB
- m_qB
- m_qC
- m_qC
- m_qD
- m_qD
- m_ratio
- m_referenceAngleA
- m_referenceAngleB
- m_referenceAngleB
- m_typeA
- m_typeA
- m_bodyA
- m_bodyB
- m_collideConnected
- m_edgeA
- m_edgeB
- m_index
- m_islandFlag
- m_next
- m_prev
- m_type
- m_userData
- ParentClass
Methods
getAnchorA
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getRatio
()
Float
public
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:
setRatio
-
ratio
Parameters:
-
ratio
Float
Returns:
solvePositionConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
Properties
m_bodyA
B2Body
public
Body A is connected to body C.
m_bodyA
B2Body
public
m_bodyB
B2Body
public
Body B is connected to body D.
m_bodyC
B2Body
public
Body A is connected to body C.
m_bodyD
B2Body
public
Body B is connected to body D.
m_iA
Int
public
Default: 0.0
m_iB
Int
public
Default: 0.0
m_iB
Int
public
Default: 0.0
m_iC
Int
public
Default: 0.0
m_iD
Int
public
Default: 0.0
m_indexA
Int
public
Default: 0
m_indexB
Int
public
Default: 0
m_indexC
Int
public
Default: 0
m_indexD
Int
public
Default: 0
m_JvAC
B2Vec2
public
m_JvAC
Float
public
Default: 0.0
m_JvBD
B2Vec2
public
m_JvBD
Float
public
Default: 0.0
m_JwA
Float
public
Default: 0.0
m_JwB
Float
public
Default: 0.0
m_JwC
Float
public
Default: 0.0
m_JwD
Float
public
Default: 0.0
m_lalcA
B2Vec2
public
m_lalcB
B2Vec2
public
m_lalcC
B2Vec2
public
m_lalcD
B2Vec2
public
m_lcA
B2Vec2
public
m_lcB
B2Vec2
public
m_lcC
B2Vec2
public
m_lcD
B2Vec2
public
m_localAnchorA
B2Vec2
public
m_localAnchorB
B2Vec2
public
m_localAnchorC
B2Vec2
public
m_localAnchorD
B2Vec2
public
m_localAxisC
B2Vec2
public
m_localAxisD
B2Vec2
public
m_mA
Int
public
Default: 0.0
m_mass
Float
public
Default: 0.0
m_mass
B2Rot
public
Default: 0.0
m_mB
Int
public
Default: 0.0
m_mC
Int
public
Default: 0.0
m_mD
Int
public
Default: 0.0
m_qA
B2Rot
public
m_qB
B2Rot
public
m_qB
B2Rot
public
Default: 0.0
m_qC
B2Rot
public
Default: 0.0
m_qC
B2Rot
public
m_qD
B2Rot
public
Default: 0.0
m_qD
B2Rot
public
m_ratio
Float
public
m_referenceAngleA
Float
public
Default: 0.0
m_referenceAngleB
Float
public
Default: 0.0
m_referenceAngleB
Float
public
Default: 0.0