MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / Mesh

Class Mesh

shared/scene/VtxData.h:14–45  ·  view source on GitHub ↗

All offsets are relative to the beginning of the data block (excluding headers with Mesh list)

Source from the content-addressed store, hash-verified

12
13// All offsets are relative to the beginning of the data block (excluding headers with Mesh list)
14struct Mesh final
15{
16 /* Number of LODs in this mesh. Strictly less than MAX_LODS, last LOD offset is used as a marker only */
17 uint32_t lodCount = 1;
18
19 /* Number of vertex data streams */
20 uint32_t streamCount = 0;
21
22 /* The total count of all previous vertices in this mesh file */
23 uint32_t indexOffset = 0;
24
25 uint32_t vertexOffset = 0;
26
27 /* Vertex count (for all LODs) */
28 uint32_t vertexCount = 0;
29
30 /* Offsets to LOD data. Last offset is used as a marker to calculate the size */
31 uint32_t lodOffset[kMaxLODs] = { 0 };
32
33 inline uint32_t getLODIndicesCount(uint32_t lod) const { return lodOffset[lod + 1] - lodOffset[lod]; }
34
35 /* All the data "pointers" for all the streams */
36 uint32_t streamOffset[kMaxStreams] = { 0 };
37
38 /* Information about stream element (size pretty much defines everything else, the "semantics" is defined by the shader) */
39 uint32_t streamElementSize[kMaxStreams] = { 0 };
40
41 /* We could have included the streamStride[] array here to allow interleaved storage of attributes.
42 For this book we assume tightly-packed (non-interleaved) vertex attribute streams */
43
44 /* Additional information, like mesh name, can be added here */
45};
46
47struct MeshFileHeader
48{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected