World:newCollider
EditAdds a new Collider to the World, without attaching any Shapes to it. Use Collider:addShape
to add shapes.
Arguments
Name | Type | Description |
x | number | The x position of the Collider. |
y | number | The y position of the Collider. |
z | number | The z position of the Collider. |
Returns
Name | Type | Description |
collider | Collider | The new Collider. |
Arguments
Name | Type | Description |
position | Vec3 | The position of the Collider. |
Returns
Name | Type | Description |
collider | Collider | The new Collider. |
Notes
This will throw an error if there are too many colliders in the world. The limit defaults to 16384 and can be changed in lovr.physics.newWorld
.
Example
function lovr.load()
world = lovr.physics.newWorld()
collider = world:newCollider(0, 0, 0)
shape = lovr.physics.newSphereShape(.5)
collider:addShape(shape)
end