three-pathfinding-3d
Version:
A 3D pathfinding library for Three.js, supporting navigation meshes (navmeshes) and various pathfinding algorithms.
23 lines (22 loc) • 717 B
TypeScript
import type { Vector3 } from 'three';
import { BinaryHeap } from './BinaryHeap';
interface AstarNode {
f?: number;
g?: number;
h?: number;
cost?: number;
visited?: boolean;
closed?: boolean;
parent?: AstarNode | null;
neighbours: number[];
centroid: Vector3;
}
declare class AStar {
static init<T extends AstarNode>(graph: T[]): void;
static cleanUp<T extends AstarNode>(graph: T[]): void;
static heap<T extends AstarNode>(): BinaryHeap<T>;
static search<T extends AstarNode>(graph: T[], start: T, end: T): T[];
static heuristic(pos1: Vector3, pos2: Vector3): number;
static getNeighbours<T extends AstarNode>(graph: T[], node: T): T[];
}
export { AStar };