QtCraft API C++ classes QML types Handbook

QcPathTerrain Namespace

Standing and passing on the cells of a source with quint8 cell(QcBlockPos) and QcPathGap gap(QcBlockPos) (the cached window of QcPathWindow, or the world directly through QcPathDirectCells). More...

Header: #include <server/pathing/QcPathTerrain.h>

Classes

struct QcPathAbove

Functions

QcPathTerrain::QcPathAbove aboveFeet(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)
bool bodyClimbs(Cells &cells, QcBlockPos feet, QcPathRules rules)
bool bodyRoom(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)
bool clearAbove(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)
QcVec3 climbPoint(QcPathDirectCells cells, QcBlockPos node, QcPathRules rules)
bool climbsAt(Cells &cells, QcBlockPos feet, QcPathRules rules)
bool clingsOnly(QcPathDirectCells cells, QcBlockPos node, QcPathRules rules)
bool crossesPanel(Cells &cells, QcBlockPos from, QcBlockPos to, double lift, QcPathRules rules)
bool deepWater(Cells &cells, QcBlockPos cell)
bool everyColumn(QcBlockPos feet, QcPathRules rules, const Test &test)
bool fallsThrough(Cells &cells, QcBlockPos feet, QcPathRules rules)
QcPathStand floorAt(Cells &cells, QcBlockPos feet, QcPathRules rules)
bool holdsOn(Cells &cells, QcBlockPos feet)
QcPathCell::Kind kindOf(quint8 cell, QcPathRules rules)
QcBlockPos nodeOf(const QcVec3 &position, QcPathRules rules)
bool passable(Cells &cells, QcBlockPos pos, QcPathRules rules, bool feet)
bool passableCell(Cells &cells, QcBlockPos pos, quint8 cell, QcPathRules rules, bool feet)
QcVec3 pointOf(QcBlockPos node, QcPathRules rules)
QcPathTerrain::QcPathAbove roomAbove(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)
QcPathTerrain::QcPathAbove roomAt(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)
bool safeLanding(Cells &cells, QcBlockPos landing, int drop, QcPathRules rules)
QcPathStand standAt(Cells &cells, QcBlockPos feet, QcPathRules rules)

Detailed Description

Classes

class QcPathAbove

The cells of the body above the feet cell up to the top of a body standing lift high: whether they are free (clear) and whether one of them has a panel. More...

Function Documentation

template <typename Cells> QcPathTerrain::QcPathAbove QcPathTerrain::aboveFeet(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)

Returns the cells of cells above the feet cell feet of a body standing lift high under rules.

template <typename Cells> bool QcPathTerrain::bodyClimbs(Cells &cells, QcBlockPos feet, QcPathRules rules)

Returns whether a creature under rules with its feet cell at feet holds on in one of the columns of its body like on a ladder (cells).

template <typename Cells> bool QcPathTerrain::bodyRoom(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)

Returns whether cells have room for the body under rules standing lift high with its feet cell at feet: in every column the feet's cell and the cells above it up to the body's top (a body wider than a block fills four columns).

template <typename Cells> bool QcPathTerrain::clearAbove(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)

Returns whether the cells of cells of the body under rules above the feet cell feet are free up to the top of a body standing lift high.

QcVec3 QcPathTerrain::climbPoint(QcPathDirectCells cells, QcBlockPos node, QcPathRules rules)

Returns the point a wall climber under rules wider than a block goes up or down at in cells with its feet cell at node: pointOf, moved by the room its columns leave beside its body towards a solid block beside them, at its feet or a block above. In the middle of its columns a spider or a golem is farther from the wall than it reaches (QcPhysics::clingReach), touching the wall it holds on (decision E-909).

template <typename Cells> bool QcPathTerrain::climbsAt(Cells &cells, QcBlockPos feet, QcPathRules rules)

Returns whether a creature under rules holds on in feet of cells like on a ladder: a ladder it climbs, or a wall beside a wall climber.

bool QcPathTerrain::clingsOnly(QcPathDirectCells cells, QcBlockPos node, QcPathRules rules)

Returns whether a body under rules with its feet cell at node of cells is held there only by clinging to a wall: no floor (a solid block below, a low block, water) in any of its columns.

