QcOpeningSteering Namespace
How creatures go through open doors and trapdoors (decision E-905), part of QcMobNavigator: a panel standing in a cell (an open door's leaf is 3/16 block thick) leaves a 0.6-wide body only 1.25 cm beside it at the cell's middle, so the creature steers to the middle of the free opening beside the panel (QcPathGap) instead, and keeps to it as long as its body overlaps the cell. More...
| Header: | #include <server/pathing/QcOpeningSteering.h> |
Classes
Variables
| const double | laneTolerance |
| const double | lookAhead |
Functions
| QcVec3 | aimAt(const QcCreature &mob, const QcOpeningSteering::Target &target) |
| QcPathGap | gapAt(QcBlockPos cell, const QcPathGround &ground) |
| QcPhysics::Steering | lineUp(const QcCreature &mob, const QcOpeningSteering::Point &point, QcPhysics::Steering steering) |
| QcOpeningSteering::Target | target(const QcCreature &mob, const QcOpeningSteering::Point &point, const QcPathGround &ground) |
| QcOpeningSteering::Point | waypointPoint(const QcMobPath &path, std::size_t index, const QcPathGround &ground) |
Detailed Description
Classes
class Lane
Where the creature may go across the way, per horizontal axis, in world coordinates: within the openings of the doors its body overlaps and of its next waypoint; none along a free axis. More...
class Point
The point of a waypoint: the middle of its cell (of the body's columns, QcPathTerrain::pointOf, and for a wide wall climber going up or down at the wall, QcPathTerrain::climbPoint), moved to the middle of the opening along the axes the gap it keeps to narrows (gap: the gap of its cell where the path goes through along the panel, else across the line of the path that of the waypoint just before or after it in line); for a waypoint right before or after a door (narrowed only by its neighbour in line), the axes it lines the creature up along. More...
class Span
A stretch along one horizontal axis in world coordinates. More...
class Target
What the creature steers to for its next waypoint this tick: the waypoint's point (arrival and progress are measured to it) and the lane its body keeps to on the way. More...
Variable Documentation
const double QcOpeningSteering::laneTolerance
How far across the line through an opening a creature may be and have reached its waypoint.
const double QcOpeningSteering::lookAhead
How far ahead along the lane a creature heads while it lines up with the opening: one off the lane halves its distance to it about every sixth of a block.
Function Documentation
QcVec3 QcOpeningSteering::aimAt(const QcCreature &mob, const QcOpeningSteering::Target &target)
Returns where mob heads for target: along a lane narrowed on one axis, onto the lane's middle at most lookAhead ahead along the other (one coming in off the line lines up before it reaches the panel); otherwise the point, moved to the middles of the lane.
QcPathGap QcOpeningSteering::gapAt(QcBlockPos cell, const QcPathGround &ground)
Returns the gap of the cells a body of the creature's height fills standing in cell on ground.
QcPhysics::Steering QcOpeningSteering::lineUp(const QcCreature &mob, const QcOpeningSteering::Point &point, QcPhysics::Steering steering)
Returns steering of mob towards the waypoint point that lines the creature up: across the line, at most as fast as reaches the line in one tick (a fast creature would otherwise step across it and back forever).
QcOpeningSteering::Target QcOpeningSteering::target(const QcCreature &mob, const QcOpeningSteering::Point &point, const QcPathGround &ground)
Returns the target of mob on ground for the next waypoint, whose point is point: the lane is the point's gap within the gaps of the cells near it on the path that the creature's body overlaps, so it does not slide into a leaf it is still beside (a next door hinged on the other side, a turn).
QcOpeningSteering::Point QcOpeningSteering::waypointPoint(const QcMobPath &path, std::size_t index, const QcPathGround &ground)
Returns the point of the waypoint index of path on ground.