QtCraft API C++ classes QML types Handbook

QcCapeSwing Class

The swing of a cape (decision E-240): a damped spring per axis pulls the cape towards an angle that follows from the movement: lifted backwards by walking and more by sprinting, upwards when falling, pressed to the back when rising or sneaking, held off the swinging legs when walking backwards, swaying gently when standing. More...

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

Public Types

struct Angles

Public Functions

void advance(const QcCapeDrive &drive, double seconds, double time)
QcCapeSwing::Angles angles() const
void settle(const QcCapeDrive &drive, double time)

Static Public Members

const double maxAdvance
const double maxLift
const double maxSway
const double minLift
const double restLift
const double step
QcCapeSwing::Angles target(const QcCapeDrive &drive, double time)

Detailed Description

Integrated in fixed steps, so the result does not depend on the frame rate; GUI-free.

Member Function Documentation

void QcCapeSwing::advance(const QcCapeDrive &drive, double seconds, double time)

Moves the cape seconds further, driven by drive; time is the clock at the end of that span.

QcCapeSwing::Angles QcCapeSwing::angles() const

Returns the cape's current angles.

void QcCapeSwing::settle(const QcCapeDrive &drive, double time)

Puts the cape at rest on its target for drive at time (first sight, fixed screenshots).

[static] QcCapeSwing::Angles QcCapeSwing::target(const QcCapeDrive &drive, double time)

Returns where the spring pulls the cape for drive at time (seconds of a free-running clock, driving the idle sway and the flutter).

Member Variable Documentation

const double QcCapeSwing::maxLift

Highest lift.

const double QcCapeSwing::maxSway

Widest sway to either side.

const double QcCapeSwing::minLift

Lowest lift.

const double QcCapeSwing::restLift

Lift at rest: the cape stands off the back a little.