PathfindingHelper

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

Create a pathfinding helper.

Constructor Parameters
gridPathfindingGrid
The pathfinding grid reference.
optionsoptionalObject
Configuration options.
Default is {}.
  • updateIntervaloptionalnumber
    Update interval in ms.
    Default is 100.
  • pathColoroptionalnumber
    Path line color.
    Default is 0x00ff88.
  • activeColoroptionalnumber
    Active segment color.
    Default is 0x00ffff.
  • bodyLineColoroptionalnumber
    Body to path line color.
    Default is 0xff0000.
  • waypointColoroptionalnumber
    Waypoint marker color.
    Default is 0xffffff.
  • destinationColoroptionalnumber
    Destination marker color.
    Default is 0xff6688.
  • showWaypointsoptionalboolean
    Show waypoint markers.
    Default is true.
  • showDestinationoptionalboolean
    Show destination marker.
    Default is true.
  • showBodyLineoptionalboolean
    Show line from body to first waypoint.
    Default is true.
  • yOffsetoptionalnumber
    Y offset for path lines.
    Default is 0.1.

Properties

.grid : PathfindingGrid

Reference to the pathfinding grid.

.updateInterval : number

Update interval in milliseconds.

.yOffset : number

Y offset for visualization elements.

.showWaypoints : boolean

Whether to show waypoint markers.

.showDestination : boolean

Whether to show destination markers.

.showBodyLine : boolean

Whether to show body to first waypoint line.

Methods

update#

update()

Update debug visualization - call each frame.

dispose#

dispose()

Dispose of the helper and release resources.