Options
All
  • Public
  • Public/Protected
  • All
Menu

基本的未加权网格图形用于BreadthFirstPathfinder

Hierarchy

  • UnweightedGridGraph

Implements

Index

Constructors

constructor

  • new UnweightedGridGraph(width: number, height: number, allowDiagonalSearch?: boolean): UnweightedGridGraph

Properties

Private _dirs

_dirs: Vector2[]

Private _hegiht

_hegiht: number

Private _neighbors

_neighbors: Vector2[] = new Array(4)

Private _width

_width: number

walls

walls: Vector2[] = []

Static Private Readonly CARDINAL_DIRS

CARDINAL_DIRS: Vector2[] = [new Vector2(1, 0),new Vector2(0, -1),new Vector2(-1, 0),new Vector2(0, -1)]

Static Private Readonly COMPASS_DIRS

COMPASS_DIRS: Vector2[] = [new Vector2(1, 0),new Vector2(1, -1),new Vector2(0, -1),new Vector2(-1, -1),new Vector2(-1, 0),new Vector2(-1, 1),new Vector2(0, 1),new Vector2(1, 1),]

Methods

getNeighbors

isNodeInBounds

  • isNodeInBounds(node: Vector2): boolean

isNodePassable

  • isNodePassable(node: Vector2): boolean

search

Generated using TypeDoc