Creates a new body.

There are three types of bodies. 
* Static bodies do not move, have a infinite mass, and can be used for level boundaries. 
* Dynamic bodies are the main actors in the simulation, they collide with everything. 
* Kinematic bodies do not react to forces and only collide with dynamic bodies.

The mass of the body gets calculated when a [[Fixture]] is attached or removed, but can be changed at any time with [[Body:setMass]] or [[Body:resetMassData]].

{{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 ==
{{newin|[[0.8.0]]|080|type=variant}}
=== Synopsis ===
<source lang="lua">
body = love.physics.newBody( world, x, y, type )
</source>
=== Arguments ===
{{param|World|world|The world to create the body in.}}
{{param|number|x (0)|The x position of the body.}}
{{param|number|y (0)|The y position of the body.}}
{{param|BodyType|type ("static")|The type of the body.}}
=== Returns ===
{{param|Body|body|A new body.}}

== Function ==
{{oldin|[[0.8.0]]|080|type=variant}}
=== Synopsis ===
<source lang="lua">
body = love.physics.newBody( world, x, y, m, i )
</source>
=== Arguments ===
{{param|World|world|The world to create the body in.}}
{{param|number|x (0)|The x position of the body.}}
{{param|number|y (0)|The y position of the body.}}
{{param|number|m (0)|The mass of the body.}}
{{param|number|i (0)|The rotational inertia of the body.}}
=== Returns ===
{{param|Body|body|A new body.}}

== See Also ==
* [[parent::love.physics]]
* [[Constructs::Body]]
[[Category:Functions]]
{{#set:Description=Creates a new body.}}
{{#set:Since=000}}
== Other Languages ==
{{i18n|love.physics.newBody}}