Difference between revisions of "love.physics.newRevoluteJoint"

(Returns RevoluteJoint, not Joint)
m (Add the two missing parameters added in 0.10.2)
 
Line 24: Line 24:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
joint = love.physics.newRevoluteJoint( body1, body2, x, y, collideConnected, referenceAngle )
+
joint = love.physics.newRevoluteJoint( body1, body2, x1, y1, x2, y2, collideConnected, referenceAngle )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
{{param|Body|body1|The first body.}}
 
{{param|Body|body1|The first body.}}
 
{{param|Body|body2|The second body.}}
 
{{param|Body|body2|The second body.}}
{{param|number|x|The x position of the connecting point.}}
+
{{param|number|x1|The x position of the first connecting point.}}
{{param|number|y|The y position of the connecting point.}}
+
{{param|number|y1|The y position of the first connecting point.}}
 +
{{param|number|x2|The x position of the second connecting point.}}
 +
{{param|number|y2|The y position of the second connecting point.}}
 
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
 
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
 
{{param|number|referenceAngle (0)|The reference angle between body1 and body2, in radians.}}
 
{{param|number|referenceAngle (0)|The reference angle between body1 and body2, in radians.}}

Latest revision as of 19:15, 26 December 2016

Creates a pivot joint between two bodies.

This joint connects two bodies to a point around which they can pivot.

physicsJointRevolute.png

Function

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

Synopsis

joint = love.physics.newRevoluteJoint( body1, body2, x, y, collideConnected )

Arguments

Body body1
The first body.
Body body2
The second body.
number x
The x position of the connecting point.
number y
The y position of the connecting point.
boolean collideConnected (false)
Specifies whether the two bodies should collide with each other.

Returns

RevoluteJoint joint
The new revolute joint.

Function

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

Synopsis

joint = love.physics.newRevoluteJoint( body1, body2, x1, y1, x2, y2, collideConnected, referenceAngle )

Arguments

Body body1
The first body.
Body body2
The second body.
number x1
The x position of the first connecting point.
number y1
The y position of the first connecting point.
number x2
The x position of the second connecting point.
number y2
The y position of the second connecting point.
boolean collideConnected (false)
Specifies whether the two bodies should collide with each other.
number referenceAngle (0)
The reference angle between body1 and body2, in radians.

Returns

RevoluteJoint joint
The new revolute joint.

Function

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

Synopsis

joint = love.physics.newRevoluteJoint( body1, body2, x, y )

Arguments

Body body1
The first body to connect with a Revolute Joint.
Body body2
The second body to connect with a Revolute Joint.
number x
The x position of the connecting point.
number y
The y position of the connecting point.

Returns

RevoluteJoint joint
The new revolute joint.

See Also


Other Languages