Skip to content

ProjectionSpec ​

Struct

Source: Projection.h

Description ​

Plain six-int aggregate: the screen anchor of cell (0, 0) plus the two screen-space axis vectors of the cell grid.

The two axis vectors form the columns of a 2x2 integer matrix. No member functions, no derived fields, no per-instance runtime state — a constexpr ProjectionSpec costs zero SRAM. The determinant is deliberately NOT a field: see projectionDet().

Defaults form the identity basis, so a default-constructed spec maps every cell to itself.

LayoutTileValuedet
Orthogonal16x16{0, 0, 16, 0, 0, 16}256
Isometric 2:132x16{0, 0, 16, 8, -16, 8}256
Isometric 1:132x32{0, 0, 16, 16, -16, 16}512
Oblique16x16{0, 0, 16, 0, 8, 16}256

Properties ​

NameTypeDescription
originXintScreen X of cell (0, 0)'s anchor, in pixels.
originYintScreen Y of cell (0, 0)'s anchor, in pixels.
axisXxintScreen X delta per +1 cellX.
axisXyintScreen Y delta per +1 cellX.
axisYxintScreen X delta per +1 cellY.
axisYyintScreen Y delta per +1 cellY.

Released under the MIT License.