Create a [[GearJoint]] connecting two Joints.

The gear joint connects two joints that must be either [[PrismaticJoint| prismatic]] or [[RevoluteJoint | revolute]] joints. Using this joint requires that the joints it uses connect their respective bodies to the ground and have the ground as the first body. When destroying the bodies and joints you must make sure you destroy the gear joint before the other joints.

The gear joint has a ratio the determines how the angular or distance values of the connected joints relate to each other. The formula <tt>coordinate1 + ratio * coordinate2</tt> always has a constant value that is set when the gear joint is created.

[[File:physicsJointGear.png]]

== Function ==
{{newin|[[0.8.0]]|080|type=variant}}
=== Synopsis ===
<source lang="lua">
joint = love.physics.newGearJoint( joint1, joint2, ratio, collideConnected )
</source>
=== Arguments ===
{{param|Joint|joint1|The first joint to connect with a gear joint.}}
{{param|Joint|joint2|The second joint to connect with a gear joint.}}
{{param|number|ratio (1)|The gear ratio.}}
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
=== Returns ===
{{param|GearJoint|joint|The new gear joint.}}

== Function ==
{{oldin|[[0.8.0]]|080|type=variant}}
=== Synopsis ===
<source lang="lua">
joint = love.physics.newGearJoint( joint1, joint2, ratio )
</source>
=== Arguments ===
{{param|Joint|joint1|The first joint to connect with a gear joint.}}
{{param|Joint|joint2|The second joint to connect with a gear joint.}}
{{param|number|ratio (1)|The gear ratio.}}
=== Returns ===
{{param|GearJoint|joint|The new gear joint.}}

== See Also ==
* [[parent::love.physics]]
* [[Constructs::GearJoint]]
* [[Constructs::Joint]]
[[Category:Functions]]
{{#set:Description=Create a [[GearJoint]] connecting two Joints.}}
{{#set:Since=000}}
== Other Languages ==
{{i18n|love.physics.newGearJoint}}