template <typename Cells> bool QcPathTerrain::crossesPanel(Cells &cells, QcBlockPos from, QcBlockPos to, double lift, QcPathRules rules)

Returns whether a step of a body under rules from the feet cell from to the cell to of cells beside it (on any level) goes through a side of a cell that a panel covers, in the column it leaves or the one it enters, at any level the body passes standing at most lift high (the leaf of a free-standing open door is not walked through).

template <typename Cells> bool QcPathTerrain::deepWater(Cells &cells, QcBlockPos cell)

Returns whether cells hold water at least two blocks deep from cell down: a fall of any height into it is safe.

template <typename Test> bool QcPathTerrain::everyColumn(QcBlockPos feet, QcPathRules rules, const Test &test)

Returns whether test holds for every column of the body standing with its feet cell at feet under rules (QcPathRules::footprint), given the cell of each column at the feet's level.

template <typename Cells> bool QcPathTerrain::fallsThrough(Cells &cells, QcBlockPos feet, QcPathRules rules)

Returns whether a falling body under rules passes the level of feet in cells in every column.

template <typename Cells> QcPathStand QcPathTerrain::floorAt(Cells &cells, QcBlockPos feet, QcPathRules rules)

Returns the floor of the column of feet in cells for a body under rules standing in its cell (a floor below, a low block in the cell on something that carries it, the surface of water or a ladder it holds on to), without looking at the room for the body; not ok without one.

template <typename Cells> bool QcPathTerrain::holdsOn(Cells &cells, QcBlockPos feet)

Returns whether a wall climber holds on in feet of cells: a solid block beside the cell or beside the cell above (the face of an overhang its body reaches, QcPhysics::clingsToWall).

QcPathCell::Kind QcPathTerrain::kindOf(quint8 cell, QcPathRules rules)

Returns the kind of cell to a creature under rules: a ladder is open like air to one that does not climb.

QcBlockPos QcPathTerrain::nodeOf(const QcVec3 &position, QcPathRules rules)

Returns the feet cell of a body under rules standing at position (decision E-909): the cell containing it, for a body wider than a block the corner cell of its columns (QcPathRules::footprint).

template <typename Cells> bool QcPathTerrain::passable(Cells &cells, QcBlockPos pos, QcPathRules rules, bool feet)

Returns whether a body part may be in the cell at pos of cells under rules, the feet or another part (passableCell()).

template <typename Cells> bool QcPathTerrain::passableCell(Cells &cells, QcBlockPos pos, quint8 cell, QcPathRules rules, bool feet)

Returns whether a body part under rules (the feet or another) may be in the cell cell at pos of cells: open, water, a door the creature opens; the feet also on a low block. A cell above a fence is blocked by the fence's box. An open door or trapdoor only if the body fits through beside its panel (decision E-909): cows, sheep, slimes and wider ones do not.

QcVec3 QcPathTerrain::pointOf(QcBlockPos node, QcPathRules rules)

Returns the point a body under rules with its feet cell at node walks to: the middle of its columns at the cell's bottom.

template <typename Cells> QcPathTerrain::QcPathAbove QcPathTerrain::roomAbove(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)

Returns the room in cells above the level of feet in every column of the body under rules up to the top of a body lift high (to jump up a block), and a panel there (bodies at most a block wide).

template <typename Cells> QcPathTerrain::QcPathAbove QcPathTerrain::roomAt(Cells &cells, QcBlockPos feet, double lift, QcPathRules rules)

Returns the room in cells for the body under rules standing lift high with its feet cell at feet (bodyRoom), and a panel in a cell of it (bodies at most a block wide).

template <typename Cells> bool QcPathTerrain::safeLanding(Cells &cells, QcBlockPos landing, int drop, QcPathRules rules)

Returns whether a body under rules that falls drop blocks into landing of cells, a cell it can stand in, lands safely: at most QcPathRules::maxDrop, or into deep water (QcPathRules::divesIntoWater).

template <typename Cells> QcPathStand QcPathTerrain::standAt(Cells &cells, QcBlockPos feet, QcPathRules rules)

Returns how the creature under rules stands in cells with its feet cell at feet: ok when it has a floor (floorAt) and room for the body. A body wider than a block (decision E-909) stands on the highest floor of its columns (it overhangs the others, as in the physics) and needs room in all of them.