TerrainRotate for an axial hex grid: exact 60-degree steps (rotations must be a multiple of 6, or 0), via the standard cube-coordinate rotation (q,r,s -> -r,-s,-q per 60-degree step, s = -q - r).
TerrainRotate
rotations
q,r,s -> -r,-s,-q
s = -q - r
import { hexRotate } from '@datamoc/mw_games/two-d/render';console.log(hexRotate(1, 0, 1, 6)); // one 60-degree step of the axial offset (1, 0) Copy
import { hexRotate } from '@datamoc/mw_games/two-d/render';console.log(hexRotate(1, 0, 1, 6)); // one 60-degree step of the axial offset (1, 0)
TerrainRotatefor an axial hex grid: exact 60-degree steps (rotationsmust be a multiple of 6, or 0), via the standard cube-coordinate rotation (q,r,s -> -r,-s,-qper 60-degree step,s = -q - r).