Class UnweightedGridGraph
Constructors
constructor
- new UnweightedGridGraph(width: number, height: number, allowDiagonalSearch?: boolean): UnweightedGridGraph
-
Parameters
-
width: number
-
height: number
-
Default value allowDiagonalSearch: boolean = false
Properties
Private _hegiht
_hegiht: number
Private _neighbors
_neighbors
: Vector2[] = new Array(4)
Private _width
_width: number
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
isNodeInBounds
- isNodeInBounds(node: Vector2): boolean
-
Parameters
Returns boolean
isNodePassable
- isNodePassable(node: Vector2): boolean
-
Parameters
Returns boolean
基本的未加权网格图形用于BreadthFirstPathfinder