QtCraft API C++ classes QML types Handbook

QcBoxLegs Class

The legs of a creature built from static boxes (decision E-888), found in its parts, so every walking creature of the content and of mods swings its legs without naming them: a leg stands on the lowest level of the model and is at least 1.5 times as tall as it is wide and deep; a model needs at least two. More...

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

Public Types

struct Swing
enum class Axis { Pitch, Yaw }

Public Functions

double length() const
double maxSwing() const
const QList<QcBoxLegs::Swing> &swings() const

Static Public Members

const double maxLegYaw
QcBoxLegs of(const QList<QcMobPart> &parts)

Detailed Description

Flat parts on the ground touching a leg (a chicken's feet) move with it. Legs on one side alternate from front to back, and the first leg of the left side swings with the first of the right side in opposite phase, so four legs walk in diagonal pairs.

A leg assembly (decision E-895) is a leg whose top carries a horizontal segment reaching inwards along x to the body (a spider's leg: the segment out from the body and the post down at its outer end). The whole assembly turns around the vertical axis at the body joint (the inner end of the segment) instead of swinging forward: its feet move along the side of the body, like the spiders of the reference game, instead of hitting the next leg after a few degrees.

Member Type Documentation

enum class QcBoxLegs::Axis

The axis a moving part turns around.

ConstantValueDescription
QcBoxLegs::Axis::Pitch0across the body (x): a leg swings forward and back
QcBoxLegs::Axis::Yaw1upright (y): a leg assembly turns along the side of the body

Member Function Documentation

double QcBoxLegs::length() const

Returns the mean height of the legs in model metres; 0 without legs.

double QcBoxLegs::maxSwing() const

Returns the widest swing in degrees at which neighbouring legs of one side, swinging against each other, keep 10 % of the gap between them: QcAnimator::maxLegSwing for most creatures, less for long legs close together (cows, sheep); at most maxLegYaw for a model with leg assemblies (spiders).

[static] QcBoxLegs QcBoxLegs::of(const QList<QcMobPart> &parts)

Returns the legs found in parts.

const QList<QcBoxLegs::Swing> &QcBoxLegs::swings() const

Returns one swing per part, in the order of the parts; empty when the model has no legs.

Member Variable Documentation

const double QcBoxLegs::maxLegYaw

The widest turn of a leg assembly around the vertical axis, in degrees: neighbouring legs of a side turn against each other and may overlap a little at their feet, as in the reference.