Difference between revisions of "love.physics.newDistanceJoint"

(add new func, explanation based on source & Box2D docs)
 
m (LOVE types have capital first letter.)
Line 8: Line 8:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|body|body1|The first body to attach to the joint.}}
+
{{param|Body|body1|The first body to attach to the joint.}}
{{param|body|body2|The second body to attach to the joint.}}
+
{{param|Body|body2|The second body to attach to the joint.}}
 
{{param|number|x1|The x position of the first anchor point.}}
 
{{param|number|x1|The x position of the first anchor point.}}
 
{{param|number|y1|The y position of the first anchor point.}}
 
{{param|number|y1|The y position of the first anchor point.}}
Line 16: Line 16:
  
 
=== Returns ===
 
=== Returns ===
{{param|joint|joint|The new distance joint.}}
+
{{param|Joint|joint|The new distance joint.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::love.physics]]
 
* [[parent::love.physics]]

Revision as of 17:09, 28 February 2010

Create 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.

Function

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