BGE/GridSides

The four sides of a grid cell, as "n" (-z, row - 1), "e" (+x, col + 1), "s" (+z, row + 1) and "w" (-x, col - 1), for maps where row 0 is the -z edge and column 0 the -x edge (BGE.CharGrid, BGE.GridWallsMap).

Alias: BGE.GridSides


Static Methods

all(): Array.<string>

static

Every side, in the order n, e, s, w.

Returns

  • Array.<string>

offset(side: string): Array.<integer>

static

The [col, row] step to the neighbour across a side.

Parameters

  • side (string) — "n", "e", "s" or "w"

Returns

  • Array.<integer>

normal(side: string): BGE.Math.Vector

static

Unit vector on the ground out through a side.

Parameters

  • side (string) — "n", "e", "s" or "w"

Returns

  • BGE.Math.Vector

opposite(side: string): string

static

The side across the cell.

Parameters

  • side (string) — "n", "e", "s" or "w"

Returns

  • string

heading(side: string): float

static

The heading that faces out through a side, in the engine's heading convention (0 faces -z, see BGE.Math.headingForward()): n 0, e PI/2, s PI, w -PI/2.

Parameters

  • side (string) — "n", "e", "s" or "w"

Returns

  • float — radians

wallRotation(side: string): float

static

The y rotation that turns a drawable or model built facing +z (see BGE.Math.rotationForward()) to face into a cell from its wall on side: a picture or torch bracket on that wall. It faces out through the opposite side.

Parameters

  • side (string) — "n", "e", "s" or "w"

Returns

  • float — radians: n 0, e PI/2, s PI, w -PI/2