QcHangingMesher Namespace
Draws item frames and paintings (decisions E-790, E-791): a frame as a thin board in its item's texture with the held item in front, turned by its rotation (a block item as a small cube, any other item flat); a painting as one picture tile per block (QcPaintingMotif::tileTexture) on a board whose back and edges show its back texture. More...
| Header: | #include <clientcore/entitymeshes/QcHangingMesher.h> |
Functions
| void | append(QcEntityMesh &mesh, const QcClientEntity &entity, const QcContentRegistry &content, QcEntityLight light, const QcEntityMesher::UvLookup &uv) |
| void | appendFramedMap(QcEntityMesh &mesh, const QcHanging &hanging, const QRectF &uv, QcEntityLight light) |
| std::optional<quint32> | framedMap(const QcClientEntity &entity, const QcContentRegistry &content) |
| int | mapQuarterTurns(int rotation) |
Detailed Description
A frame holding a filled map (decision E-806) grows to the whole face like in the reference: append() draws only its edges, and the map lies on its front as one quad of the framed-map texture (appendFramedMap, QcFramedMapAtlas), so maps in neighbouring frames meet without a gap.
Function Documentation
void QcHangingMesher::append(QcEntityMesh &mesh, const QcClientEntity &entity, const QcContentRegistry &content, QcEntityLight light, const QcEntityMesher::UvLookup &uv)
Appends the item frame or painting entity to mesh (items of content), in light, with textures from uv; a frame holding a filled map gets only its edges.
void QcHangingMesher::appendFramedMap(QcEntityMesh &mesh, const QcHanging &hanging, const QRectF &uv, QcEntityLight light)
Appends to mesh, in light, the map of the frame hanging on the whole face at the front of its edges: uv is its tile in the framed-map texture, turned by mapQuarterTurns(hanging.rotation). The picture's north is up on a wall.
std::optional<quint32> QcHangingMesher::framedMap(const QcClientEntity &entity, const QcContentRegistry &content)
Returns the id of the filled map the item frame entity shows (items of content); unset for anything else.
[constexpr] int QcHangingMesher::mapQuarterTurns(int rotation)
Returns the quarter turns clockwise (as seen from the front) that a map in a frame at rotation (eighths) shows: a map turns 90 degrees per step, so the eight steps show four orientations (the reference).