#include <mesh.h>
Contains a list of indices that describe which particular part of the nap::MeshInstance should be drawn. Every nap::MeshInstance contains at least one shape.
◆ addIndex()
Adds a single index to the index CPU buffer. Use setIndices to add an entire list of indices. Call either before init() or call update() to reflect the changes in the GPU buffer.
- Parameters
-
◆ addIndices()
void addIndices |
( |
uint32 * |
indices, |
|
|
int |
numIndices |
|
) |
| |
Adds a number of indices to the existing indices in the index CPU buffer. Use setIndices to replace the current indices with a new set of indices. Call either before init() or call update() to reflect the changes in the GPU buffer.
- Parameters
-
indices | List of indices to update. |
numIndices | Number of indices in the list. |
◆ clearIndices()
Clears the list of indices. Call either before init() or call update() to reflect the changes in the GPU buffer.
◆ getIndices() [1/2]
std::vector<uint32>& getIndices |
( |
| ) |
|
- Returns
- The index list for this shape
◆ getIndices() [2/2]
const std::vector<uint32>& getIndices |
( |
| ) |
const |
- Returns
- The index list for this shape
◆ getNumIndices()
int getNumIndices |
( |
| ) |
const |
- Returns
- The number of indices in this shape
◆ operator[]() [1/2]
uint32& operator[] |
( |
std::size_t |
index | ) |
|
Array subscript overload.
- Parameters
-
- Returns
- value at the given index
◆ operator[]() [2/2]
const uint32& operator[] |
( |
std::size_t |
index | ) |
const |
Const array subscript overload.
- Parameters
-
- Returns
- value at the given index
◆ reserveIndices()
void reserveIndices |
( |
size_t |
numIndices | ) |
|
Reserves CPU memory for index list. GPU memory is reserved after update() is called.
- Parameters
-
numIndices | Amount of indices to reserve. |
◆ setIndices()
void setIndices |
( |
uint32 * |
indices, |
|
|
int |
numIndices |
|
) |
| |
Adds a list of indices to the index CPU buffer. Call either before init() or call update() to reflect the changes in the GPU buffer.
- Parameters
-
indices | array of indices to add. |
numIndices | size of the array. |
◆ mIndices
Property: 'Indices' into the mesh's vertex data.