PathfindingGridHelper

@three-blocks/pro
new PathfindingGridHelper(grid : PathfindingGrid, options : Object)
Extends
THREE.Object3D

Create a pathfinding grid helper.

Constructor Parameters
gridPathfindingGrid
The pathfinding grid to visualize.
optionsoptionalObject
Configuration options.
Default is {}.
  • updateIntervaloptionalnumber
    Update interval in ms.
    Default is 1000.
  • walkableColoroptionalnumber
    Walkable cell color.
    Default is 0x00ff00.
  • blockedColoroptionalnumber
    Blocked cell color.
    Default is 0xff0000.
  • opacityoptionalnumber
    Cell opacity.
    Default is 0.3.
  • showWalkableoptionalboolean
    Show walkable cells.
    Default is true.
  • showBlockedoptionalboolean
    Show blocked cells.
    Default is false.
  • yOffsetoptionalnumber
    Y offset above ground.
    Default is 0.05.

Properties

.grid : PathfindingGrid

Reference to the pathfinding grid.

.updateInterval : number

Update interval in milliseconds.

.yOffset : number

Y offset for visualization elements.

.opacity : number

Grid cell opacity.

.showWalkable : boolean

Whether to show walkable cells.

.showBlocked : boolean

Whether to show blocked cells.

Methods

update#

update()

Update debug visualization - call each frame or periodically.

refresh#

refresh()

Force refresh the grid visualization.

dispose#

dispose()

Dispose of the helper and release resources.