PackageBox2D.Dynamics.Joints
Classpublic class b2GearJoint
Inheritanceb2GearJoint Inheritance b2Joint
Sourceb2GearJoint.as

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: coordinate1 + ratio coordinate2 = 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: The revolute and prismatic joints must be attached to fixed bodies (which must be body1 on those joints).

See also

b2GearJointDef


Public Methods
 MethodDefined by
  
Get the anchor point on bodyA in world coordinates.
b2GearJoint
  
Get the anchor point on bodyB in world coordinates.
b2GearJoint
 Inherited
Get the first body attached to this joint.
b2Joint
 Inherited
Get the second body attached to this joint.
b2Joint
 Inherited
Get the next joint the world joint list.
b2Joint
  
GetRatio():Number
Get the gear ratio.
b2GearJoint
  
GetReactionForce(inv_dt:Number):b2Vec2
Get the reaction force on body2 at the joint anchor in Newtons.
b2GearJoint
  
GetReactionTorque(inv_dt:Number):Number
Get the reaction torque on body2 in N.
b2GearJoint
 Inherited
GetType():int
Get the type of the concrete joint.
b2Joint
 Inherited
Get the user data pointer.
b2Joint
 Inherited
IsActive():Boolean
Short-cut function to determine if either body is inactive.
b2Joint
  
SetRatio(ratio:Number):void
Set the gear ratio.
b2GearJoint
 Inherited
SetUserData(data:*):void
Set the user data pointer.
b2Joint
Method detail
GetAnchorA()method
public override function GetAnchorA():b2Vec2

Get the anchor point on bodyA in world coordinates.

Returns
b2Vec2
GetAnchorB()method 
public override function GetAnchorB():b2Vec2

Get the anchor point on bodyB in world coordinates.

Returns
b2Vec2
GetRatio()method 
public function GetRatio():Number

Get the gear ratio.

Returns
Number
GetReactionForce()method 
public override function GetReactionForce(inv_dt:Number):b2Vec2

Get the reaction force on body2 at the joint anchor in Newtons.

Parameters
inv_dt:Number

Returns
b2Vec2
GetReactionTorque()method 
public override function GetReactionTorque(inv_dt:Number):Number

Get the reaction torque on body2 in N.

Parameters
inv_dt:Number

Returns
Number
SetRatio()method 
public function SetRatio(ratio:Number):void

Set the gear ratio.

Parameters
ratio:Number