QtCraft API C++ classes QML types Handbook

QcBoatState Struct

A boat as it moves (decision E-920), the shared physics of the server (every boat, authoritative) and the client (the prediction of the own boat): its feet, velocity and contact (motion.inWater: it floats), the direction it points to and how fast it turns. More...

Header: #include <common/physics/QcBoatMotion.h>

Public Functions

void step(const std::optional<QcBoatControls> &controls, const QcBlockAccess &world)

Public Variables

QcEntityMotion motion
float spin
float yaw

Detailed Description

Units like QcPhysics: metres, seconds, m/s; the yaw in degrees and the turn in degrees per tick.

Member Function Documentation

void QcBoatState::step(const std::optional<QcBoatControls> &controls, const QcBlockAccess &world)

One tick of 1/20 s: the boat keeps a share of its speed and its turn (on water and in the air most of it, on land that of the ground's slipperiness: little on grass, nearly all on ice), the driver's controls (none without a driver) paddle and turn it, it floats on water and falls without it, and moves, stopped by the blocks of world.

Member Variable Documentation

QcEntityMotion QcBoatState::motion

Its feet, velocity and contact.

float QcBoatState::spin

How fast it turns, in degrees per tick.

float QcBoatState::yaw

The direction it points to, in degrees.