QtCraft API C++ classes QML types Handbook

QcEntityMesh Struct

Triangles of all entities of one frame (or of the first-person hand), alpha-tested. More...

Header: #include <clientcore/entitymeshes/QcEntityMesh.h>

Public Functions

void addQuad(const std::array<QcEntityVertex, 4> &corners, bool bothSides = false)
std::span<QcEntityVertex> addQuads(qsizetype count)
QcEntityVertex vertexAt(const QcVec3 &world) const

Public Variables

QList<quint32> indices
QcVec3 origin
QList<QcEntityVertex> vertices

Detailed Description

Vertex positions are relative to origin (decision E-883), which the builder sets before the first vertex near where the mesh lies (the camera, the eye): the floats stay small however far the world reaches, and the renderer places the origin relative to the camera (QcRenderOrigin).

Member Function Documentation

void QcEntityMesh::addQuad(const std::array<QcEntityVertex, 4> &corners, bool bothSides = false)

Appends a quad: its four corners in order and the two triangles 0 1 2 and 0 2 3; bothSides also adds the two facing the other way.

std::span<QcEntityVertex> QcEntityMesh::addQuads(qsizetype count)

Appends count quads at once, each with the triangles of addQuad, and returns their vertices (four per quad, at their defaults) for the caller to fill: the way to add the many quads of one object, valid until the next change of the mesh.

QcEntityVertex QcEntityMesh::vertexAt(const QcVec3 &world) const

Returns a vertex at world relative to origin, subtracted in double; the rest at its defaults.

Member Variable Documentation

QList<quint32> QcEntityMesh::indices

Indices into vertices, three per triangle.

QcVec3 QcEntityMesh::origin

World position the vertex positions are relative to.

QList<QcEntityVertex> QcEntityMesh::vertices

Vertices, positions relative to origin.