QcEntityMotion Struct
Kinematic state of an entity. More...
| Header: | #include <common/physics/QcEntityMotion.h> |
Public Functions
| QcPhysics::MoveResult | step(const QcPhysics::Steering &steering, QcPhysics::BodySize size, const QcBlockAccess &world, double dt) |
| void | stepPlayer(const QcPlayerInput &input, const QcBlockAccess &world, double dt, QcMovement movement) |
Public Variables
Detailed Description
Position is the centre of the bottom face (feet). The steps are the shared physics of server and client (QcPhysics.cpp).
Member Function Documentation
QcPhysics::MoveResult QcEntityMotion::step(const QcPhysics::Steering &steering, QcPhysics::BodySize size, const QcBlockAccess &world, double dt)
Advances any entity by one tick of dt seconds as steering wishes, a body of size among the blocks of world. The caller updates inWater before the call. Returns the move, whose blocked axes a walking creature reads (QcMobBehaviour); other bodies ignore it.
void QcEntityMotion::stepPlayer(const QcPlayerInput &input, const QcBlockAccess &world, double dt, QcMovement movement)
Advances a player by one tick of dt seconds with input among the blocks of world. movement comes from the player's game mode (QcGameModes::Rules::movement): on foot a wish to fly is ignored and a flight ends; NoClip flies through blocks whatever the wish.
Member Variable Documentation
bool QcEntityMotion::climbing
Inside a climbable block (ladder) during the last step.
bool QcEntityMotion::flying
Flying in creative mode (decision E-284): no gravity, up and down with jump and sneak; ends on landing. Only players fly this way; a spectator always flies (decision E-730).
bool QcEntityMotion::inWater
In a liquid, as the caller judged it before step(); stepPlayer() sets it itself from the cell 0.4 m above the feet. For a boat: it floats (QcBoatState).
bool QcEntityMotion::onGround
Standing on the ground after the last step.
QcVec3 QcEntityMotion::position
The feet: the centre of the bottom face.
bool QcEntityMotion::slowed
Inside a block that slows bodies (cobweb) during the last step; breaks a fall like a ladder.
QcVec3 QcEntityMotion::velocity
Velocity in m/s.