Difference between revisions of "love.physics.newDistanceJoint"
m |
(Moved 0.8.0 variant to the top.) |
||
Line 1: | Line 1: | ||
− | + | Creates a distance joint between two bodies. | |
This joint constrains the distance between two points on two bodies to be constant. These two points are specified in world coordinates and the two bodies are assumed to be in place when this joint is created. The first anchor point is connected to the first body and the second to the second body, and the points define the length of the distance joint. | This joint constrains the distance between two points on two bodies to be constant. These two points are specified in world coordinates and the two bodies are assumed to be in place when this joint is created. The first anchor point is connected to the first body and the second to the second body, and the points define the length of the distance joint. | ||
== Function == | == Function == | ||
+ | {{newin|[[0.8.0]]|type=variant}} | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | joint = love.physics.newDistanceJoint( body1, body2, x1, y1, x2, y2 ) | + | joint = love.physics.newDistanceJoint( body1, body2, x1, y1, x2, y2, collideConnected ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
Line 14: | Line 15: | ||
{{param|number|x2|The x position of the second anchor point.}} | {{param|number|x2|The x position of the second anchor point.}} | ||
{{param|number|y2|The y position of the second anchor point.}} | {{param|number|y2|The y position of the second anchor point.}} | ||
+ | {{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}} | ||
=== Returns === | === Returns === | ||
{{param|Joint|joint|The new distance joint.}} | {{param|Joint|joint|The new distance joint.}} | ||
+ | |||
== Function == | == Function == | ||
− | {{ | + | {{oldin|[[0.8.0]]|type=variant}} |
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | joint = love.physics.newDistanceJoint( body1, body2, x1, y1, x2, y2 | + | joint = love.physics.newDistanceJoint( body1, body2, x1, y1, x2, y2 ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
Line 29: | Line 32: | ||
{{param|number|x2|The x position of the second anchor point.}} | {{param|number|x2|The x position of the second anchor point.}} | ||
{{param|number|y2|The y position of the second anchor point.}} | {{param|number|y2|The y position of the second anchor point.}} | ||
− | |||
=== Returns === | === Returns === | ||
{{param|Joint|joint|The new distance joint.}} | {{param|Joint|joint|The new distance joint.}} | ||
Line 36: | Line 38: | ||
* [[Constructs::DistanceJoint]] | * [[Constructs::DistanceJoint]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description= | + | {{#set:Description=Creates a distance joint between two bodies.}} |
{{#set:Since=000}} | {{#set:Since=000}} | ||
== Other Languages == | == Other Languages == | ||
{{i18n|love.physics.newDistanceJoint}} | {{i18n|love.physics.newDistanceJoint}} |
Revision as of 21:33, 9 April 2012
Creates a distance joint between two bodies.
This joint constrains the distance between two points on two bodies to be constant. These two points are specified in world coordinates and the two bodies are assumed to be in place when this joint is created. The first anchor point is connected to the first body and the second to the second body, and the points define the length of the distance joint.
Contents
Function
Available since LÖVE 0.8.0 |
This variant is not supported in earlier versions. |
Synopsis
joint = love.physics.newDistanceJoint( body1, body2, x1, y1, x2, y2, collideConnected )
Arguments
Body body1
- The first body to attach to the joint.
Body body2
- The second body to attach to the joint.
number x1
- The x position of the first anchor point.
number y1
- The y position of the first anchor point.
number x2
- The x position of the second anchor point.
number y2
- The y position of the second anchor point.
boolean collideConnected (false)
- Specifies whether the two bodies should collide with each other.
Returns
Joint joint
- The new distance joint.
Function
Removed in LÖVE 0.8.0 |
This variant is not supported in that and later versions. |
Synopsis
joint = love.physics.newDistanceJoint( body1, body2, x1, y1, x2, y2 )
Arguments
Body body1
- The first body to attach to the joint.
Body body2
- The second body to attach to the joint.
number x1
- The x position of the first anchor point.
number y1
- The y position of the first anchor point.
number x2
- The x position of the second anchor point.
number y2
- The y position of the second anchor point.
Returns
Joint joint
- The new distance joint.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info