lovr.physics
EditThe lovr.physics
module simulates 3D rigid body physics.
World
A World holds all of the objects in a physics simulation. Use methods like World:newBoxCollider
to add objects to the world. Call World:update
each frame to advance the physics simulation and calculate new positions for all the colliders.
lovr.physics.newWorld | Create a new World. |
Colliders
A Collider is a single "object" in the physics world. A Collider has zero or more Shape
objects attached to it, which determine its collision shape. Colliders can be connected together with Joint
objects.
World:newCollider | Add a Collider to the World. |
World:newBoxCollider | Add a Collider with a BoxShape to the World. |
World:newSphereCollider | Add a Collider with a SphereShape to the World. |
World:newCapsuleCollider | Add a Collider with a CapsuleShape to the World. |
World:newCylinderCollider | Add a Collider with a CylinderShape to the World. |
World:newConvexCollider | Add a Collider with a ConvexShape to the World. |
World:newMeshCollider | Add a Collider with a MeshShape to the World. |
World:newTerrainCollider | Add a Collider with a TerrainShape to the World. |
Shapes
Shapes define the collision shape of a collider. Normally it isn't necessary to create shapes manually, instead convenience methods like World:newSphereCollider
will create a collider with a shape attached.
lovr.physics.newBoxShape | Create a new BoxShape. |
lovr.physics.newSphereShape | Create a new SphereShape. |
lovr.physics.newCapsuleShape | Create a new CapsuleShape. |
lovr.physics.newCylinderShape | Create a new CylinderShape. |
lovr.physics.newConvexShape | Create a new ConvexShape. |
lovr.physics.newMeshShape | Create a new MeshShape. |
lovr.physics.newTerrainShape | Create a new TerrainShape. |
Joints
Joints connect colliders together and constrain their movement in various ways.
lovr.physics.newWeldJoint | Create a new WeldJoint. |
lovr.physics.newBallJoint | Create a new BallJoint. |
lovr.physics.newConeJoint | Create a new ConeJoint. |
lovr.physics.newDistanceJoint | Create a new DistanceJoint. |
lovr.physics.newHingeJoint | Create a new HingeJoint. |
lovr.physics.newSliderJoint | Create a new SliderJoint. |