QtCraft API C++ classes QML types Handbook

QcHurtTilt Namespace

The view of a hurt player tips away from the hit and back (decision E-971), like the reference's damage tilt. More...

Header: #include <clientcore/camera/QcHurtTilt.h>

Classes

struct Tilt

Variables

const double maxDegrees

Functions

QcHurtTilt::Tilt at(double progress, std::optional<double> fromYaw)
double strength(double progress)

Detailed Description

The tilt rises within a tick or two and eases back over the rest of the hurt time. A hit from the front tips the view up, one from a side rolls it away from that side, a hit without a direction (a fall, fire) rolls it.

Classes

class Tilt

How far the view tips: pitch up and roll clockwise (the head leaning to the right), in degrees. More...

Variable Documentation

const double QcHurtTilt::maxDegrees

The largest tilt in degrees.

Function Documentation

QcHurtTilt::Tilt QcHurtTilt::at(double progress, std::optional<double> fromYaw)

Returns the tilt at progress through the hurt time (0 at the hit, 1 at its end; none outside) for a hit from fromYaw degrees relative to the view (0 in front, 90 to the right; none for a hit without a direction).

double QcHurtTilt::strength(double progress)

Returns the strength of the tilt at progress through the hurt time, 0..1: the reference's sin(π (1 - progress)⁴), 0 outside [0, 1].