Difference between revisions of "love.physics"

(Removed wrong capitalisation from notice. "Love.physics" -> "love.physics")
Line 1: Line 1:
 
Can simulate 2D rigid body physics in a realistic manner.
 
Can simulate 2D rigid body physics in a realistic manner.
 
This module is based on [http://www.box2d.org/ Box2D], and this API corresponds to the [http://www.box2d.org/manual.html Box2D API] as closely as possible.
 
This module is based on [http://www.box2d.org/ Box2D], and this API corresponds to the [http://www.box2d.org/manual.html Box2D API] as closely as possible.
{{notice|Love.physics is not lightweight, and not even remotely simple to use. Its a ten-ton hammer designed for heavy-lifting (er...hammer...lifting?).
+
{{notice|love.physics is not lightweight, and not even remotely simple to use. Its a ten-ton hammer designed for heavy-lifting (er...hammer...lifting?).
 
If you are just trying to make a character jump around on blocks or the likes, then move along, nothing to see here.}}
 
If you are just trying to make a character jump around on blocks or the likes, then move along, nothing to see here.}}
  

Revision as of 08:16, 31 May 2011

Can simulate 2D rigid body physics in a realistic manner. This module is based on Box2D, and this API corresponds to the Box2D API as closely as possible.

O.png love.physics is not lightweight, and not even remotely simple to use. Its a ten-ton hammer designed for heavy-lifting (er...hammer...lifting?).

If you are just trying to make a character jump around on blocks or the likes, then move along, nothing to see here.

 


Types

BodyBodies are objects with velocity and position.
ContactContacts are objects created to manage collisions in worlds.
JointAttach multiple bodies together to interact in unique ways.
ShapeShapes are objects used to control mass and collisions.
WorldA world is an object that contains all bodies and joints.

Functions

love.physics.newBodyCreates a new body.
love.physics.newCircleShapeCreates a new CircleShape.
love.physics.newDistanceJointCreates a DistanceJoint between two bodies.
love.physics.newGearJointCreate a GearJoint connecting two Joints.
love.physics.newMouseJointCreate a joint between a body and the mouse.
love.physics.newPolygonShapeCreates a new PolygonShape.
love.physics.newPrismaticJointCreates a PrismaticJoint between two bodies.
love.physics.newPulleyJointCreates a PulleyJoint to join two bodies to each other and the ground.
love.physics.newRectangleShapeShorthand for creating rectangular PolygonShapes.
love.physics.newRevoluteJointCreates a pivot joint between two bodies.
love.physics.newWorldCreates a new World.

See Also


Other Languages