QtCraft API C++ classes QML types Handbook

QcMeshOutput Struct

Vertex and index lists of one render layer of a chunk mesh, which the chunk mesher appends its quads to. More...

Header: #include <clientcore/meshing/QcMeshOutput.h>

Public Types

enum class Run { Water, OtherTranslucent }

Public Functions

void appendCross(const QcBlockRenderTable::Cross &cross, QcBlockPos local, QcQuadLight light, QcSurfaceMaterial material) const
void appendQuad(const std::array<QcBlockVertex, 4> &corners, bool flipDiagonal, QcQuadSurface surface) const

Public Variables

QList<quint32> &indices
QcMeshOutput::Run run
QList<quint32> *runs
QList<QcBlockVertex> &vertices

Detailed Description

Water and the other translucent faces also note the order in which they alternate (QcChunkMesh::translucentRuns).

Member Type Documentation

enum class QcMeshOutput::Run

The runs a layer's faces belong to; the value is the parity of their runs in QcChunkMesh::translucentRuns (water first).

ConstantValueDescription
QcMeshOutput::Run::Water0Faces of translucent water.
QcMeshOutput::Run::OtherTranslucent1Every other translucent face.

Member Function Documentation

void QcMeshOutput::appendCross(const QcBlockRenderTable::Cross &cross, QcBlockPos local, QcQuadLight light, QcSurfaceMaterial material) const

Appends two quads along the diagonals of cross in the cell whose corner lies at local in the section, each with a front and a back side so back-face culling keeps both visible, lit by light. Without a normal; plants unless material says more (light sources).

void QcMeshOutput::appendQuad(const std::array<QcBlockVertex, 4> &corners, bool flipDiagonal, QcQuadSurface surface) const

Appends the quad corners with surface written into each vertex. Its two triangles meet along the diagonal from corner 0 to 2, or from 1 to 3 when flipDiagonal is set.

Member Variable Documentation

QList<quint32> &QcMeshOutput::indices

The triangle indices of the layer.

QcMeshOutput::Run QcMeshOutput::run

The kind of run the quads belong to (with runs only).

QList<quint32> *QcMeshOutput::runs

The translucent runs to note the quads in, or null for a layer without them.

QList<QcBlockVertex> &QcMeshOutput::vertices

The vertices of the layer.