Shape
EditA Shape is a physics object that can be attached to colliders to define their shape.
Constructors
| 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. |
| 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. |
Basics
| Shape:getType | Get the type of the Shape. |
| Shape:destroy | Destroy the Shape. |
| Shape:isDestroyed | Check if the Shape is destroyed. |
| Shape:getCollider | Get the Collider the Shape is attached to. |
| Shape:getUserData | Get the Lua value associated with the Shape. |
| Shape:setUserData | Associate a Lua value with the Shape. |
Position
| Shape:getOffset | Get the local offset of the Shape. |
| Shape:setOffset | Set the local offset of the Shape. |
| Shape:getPosition | Get the position of the Shape. |
| Shape:getOrientation | Get the orientation of the Shape. |
| Shape:getPose | Get the pose of the Shape. |
| Shape:getAABB | Get the Shape's axis aligned bounding box. |
Mass
| Shape:getVolume | Get the volume of the Shape. |
| Shape:getDensity | Get the density of the Shape. |
| Shape:setDensity | Set the density of the Shape. |
| Shape:getMass | Get the mass of the Shape. |
| Shape:getInertia | Get the inertia of the Shape. |
| Shape:getCenterOfMass | Get the center of mass of the Shape. |
Queries
| Shape:containsPoint | Check if a point is inside the shape. |
| Shape:raycast | Cast a ray against the shape. |