QtCraft API C++ classes QML types Handbook

QcLabelProjector Class

Picks the world labels to draw (decision E-222): those within reach of the camera (titles from further away), in front of it and not hidden behind an opaque full block, at most maxShown of the nearest. More...

Header: #include <clientcore/camera/QcLabelProjector.h>

Public Types

struct View

Static Public Members

const double headingReach
bool isHidden(const QcBlockAccess &world, const QcVec3 &eye, const QcVec3 &point)
const double labelReach
const double labelSpacing
const int maxShown
const int maxSightRays
QList<QcScreenLabel> visible(const QHash<QcChunkPos, QList<QcWorldLabel>> &labels, const QcLabelProjector::View &view, const QcBlockAccess *world)

Detailed Description

At most maxSightRays lines of sight are followed per frame, nearest labels first; labels beyond that budget are not drawn this frame. They come back farthest first, so that nearer labels are drawn over farther ones; near labels are larger, labels fade out towards the end of their reach. GUI-free and deterministic.

Member Function Documentation

[static] bool QcLabelProjector::isHidden(const QcBlockAccess &world, const QcVec3 &eye, const QcVec3 &point)

Returns whether an opaque full block of world lies between eye and point; transparent blocks on the way (glass, panes, leaves) do not stop the search.

[static] QList<QcScreenLabel> QcLabelProjector::visible(const QHash<QcChunkPos, QList<QcWorldLabel>> &labels, const QcLabelProjector::View &view, const QcBlockAccess *world)

Returns the labels of the loaded chunks to draw for view, farthest first. world decides what hides a label; without one nothing does.

Member Variable Documentation

const double QcLabelProjector::headingReach

Metres within which a title shows.

const double QcLabelProjector::labelReach

Metres within which a label shows.

const double QcLabelProjector::labelSpacing

Labels of neighbouring podiums stand 2 m apart; a label is at most this wide in the world.

const int QcLabelProjector::maxShown

Labels drawn at most per frame.

const int QcLabelProjector::maxSightRays

Lines of sight followed at most per frame.