QtCraft API C++ classes QML types Handbook

QcEntityCulling Namespace

Which entities a frame builds (decision E-862): only those whose box may show in the camera's view. More...

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

Classes

struct ViewPlanes

Variables

const float farPlane
const double margin

Functions

bool mayBeSeen(const std::optional<QcEntityCulling::ViewPlanes> &planes, const QcAabb &box)
QcAabb viewBox(const QcClientEntity &entity, const QcContentRegistry &content)
std::optional<QcEntityCulling::ViewPlanes> viewPlanes(const QcCamera &camera, double width, double height)

Detailed Description

The entity meshes are built on the GUI thread every frame, so an entity behind the camera or beside the view costs nothing.

Classes

class ViewPlanes

The clip planes of a camera, for boxes relative to its eye (decision E-883). More...

Variable Documentation

const float QcEntityCulling::farPlane

The far plane of the culling planes lies beyond any entity the server sends; only the sides and the near plane cull.

const double QcEntityCulling::margin

Held items reach about a metre beyond a body, a cape or a flame a little less; the margin also covers the frame's interpolation.

Function Documentation

bool QcEntityCulling::mayBeSeen(const std::optional<QcEntityCulling::ViewPlanes> &planes, const QcAabb &box)

Returns whether box may show: always without planes, else unless it lies outside one of them.

QcAabb QcEntityCulling::viewBox(const QcClientEntity &entity, const QcContentRegistry &content)

Returns the box entity may be drawn in this frame: its body (the creature's size in content, else 1 x 2 m) around its feet at the start and at the end of the client tick, grown by margin; for an item frame or a painting its box on the wall, grown by margin.

std::optional<QcEntityCulling::ViewPlanes> QcEntityCulling::viewPlanes(const QcCamera &camera, double width, double height)

Returns the clip planes of camera for a view of width x height; none for a view without a size (then every entity is built).