Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Hex_Cube Struct Reference

Cube coordinates (x, y, z) with the constraint x+y+z = 0. More...

#include <tpl_ca_hex_lattice.H>

Public Attributes

ca_index_t x = 0
 
ca_index_t y = 0
 
ca_index_t z = 0
 

Friends

constexpr bool operator== (Hex_Cube a, Hex_Cube b) noexcept
 
constexpr bool operator!= (Hex_Cube a, Hex_Cube b) noexcept
 

Detailed Description

Cube coordinates (x, y, z) with the constraint x+y+z = 0.

Cube coordinates make several geometric operations trivial (e.g. Euclidean distance, rotations by 60°). They are the canonical representation used by Red Blob Games and by most academic references on hex grids.

Definition at line 133 of file tpl_ca_hex_lattice.H.

Friends And Related Symbol Documentation

◆ operator!=

constexpr bool operator!= ( Hex_Cube  a,
Hex_Cube  b 
)
friend

Definition at line 143 of file tpl_ca_hex_lattice.H.

◆ operator==

constexpr bool operator== ( Hex_Cube  a,
Hex_Cube  b 
)
friend

Definition at line 139 of file tpl_ca_hex_lattice.H.

Member Data Documentation

◆ x

ca_index_t Aleph::CA::Hex_Cube::x = 0

Definition at line 135 of file tpl_ca_hex_lattice.H.

◆ y

ca_index_t Aleph::CA::Hex_Cube::y = 0

Definition at line 136 of file tpl_ca_hex_lattice.H.

◆ z

ca_index_t Aleph::CA::Hex_Cube::z = 0

Definition at line 137 of file tpl_ca_hex_lattice.H.


The documentation for this struct was generated from the following file: