QcPushBodies Class
The creatures whose bodies push the local player (decision E-882), as the tick core of the session knows them (QcSessionCore): the latest place and pose the server sent for each, not the interpolated past the entity mirror shows (QcClientEntities). The server pushes the player with the creatures as they stand after its last tick when their input arrives; the client's newest places are about a round trip older than that. So each creature is moved on along its last step (its move between the last two places the server sent; it sends every visible creature in every tick) for as many ticks as the input leads, at most maxLeadTicks and maxLead: for creatures that stand still the prediction pushes exactly as the server does, for walking ones it misses only by how much their step changed during the round trip. More...
| Header: | #include <clientcore/player/QcPushBodies.h> |
Public Functions
| void | apply(const QcMessage &message) |
| QcVec3 | pushOnPlayer(const QcVec3 &feet, const QcContentRegistry &content, int leadTicks) const |
Static Public Members
| bool | extrapolationWanted() |
| const double | maxLead |
| const int | maxLeadTicks |
Detailed Description
Member Function Documentation
void QcPushBodies::apply(const QcMessage &message)
Takes over the spawns, moves and removals of creatures in message; ignores every other message.
[static] bool QcPushBodies::extrapolationWanted()
Returns whether the session moves the creatures on at all: not with the environment variable QTCRAFT_PUSH_EXTRAPOLATION=0 (to measure what it saves, test_push_client).
QcVec3 QcPushBodies::pushOnPlayer(const QcVec3 &feet, const QcContentRegistry &content, int leadTicks) const
Returns the push on the local player with their feet at feet (a velocity, QcBodyPush::playerVelocity) from the creatures known, with their sizes from content, each moved on along its last step for leadTicks (how many ticks the input is ahead of the creatures the server sent last).