QcPackedMesh Struct
The lists of a section mesh (QcChunkMesh) packed for the GPU into one vertex and one index range (decision E-813), which the GPU mesh store places in a page shared with other sections (decision E-820). More...
| Header: | #include <clientcore/meshing/QcPackedMesh.h> |
Public Types
Public Functions
Public Variables
Static Public Members
| const int | indexAlignment |
| const int | listCount |
| QcPackedMesh | pack(const QcChunkMesh &mesh) |
Detailed Description
A list's indices stay relative to its own first vertex (a draw takes that vertex as base vertex, or binds the vertex buffer at the list's offset); they take two bytes when the list has at most 65536 vertices (QcIndexPacking), otherwise four, and every list starts at a multiple of four bytes in the index data (padding bytes are zero).
Member Type Documentation
enum class QcPackedMesh::List
One list of a section mesh, in the order of the packed data.
| Constant | Value | Description |
|---|---|---|
QcPackedMesh::List::Opaque | 0 | QcChunkMesh::opaqueVertices |
QcPackedMesh::List::Cutout | 1 | QcChunkMesh::cutoutVertices |
QcPackedMesh::List::Translucent | 2 | QcChunkMesh::translucentVertices |
QcPackedMesh::List::Water | 3 | QcChunkMesh::waterVertices |
QcPackedMesh::List::Underside | 4 | QcChunkMesh::undersideVertices |
Member Function Documentation
bool QcPackedMesh::isEmpty() const
Returns whether no list has an index.
[static] QcPackedMesh QcPackedMesh::pack(const QcChunkMesh &mesh)
Returns mesh packed into one vertex and one index range.
const QcPackedMesh::Place &QcPackedMesh::place(QcPackedMesh::List list) const
Returns where list lies in the packed data.
Member Variable Documentation
const int QcPackedMesh::indexAlignment
Every list starts at a multiple of this many bytes in the index data.
QByteArray QcPackedMesh::indices
Index data of all lists, each list aligned to indexAlignment.
const int QcPackedMesh::listCount
Number of lists.
std::array<QcPackedMesh::Place, listCount> QcPackedMesh::places
Where each list lies, indexed by List.
QByteArray QcPackedMesh::vertices
Vertex data of all lists (QcBlockVertex).