GridWallsMap

A rectangular grid of solid and open cells. Row 0 is -z, column 0 is -x.

Properties

  • colCount (integer)
  • rowCount (integer)
  • cellSize (float)
  • wallHeight (float)
  • origin (BGE.Math.Vector)
  • solidFlags (Array.<dynamic>) — Per-cell lookups, indexed row * colCount + col (read directly by the ray caster).
  • textures (Array.<dynamic>)
  • outsideTexture (string)

Constructor

new GridWallsMap( rows: Array.<string>, args: BGE.GridWallsMapArgs, ): GridWallsMap

Parameters


Instance Methods

isSolid(col: integer, row: integer): boolean

True for solid cells and for everything outside the grid.

Parameters

  • col (integer)
  • row (integer)

Returns

  • boolean

textureAt(col: integer, row: integer): string

The texture name of a solid cell, "" when open. Outside the grid: the outside texture.

Parameters

  • col (integer)
  • row (integer)

Returns

  • string

toSegments(): Array.<BGE.WallSegment>

The walls as segments for a BGE.DrawableWalls: every face between a solid cell (or the outside) and an open cell, merged into straight runs of one texture, one-sided facing the open side. A texture spans one cell across and the wall height up, as for grid walls.

Returns

cellAt(x: float, z: float): BGE.GridWallsCell

The cell containing a world position (may be outside the grid).

Parameters

  • x (float)
  • z (float)

Returns