QtCraft API C++ classes QML types Handbook

QcBoatMotion Namespace

The rules of the boat's movement, in the units of the role model where they come from it (blocks per tick) converted to m/s. More...

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

Variables

const double draft
const double liquidSurfaceDrop
const double maxSpeed
const double paddleForward
const double turnPush

Functions

QcAabb boxAt(const QcVec3 &feet)
std::optional<double> waterSurfaceAt(const QcBlockAccess &world, QcBlockPos pos)
std::optional<double> waterSurfaceIn(const QcBlockAccess &world, const QcAabb &box)

Detailed Description

Variable Documentation

const double QcBoatMotion::draft

A floating boat's feet lie this far below the water surface; its floor stays above it.

const double QcBoatMotion::liquidSurfaceDrop

How far below the top of its cell a liquid's surface lies at its source (the same as the drawn surface, QcBlockRenderTable::liquidSurfaceDrop).

const double QcBoatMotion::maxSpeed

No boat goes faster horizontally, also on the most slippery ice.

const double QcBoatMotion::paddleForward

Velocity the forward key adds per tick at full press (0.04 blocks per tick per tick in the role model), after the boat kept its share: on water it reaches 8 m/s, on grass 2 m/s, on packed ice it would reach 40 m/s (maxSpeed).

const double QcBoatMotion::turnPush

Degrees per tick the turn grows per tick of a full press: on water the boat turns at most 10 degrees per tick (200 degrees per second), on grass 2.5.

Function Documentation

QcAabb QcBoatMotion::boxAt(const QcVec3 &feet)

Returns the box of a boat with its feet at feet.

std::optional<double> QcBoatMotion::waterSurfaceAt(const QcBlockAccess &world, QcBlockPos pos)

Returns the height of the water surface in the cell pos of world: falls with the flow's level, nearly full at a source, full under more water that does not fall; nothing for other blocks and for falling water (a waterfall carries no boat).

std::optional<double> QcBoatMotion::waterSurfaceIn(const QcBlockAccess &world, const QcAabb &box)

Returns the highest water surface (waterSurfaceAt) of the cells of world that box overlaps; nothing without water.