QtCraft API C++ classes QML types Handbook

QcStandPose Struct

How an armour stand stands (decision E-238): a rotation per body part and what it shows. More...

Header: #include <common/gameplay/QcStandPose.h>

Public Types

struct Rotation
enum class Part { Head, Body, LeftArm, RightArm, LeftLeg, RightLeg }

Public Functions

QcStandPose::Rotation &at(QcStandPose::Part part)
const QcStandPose::Rotation &at(QcStandPose::Part part) const
quint8 flags() const
QcStandPose normalized() const

Public Variables

bool arms
bool basePlate
std::array<QcStandPose::Rotation, partCount> parts
bool showName
bool small

Static Public Members

const double bodyHeight
const double bodyWidth
std::array<QcStandPose::Rotation, partCount> defaultParts()
const std::size_t partCount
std::optional<QcStandPose::Part> partFromName(const QString &name)
QString partName(QcStandPose::Part part)
QcStandPose withFlags(quint8 flags)
float qcNormalizedAngle(float degrees)

Detailed Description

Kept by the server, sent to every client in EntitySpawn and saved with the world; the commands /armorstand and /summon change it (later also a stand screen).

Member Type Documentation

enum class QcStandPose::Part

The body parts.

ConstantValueDescription
QcStandPose::Part::Head0The head.
QcStandPose::Part::Body1The body.
QcStandPose::Part::LeftArm2The left arm.
QcStandPose::Part::RightArm3The right arm.
QcStandPose::Part::LeftLeg4The left leg.
QcStandPose::Part::RightLeg5The right leg.

Member Function Documentation

QcStandPose::Rotation &QcStandPose::at(QcStandPose::Part part)

Returns the rotation of part to change it.

const QcStandPose::Rotation &QcStandPose::at(QcStandPose::Part part) const

Returns the rotation of part.

[static] std::array<QcStandPose::Rotation, partCount> QcStandPose::defaultParts()

Returns the default pose: arms hanging slightly apart, legs a little spread.

quint8 QcStandPose::flags() const

Returns arms, base plate, size and name display as flag bits, as sent and saved.

QcStandPose QcStandPose::normalized() const

Returns the pose with every angle finite and within (-180, 180]; non-finite angles become 0.

[static] std::optional<QcStandPose::Part> QcStandPose::partFromName(const QString &name)

Returns the part named name; std::nullopt for other names.

[static] QString QcStandPose::partName(QcStandPose::Part part)

Returns the name of part in commands: "head", "body", "left_arm", "right_arm", "left_leg", "right_leg".

[static] QcStandPose QcStandPose::withFlags(quint8 flags)

Returns the default pose with the switches of the bits flags.

Member Variable Documentation

bool QcStandPose::arms

Whether the stand has arms.

bool QcStandPose::basePlate

Whether it stands on a base plate.

const std::size_t QcStandPose::partCount

The number of parts.

std::array<QcStandPose::Rotation, partCount> QcStandPose::parts

The rotation of each part, in the order of Part.

bool QcStandPose::showName

The stand's name floats above it (only when it has one).

bool QcStandPose::small

Whether it is the small stand.

Related Non-Members

float qcNormalizedAngle(float degrees)

Returns the angle degrees normalised into (-180, 180]; non-finite values become 0.