QtCraft API C++ classes QML types Handbook

QcSwimmerPose Namespace

How a creature that swims in pulses (the squid, QcMobDefinition::pulse, decision E-974) holds its body in one frame: tilted by the pitch the server sends (QcCreature::tilt) about the middle of its height, its tentacles (QcMobPart::tentacle) open as it slows below the speed of a push and pulled in right after one. More...

Header: #include <clientcore/figures/QcSwimmerPose.h>

Classes

struct Look

Functions

std::optional<double> forcedOpening(const QString &forcedPose)
QcSwimmerPose::Look of(const QcMobDefinition &definition, const QcClientEntity &entity, double alpha, double seconds, std::optional<double> forced)
double opening(double speed, double pushSpeed, double seconds, double phase)

Detailed Description

The opening follows the creature's speed over the last tick, so a push closes the tentacles and the glide opens them again without a clock shared with the server; a slow sway keeps a resting one alive.

Classes

class Look

The pose of one frame: the tilt in degrees (0 upright, 90 lying along its yaw) about the point height metres above the feet, and the spread of the tentacles in degrees. More...

Function Documentation

std::optional<double> QcSwimmerPose::forcedOpening(const QString &forcedPose)

Returns the share (0..1) of the tentacles' opening that the screenshot hook --pose pulse:<0..1> in forcedPose holds; nothing for any other pose.

QcSwimmerPose::Look QcSwimmerPose::of(const QcMobDefinition &definition, const QcClientEntity &entity, double alpha, double seconds, std::optional<double> forced)

Returns the pose of entity, of the kind definition (which swims in pulses), at alpha between the last two ticks and the animation clock seconds, with the tentacles held at forced (forcedOpening()) when given.

double QcSwimmerPose::opening(double speed, double pushSpeed, double seconds, double phase)

Returns the opening (0 pulled in, 1 fully open) of a swimmer moving at speed m/s whose push reaches pushSpeed, swaying by the animation clock seconds with the phase phase. Pure.