Options
All
  • Public
  • Public/Protected
  • All
Menu

支持一种加权节点的基本网格图

Hierarchy

  • WeightedGridGraph

Implements

Index

Constructors

constructor

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

Properties

Private _dirs

_dirs: Vector2[]

Private _height

_height: number

Private _neighbors

_neighbors: Vector2[] = new Array(4)

Private _width

_width: number

defaultWeight

defaultWeight: number = 1

walls

walls: Vector2[] = []

weightedNodeWeight

weightedNodeWeight: number = 5

weightedNodes

weightedNodes: Vector2[] = []

Static 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

cost

getNeighbors

isNodeInBounds

  • isNodeInBounds(node: Vector2): boolean

isNodePassable

  • isNodePassable(node: Vector2): boolean

search

Generated using TypeDoc