Difference between revisions of "love.physics.newGearJoint"

m
(Moved 0.8.0 variant to the top.)
Line 6: Line 6:
  
 
== Function ==
 
== Function ==
 +
{{newin|[[0.8.0]]|type=variant}}
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
joint = love.physics.newGearJoint( joint1, joint2, ratio )
+
joint = love.physics.newGearJoint( joint1, joint2, ratio, collideConnected )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
Line 14: Line 15:
 
{{param|Joint|joint2|The second 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|number|ratio (1)|The gear ratio.}}
 +
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
 
=== Returns ===
 
=== Returns ===
{{param|Joint|joint|The new gear joint.}}
+
{{param|GearJoint|joint|The new gear joint.}}
 +
 
 
== Function ==
 
== Function ==
{{newin|[[0.8.0]]|type=variant}}
+
{{oldin|[[0.8.0]]|type=variant}}
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
joint = love.physics.newGearJoint( joint1, joint2, ratio, collideConnected )
+
joint = love.physics.newGearJoint( joint1, joint2, ratio )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
Line 26: Line 29:
 
{{param|Joint|joint2|The second 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|number|ratio (1)|The gear ratio.}}
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
 
 
=== 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 21:47, 9 April 2012

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

Available since LÖVE 0.8.0
This variant is not supported in earlier versions.

Synopsis

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

Arguments

Joint joint1
The first joint to connect with a gear joint.
Joint joint2
The second joint to connect with a gear joint.
number ratio (1)
The gear ratio.
boolean collideConnected (false)
Specifies whether the two bodies should collide with each other.

Returns

GearJoint joint
The new gear joint.

Function

Removed in LÖVE 0.8.0
This variant is not supported in that and later versions.

Synopsis

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

Arguments

Joint joint1
The first joint to connect with a gear joint.
Joint joint2
The second joint to connect with a gear joint.
number ratio (1)
The gear ratio.

Returns

Joint joint
The new gear joint.

See Also


Other Languages