QtCraft API C++ classes QML types Handbook

QcHandSwing Namespace

The first-person swing (decision E-881): arm and held item move together as one rigid body, nothing bends or turns in the fist. More...

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

Classes

struct Angles
struct Shape

Types

enum class Style { Mining, Click }

Functions

QcHandSwing::Angles at(double progress, QcHandSwing::Style style)
const QcHandSwing::Shape &shapeOf(QcHandSwing::Style style)

Detailed Description

A swing lifts the tool a little (wind-up), strikes from the lower right corner towards the middle of the screen with growing speed (ease-in), stops on the block with a short recoil and settles back to rest. Pure functions of the progress, so the motion is testable.

Classes

class Angles

The turn of arm and item about the shoulder in degrees, in the camera's frame: pitch positive lifts the arm (its forward end up), negative strikes down; yaw positive turns it inwards towards the crosshair; roll positive turns it in the picture's plane, counter-clockwise as seen, so the head of a tool held in the lower right corner comes down and to the left, towards the lower middle of the screen. More...

class Shape

The phases of a swing: the progress at which the wind-up ends (highest point), the strike ends (lowest point, the blow) and the recoil ends, and the pitch at those points. More...

Type Documentation

enum class QcHandSwing::Style

Mining loops the full swing while the button is held; a single click (attack, placing, eating) makes a short one.

ConstantValueDescription
QcHandSwing::Style::Mining0The full swing, looped while the button is held
QcHandSwing::Style::Click1A short swing for a single click

Function Documentation

QcHandSwing::Angles QcHandSwing::at(double progress, QcHandSwing::Style style)

Returns the turn of one swing of style at progress (0..1, clamped). It begins and ends at rest with no speed, so mining's loop of swings runs on without a jerk where one ends and the next begins.

const QcHandSwing::Shape &QcHandSwing::shapeOf(QcHandSwing::Style style)

Returns the phases of a swing of style.