Difference between revisions of "love.physics.newGearJoint"

(add new func, explanation based on source & Box2D docs)
 
m (LOVE types have capital first letter.)
Line 10: Line 10:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|body|joint1|The first joint to connect with a gear joint.}}
+
{{param|Bbody|joint1|The first joint to connect with a gear joint.}}
{{param|body|joint2|The second joint to connect with a gear joint.}}
+
{{param|Body|joint2|The second joint to connect with a gear joint.}}
 
{{param|number|ratio|The gear ratio.}}
 
{{param|number|ratio|The gear ratio.}}
 
=== Returns ===
 
=== Returns ===
{{param|joint|joint|The new gear joint.}}
+
{{param|Joint|joint|The new gear joint.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::love.physics]]
 
* [[parent::love.physics]]

Revision as of 18:08, 28 February 2010

Create a gear joint connecting two joints.

The gear joint connects two joints that must be either prismatic or 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 coordinate1 + ratio * coordinate2 always has a constant value that is set when the gear joint is created.

Function

Synopsis

joint = love.physics.newGearJoint( joint1, joint2, ratio )

Arguments

Bbody joint1
The first joint to connect with a gear joint.
Body joint2
The second joint to connect with a gear joint.
number ratio
The gear ratio.

Returns

Joint joint
The new gear joint.

See Also