Model:meshes
EditReturns an iterator that iterates over the nodes with meshes in the Model.
This is convenient when drawing individual meshes in the Model using Pass:drawPart.
iterator, state, initial = Model:meshes()Arguments
None
Returns
| Name | Type | Description |
| iterator | function | The iterator function. The iterator function returns the index of the next node, and the index of its mesh. |
| state | Model | The Model. |
| initial | nil | The initial value. |
Example
function lovr.draw(pass)
for node, mesh in model:meshes() do
pass:push()
pass:transform(model:getNodeTransform(node))
-- Instead of drawing the whole mesh like this,
-- you could also draw individual parts of the mesh
pass:drawPart(model, mesh)
pass:pop()
end
end