lovr.physics module simulates 3D rigid body physics.
A physics World holds all of the colliders and joints in the simulation. It must be updated every frame using
World:update, during which it will move all the colliders and resolve collisions between them.
|lovr.physics.newWorld||Create a new World.|
Colliders are objects that represent a single rigid body in the physics simulation. They can have forces applied to them and collide with other colliders.
|World:getColliders||Get a table of all Colliders in the World.|
|World:newBoxCollider||Add a Collider with a BoxShape to the World.|
|World:newCapsuleCollider||Add a Collider with a CapsuleShape to the World.|
|World:newCollider||Add a Collider to the World.|
|World:newCylinderCollider||Add a Collider with a CylinderShape to the World.|
|World:newMeshCollider||Add a Collider with a MeshShape to the World.|
|World:newSphereCollider||Add a Collider with a SphereShape to the World.|
Shapes are 3D physics shapes that can be attached to colliders. Shapes define, well, the shape of a Collider and how it collides with other objects. Without any Shapes, a collider wouldn't collide with anything.
Normally, you don't need to create Shapes yourself, as there are convenience functions on the World that will create colliders with shapes already attached. However, you can attach multiple Shapes to a collider to create more complicated objects, and sometimes it can be useful to access the individual Shapes on a collider.
|lovr.physics.newBoxShape||Create a new BoxShape.|
|lovr.physics.newCapsuleShape||Create a new CapsuleShape.|
|lovr.physics.newCylinderShape||Create a new CylinderShape.|
|lovr.physics.newSphereShape||Create a new SphereShape.|
Joints are objects that constrain the movement of colliders in various ways. Joints are attached to two colliders when they're created and usually have a concept of an "anchor", which is where the Joint is attached to relative to the colliders. Joints can be used to create all sorts of neat things like doors, drawers, buttons, levers, or pendulums.
|lovr.physics.newBallJoint||Create a new BallJoint.|
|lovr.physics.newDistanceJoint||Create a new DistanceJoint.|
|lovr.physics.newHingeJoint||Create a new HingeJoint.|
|lovr.physics.newSliderJoint||Create a new SliderJoint.|