import type { Vec3 } from 'mathcat'; import { FindStraightPathResultFlags, type StraightPathPoint } from './find-straight-path.js'; import type { NavMesh } from './nav-mesh.js'; import type { QueryFilter } from './nav-mesh-api.js'; import { type FindNodePathResult, FindNodePathResultFlags } from './nav-mesh-search.js'; import type { NodeRef } from './node.js'; export declare enum FindPathResultFlags { NONE = 0, SUCCESS = 1, COMPLETE_PATH = 2, PARTIAL_PATH = 4, MAX_POINTS_REACHED = 8, INVALID_INPUT = 16, FIND_NODE_PATH_FAILED = 32, FIND_STRAIGHT_PATH_FAILED = 64 } export type FindPathResult = { /** whether the search completed successfully, with either a partial or complete path */ success: boolean; /** the status flags of the pathfinding operation */ flags: FindPathResultFlags; /** the path, consisting of polygon node and offmesh link node references */ path: StraightPathPoint[]; /** the status flags of the straight pathfinding operation */ straightPathFlags: FindStraightPathResultFlags; /** the start poly node ref */ startNodeRef: NodeRef | null; /** the start closest point */ startPosition: Vec3; /** the end poly node ref */ endNodeRef: NodeRef | null; /** the end closest point */ endPosition: Vec3; /** the node path result */ nodePath: FindNodePathResult | null; /** the status flags of the node pathfinding operation */ nodePathFlags: FindNodePathResultFlags; }; export type FindPathOptions = { /** Maximum raycast distance for any-angle shortcutting. 0 or undefined disables. */ raycastDistance?: number; }; /** * Find a path between two positions on a NavMesh. * * If the end node cannot be reached through the navigation graph, * the last node in the path will be the nearest the end node. * * Internally: * - finds the closest poly for the start and end positions with @see findNearestPoly * - finds a nav mesh node path with @see findNodePath * - finds a straight path with @see findStraightPath * * If you want more fine tuned behaviour you can call these methods directly. * For example, for agent movement you might want to find a node path once but regularly re-call @see findStraightPath * * @param navMesh The navigation mesh. * @param start The starting position in world space. * @param end The ending position in world space. * @param queryFilter The query filter. * @param options Optional configuration for the pathfinding operation. * @returns The result of the pathfinding operation. */ export declare const findPath: (navMesh: NavMesh, start: Vec3, end: Vec3, halfExtents: Vec3, queryFilter: QueryFilter, options?: FindPathOptions) => FindPathResult;