{{newin|[[0.8.0]]|080|type=function}}
Creates a constraint joint between two bodies. A [[WeldJoint]] essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver.

{{notice|Making changes to a [[World]] is not allowed inside of the [[beginContact]], [[endContact]], [[preSolve]], and [[postSolve]] callback functions, as BOX2D locks the world during these callbacks.}}

== Function ==
=== Synopsis ===
<source lang="lua">
joint = love.physics.newWeldJoint( body1, body2, x, y, collideConnected )
</source>
=== Arguments ===
{{param|Body|body1|The first body to attach to the joint.}}
{{param|Body|body2|The second body to attach to the joint.}}
{{param|number|x|The x position of the anchor point (world space).}}
{{param|number|y|The y position of the anchor point (world space).}}
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}
=== Returns ===
{{param|WeldJoint|joint|The new WeldJoint.}}

== Function ==
=== Synopsis ===
<source lang="lua">
joint = love.physics.newWeldJoint( body1, body2, x1, y1, x2, y2, collideConnected )
</source>
=== Arguments ===
{{param|Body|body1|The first 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 (world space).}}
{{param|number|y1|The y position of the first anchor point (world space).}}
{{param|number|x2|The x position of the second anchor point (world space).}}
{{param|number|y2|The y position of the second anchor point (world space).}}
{{param|boolean|collideConnected (false)|Specifies whether the two bodies should collide with each other.}}

=== Returns ===
{{param|WeldJoint|joint|The new WeldJoint.}}

== Function ==
{{newin|[[0.10.2]]|102|type=variant}}

=== Synopsis ===
<source lang="lua">
joint = love.physics.newWeldJoint( body1, body2, x1, y1, x2, y2, collideConnected, referenceAngle )
</source>
=== Arguments ===
{{param|Body|body1|The first 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 (world space).}}
{{param|number|y1|The y position of the first anchor point  (world space).}}
{{param|number|x2|The x position of the second anchor point (world space).}}
{{param|number|y2|The y position of the second anchor point (world space).}}
{{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|WeldJoint|joint|The new WeldJoint.}}

== See Also ==
* [[parent::love.physics]]
* [[Constructs::WeldJoint]]
* [[Constructs::Joint]]
[[Category:Functions]]
{{#set:Description=A [[WeldJoint]] essentially glues two bodies together.}}
== Other Languages ==
{{i18n|love.physics.newWeldJoint}}