Available since LÖVE 0.9.0 |
This function is not supported in earlier versions. |
Replaces a range of vertices in the Mesh with new ones. The total number of vertices in a Mesh cannot be changed after it has been created. This is often more efficient than calling Mesh:setVertex in a loop.
Available since LÖVE 0.10.0 |
This variant is not supported in earlier versions. |
Mesh:setVertices( vertices, startvertex )
table vertices
{vertex, ...}
where each vertex is a table in the form of {attributecomponent, ...}
.
number attributecomponent
number ...
number startvertex (1)
Nothing.
The values in each vertex table are in the same order as the vertex attributes in the Mesh's vertex format. A standard Mesh that wasn't created with a custom vertex format will use two position numbers, two texture coordinate numbers, and four color components per vertex: x, y, u, v, r, g, b, a.
If no value is supplied for a specific vertex attribute component, it will be set to a default value of 0 if its data type is "float", or 255 if its data type is "byte".
Available since LÖVE 0.10.0 |
This variant is not supported in earlier versions. |
Sets the vertex components of the Mesh by copying directly from the memory of a Data object.
Mesh:setVertices( data, startvertex )
Data data
number startvertex (1)
Nothing.
If LuaJIT's FFI is used to populate the Data object via Data:getPointer and ffi.cast, this variant can be drastically more efficient than other methods of setting Mesh vertex data.
Sets the vertex components of a Mesh that wasn't created with a custom vertex format.
Mesh:setVertices( vertices )
table vertices
number [1]
number [2]
number [3]
number [4]
number [5] (1)
number [6] (1)
number [7] (1)
number [8] (1)
Nothing.