Umbra::MeshData class

Data for creating a mesh.

Constructors, destructors, conversion operators

MeshData()

Public functions

auto getVertexAttributes(void* dst, uint32_t dstSize, uint32_t stride, VertexAttribute attr, bool uncachedMemory = false) const -> bool pure virtual
Unpack mesh vertex attributes.
auto getIndices(void* dst, uint32_t dstSize, uint32_t stride, bool uncachedMemory = false) const -> bool pure virtual
Unpack mesh vertex indices.

Public variables

UserPointer material
The UserPointer set in AssetJob::finish.
uint32_t vertexCount
Number of vertices in mesh.
uint32_t indexCount
Number of indices in mesh.
uint32_t attributes
Bitmask of VertexAttribute bits indicating available attributes.
uint32_t indexBytes
Size of a vertex index in bytes: 2 for short, 4 for int.

Function details

bool Umbra::MeshData::getVertexAttributes(void* dst, uint32_t dstSize, uint32_t stride, VertexAttribute attr, bool uncachedMemory = false) const pure virtual

Unpack mesh vertex attributes.

Parameters
dst Destination buffer
dstSize Destination buffer size. This function will fail if the buffer is not large enough for the output data.
stride Offset from beginning of an element to the beginning of the next element. This function will fail if stride is smaller than the element size
attr Type of vertex attribute to fetch. This also determines the output element type (vec2 or vec3)
uncachedMemory Should reads/writes to the destination buffer be considered 'slow'. Set this if the destination buffer is, for example, mapped GPU memory. Setting this prevents some internal optimizations.
Returns true if operation succeeded. This operation may fail if input parameters are invalid or the mesh data is corrupt

bool Umbra::MeshData::getIndices(void* dst, uint32_t dstSize, uint32_t stride, bool uncachedMemory = false) const pure virtual

Unpack mesh vertex indices.

Parameters
dst Destination buffer
dstSize Destination buffer size. This function will fail if the buffer is not large enough for the output data.
stride Offset from beginning of an element to the beginning of the next element. This function will fail if stride is smaller than the element size
uncachedMemory Should reads/writes to the destination buffer be considered 'slow'. Set this if the destination buffer is, for example, mapped GPU memory. Setting this prevents some internal optimizations.
Returns true if operation succeeded. This operation may fail if input parameters are invalid or the mesh data is corrupt