Difference between revisions of "love.physics.newPrismaticJoint"

m
m
 
(11 intermediate revisions by 8 users not shown)
Line 1: Line 1:
Create a prismatic joints between two bodies.
+
Creates a [[PrismaticJoint]] between two bodies.
  
 
A prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a [[RevoluteJoint| revolute]] joint, but with translation and force substituted for angle and torque.
 
A prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a [[RevoluteJoint| revolute]] joint, but with translation and force substituted for angle and torque.
 +
 +
[[File:physicsJointPrismatic.png]]
 +
 
== Function ==
 
== Function ==
 +
{{newin|[[0.8.0]]|080|type=variant}}
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
joint = love.physics.newPrismaticJoint( body1, body2, x, y, ax, ay )
+
joint = love.physics.newPrismaticJoint( body1, body2, x, y, ax, ay, collideConnected )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
{{param|Body|body1|The first body to connect with a prismatic joint.}}
 
{{param|Body|body1|The first body to connect with a prismatic joint.}}
{{param|Body|bdy2|The second body to connect with a prismatic joint.}}
+
{{param|Body|body2|The second body to connect with a prismatic joint.}}
 
{{param|number|x|The x coordinate of the anchor point.}}
 
{{param|number|x|The x coordinate of the anchor point.}}
 
{{param|number|y|The y coordinate of the anchor point.}}
 
{{param|number|y|The y coordinate of the anchor point.}}
 
{{param|number|ax|The x coordinate of the axis vector.}}
 
{{param|number|ax|The x coordinate of the axis vector.}}
 
{{param|number|ay|The y coordinate of the axis vector.}}
 
{{param|number|ay|The y coordinate of the axis vector.}}
 +
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
 +
=== Returns ===
 +
{{param|PrismaticJoint|joint|The new prismatic joint.}}
 +
 +
== Function ==
 +
{{newin|[[0.8.0]]|080|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
joint = love.physics.newPrismaticJoint( body1, body2, x1, y1, x2, y2, ax, ay, collideConnected )
 +
</source>
 +
=== Arguments ===
 +
{{param|Body|body1|The first body to connect with a prismatic joint.}}
 +
{{param|Body|body2|The second body to connect with a prismatic joint.}}
 +
{{param|number|x1|The x coordinate of the first anchor point.}}
 +
{{param|number|y1|The y coordinate of the first anchor point.}}
 +
{{param|number|x2|The x coordinate of the second anchor point.}}
 +
{{param|number|y2|The y coordinate of the second anchor point.}}
 +
{{param|number|ax|The x coordinate of the axis unit vector.}}
 +
{{param|number|ay|The y coordinate of the axis unit vector.}}
 +
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
 +
=== Returns ===
 +
{{param|PrismaticJoint|joint|The new prismatic joint.}}
 +
 +
== Function ==
 +
{{newin|[[0.10.2]]|102|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
joint = love.physics.newPrismaticJoint( body1, body2, x1, y1, x2, y2, ax, ay, collideConnected, referenceAngle )
 +
</source>
 +
=== Arguments ===
 +
{{param|Body|body1|The first body to connect with a prismatic joint.}}
 +
{{param|Body|body2|The second body to connect with a prismatic joint.}}
 +
{{param|number|x1|The x coordinate of the first anchor point.}}
 +
{{param|number|y1|The y coordinate of the first anchor point.}}
 +
{{param|number|x2|The x coordinate of the second anchor point.}}
 +
{{param|number|y2|The y coordinate of the second anchor point.}}
 +
{{param|number|ax|The x coordinate of the axis unit vector.}}
 +
{{param|number|ay|The y coordinate of the axis unit vector.}}
 +
{{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.}}
 +
=== Returns ===
 +
{{param|PrismaticJoint|joint|The new prismatic joint.}}
 +
 +
== Function ==
 +
{{oldin|[[0.8.0]]|080|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
joint = love.physics.newPrismaticJoint( body1, body2, x, y, ax, ay )
 +
</source>
 +
=== Arguments ===
 +
{{param|Body|body1|The first body to connect with a prismatic joint.}}
 +
{{param|Body|body2|The second body to connect with a prismatic joint.}}
 +
{{param|number|x|The x coordinate of the anchor point.}}
 +
{{param|number|y|The y coordinate of the anchor point.}}
 +
{{param|number|ax|The x coordinate of the axis unit vector.}}
 +
{{param|number|ay|The y coordinate of the axis unit vector.}}
 
=== Returns ===
 
=== Returns ===
{{param|Joint|joint|The new prismatic joint.}}
+
{{param|PrismaticJoint|joint|The new prismatic joint.}}
 +
 
 +
 
 
== See Also ==
 
== See Also ==
 
* [[parent::love.physics]]
 
* [[parent::love.physics]]
 +
* [[Constructs::PrismaticJoint]]
 +
* [[Constructs::Joint]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Create a prismatic joints between two bodies.
+
{{#set:Description=Creates a [[PrismaticJoint]] between two bodies.}}
}}
+
{{#set:Since=000}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.physics.newPrismaticJoint}}
 
{{i18n|love.physics.newPrismaticJoint}}

Latest revision as of 01:27, 31 October 2016

Creates a PrismaticJoint between two bodies.

A prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque.

physicsJointPrismatic.png

Function

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

Synopsis

joint = love.physics.newPrismaticJoint( body1, body2, x, y, ax, ay, collideConnected )

Arguments

Body body1
The first body to connect with a prismatic joint.
Body body2
The second body to connect with a prismatic joint.
number x
The x coordinate of the anchor point.
number y
The y coordinate of the anchor point.
number ax
The x coordinate of the axis vector.
number ay
The y coordinate of the axis vector.
boolean collideConnected (false)
Specifies whether the two bodies should collide with each other.

Returns

PrismaticJoint joint
The new prismatic joint.

Function

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

Synopsis

joint = love.physics.newPrismaticJoint( body1, body2, x1, y1, x2, y2, ax, ay, collideConnected )

Arguments

Body body1
The first body to connect with a prismatic joint.
Body body2
The second body to connect with a prismatic joint.
number x1
The x coordinate of the first anchor point.
number y1
The y coordinate of the first anchor point.
number x2
The x coordinate of the second anchor point.
number y2
The y coordinate of the second anchor point.
number ax
The x coordinate of the axis unit vector.
number ay
The y coordinate of the axis unit vector.
boolean collideConnected (false)
Specifies whether the two bodies should collide with each other.

Returns

PrismaticJoint joint
The new prismatic joint.

Function

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

Synopsis

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

Arguments

Body body1
The first body to connect with a prismatic joint.
Body body2
The second body to connect with a prismatic joint.
number x1
The x coordinate of the first anchor point.
number y1
The y coordinate of the first anchor point.
number x2
The x coordinate of the second anchor point.
number y2
The y coordinate of the second anchor point.
number ax
The x coordinate of the axis unit vector.
number ay
The y coordinate of the axis unit vector.
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

PrismaticJoint joint
The new prismatic joint.

Function

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

Synopsis

joint = love.physics.newPrismaticJoint( body1, body2, x, y, ax, ay )

Arguments

Body body1
The first body to connect with a prismatic joint.
Body body2
The second body to connect with a prismatic joint.
number x
The x coordinate of the anchor point.
number y
The y coordinate of the anchor point.
number ax
The x coordinate of the axis unit vector.
number ay
The y coordinate of the axis unit vector.

Returns

PrismaticJoint joint
The new prismatic joint.


See Also


Other Languages