QtCraft API C++ classes QML types Handbook

QcShapeDefinition Struct

Block geometry from data. More...

Header: #include <common/content/blocks/QcShapeDefinition.h>

Public Functions

int boxCount() const
bool isEmpty() const

Public Variables

QString flip
bool lockTextures
QString name
QList<QcShapePart> parts
QString rotate
QString spin

Static Public Members

const int maxBoxes
const int maxBoxesPerPart
const double maxCollisionHeight
const int maxConditions
const int maxParts

Detailed Description

A shape without parts is the full cube. Parts are authored for a block facing north and standing on the floor: rotate names a property whose value north, east, south or west turns the shape about the vertical axis, flip a property whose value "top" mirrors it upside down. spin names a property with the values 0..15 that turns the shape in steps of 22.5° about the vertical axis (standing signs, decision E-766): the boxes (collision, targeting) turn by whole quarters, the drawn faces by the rest as well (QcBlockState::fineTurns).

Member Function Documentation

int QcShapeDefinition::boxCount() const

Returns the number of boxes, crossed regions, collision and target boxes of all parts.

bool QcShapeDefinition::isEmpty() const

Returns whether the shape has no parts, which makes it the full cube.

Member Variable Documentation

QString QcShapeDefinition::flip

State property whose value "top" mirrors the shape upside down ("flip"); empty for none.

bool QcShapeDefinition::lockTextures

Whether the textures of its faces stay as on the world's faces whatever rotate turns (building parts, so boards and brick courses line up with the full blocks beside them, like the reference's uvlock); directional shapes (repeaters, observers, beds) turn theirs (E-874).

const int QcShapeDefinition::maxBoxes

Boxes, crossed regions, collision and target boxes of all parts together (boxCount()).

const int QcShapeDefinition::maxBoxesPerPart

Most entries of each box list (boxes, crosses, collision, target) of one part.

const double QcShapeDefinition::maxCollisionHeight

Collision boxes may reach this high (fences, walls).

const int QcShapeDefinition::maxConditions

Most conditions in one "when" object.

const int QcShapeDefinition::maxParts

Most parts of a shape.

QString QcShapeDefinition::name

Qualified name of a shape file; empty for a block's inline shape.

QList<QcShapePart> QcShapeDefinition::parts

Parts of the shape ("parts", or one part from "boxes", "crosses" and "collision" given directly).

QString QcShapeDefinition::rotate

State property that turns the shape about the vertical axis ("rotate"); empty for none.

QString QcShapeDefinition::spin

State property with the values 0..15 that turns the shape in steps of 22.5° ("spin"); empty for none.