import { Bounds } from './Bounds'; import { Hex } from './Hex'; import { Matrix } from './Matrix'; import { Vector } from './Vector'; /** Input settings for HexLayout. */ export interface HexLayoutSettings { /** Distance between centers of adjacent hexes. */ readonly centerToCenterDistance: number; /** Location in Cartesian space of the center of the (0, 0) hex. */ readonly origin: Vector; /** The angle of the q axis, in radians from the x axis. */ readonly qAxisAngle: number; /** Whether the r axis is 60° clockwise or counterclockwise from the q axis. */ readonly rAxisClockwise: boolean; } export declare class HexLayout { /** Input layout settings. */ readonly settings: HexLayoutSettings; /** Transformation matrix for calculating Cartesian coordinates from hex coordinates. */ readonly hexToPointTransform: Matrix; /** Transformation matrix for calculating hex coordinates from Cartesian coordinates. */ readonly pointToHexTransform: Matrix; /** * The six vectors (in Cartesian space) from the center of a hex to each corner. * In circular order, starting with the q axis, and going in the direction of the r axis. */ readonly cornerVectors: ReadonlyArray; /** * The six vectors (in Cartesian space) from the center of a hex to each edge center. * In circular order, starting with the q axis, and going in the direction of the r axis. */ readonly edgeCenterVectors: ReadonlyArray; /** Constructs a HexLayout given HexLayoutSettings. */ constructor(settings: HexLayoutSettings); /** * Returns one of the six vectors from the center of a hex to a corner, * given the vector's index (from 0 to 5). * The vectors are in circular order, starting with the q axis, and going in the direction of the r axis. */ cornerVector(corner: 0 | 1 | 2 | 3 | 4 | 5): Vector; /** * Returns one of the six vectors from the center of a hex to an edge center, * given the vector's index (from 0 to 5). * The vectors are in circular order, starting with the q axis, and going in the direction of the r axis. */ edgeCenterVector(edgeCenter: 0 | 1 | 2 | 3 | 4 | 5): Vector; /** Returns the (Cartesian) vector to the center of the given hex. */ centerOfHex(h: Hex): Vector; /** Returns the hex containing the point indicated by the (Cartesian) vector. */ hexFromPoint(v: Vector): Hex; /** * Returns the six (Cartesian) vectors from the origin to the corners of a hex, * given a vector to the center of the hex. * The vectors are in circular order, starting with the q axis, and going in the direction of the r axis. */ cornersFromCenter(center: Vector): ReadonlyArray; /** * Returns the six (Cartesian) vectors from the origin to the corners of a given hex. * The vectors are in circular order, starting with the q axis, and going in the direction of the r axis. */ cornersOfHex(h: Hex): ReadonlyArray; /** * Returns the rectangular region (bounds) completely containing the given hexes. * All corners of the given hexes will be either inside or on the boundary of the returned region. */ bounds(hexes: ReadonlyArray): Bounds; }