import type { Vec3 } from 'mathcat'; import { type NavMesh, type NodeRef, type QueryFilter, type StraightPathPoint } from 'navcat'; export type PathCorridor = { position: Vec3; target: Vec3; path: NodeRef[]; }; export declare const create: () => PathCorridor; export declare const reset: (corridor: PathCorridor, ref: NodeRef, position: Vec3) => void; export declare const setPath: (corridor: PathCorridor, target: Vec3, path: NodeRef[]) => void; export declare const mergeStartMoved: (currentPath: NodeRef[], visited: NodeRef[]) => NodeRef[]; export declare const mergeStartShortcut: (currentPath: NodeRef[], visited: NodeRef[]) => NodeRef[]; export declare const movePosition: (corridor: PathCorridor, newPos: Vec3, navMesh: NavMesh, filter: QueryFilter) => boolean; export declare const findCorners: (corridor: PathCorridor, navMesh: NavMesh, maxCorners: number) => false | StraightPathPoint[]; export declare const corridorIsValid: (corridor: PathCorridor, maxLookAhead: number, navMesh: NavMesh, filter: QueryFilter) => boolean; export declare const fixPathStart: (corridor: PathCorridor, safeRef: NodeRef, safePos: Vec3) => boolean; export declare const moveOverOffMeshConnection: (corridor: PathCorridor, offMeshNodeRef: NodeRef, navMesh: NavMesh) => false | { startPosition: Vec3; endPosition: Vec3; endNodeRef: number; prevNodeRef: number; offMeshNodeRef: number; }; /** * Attempts to optimize the path using a local area search (partial replanning). * * Inaccurate locomotion or dynamic obstacle avoidance can force the agent position significantly * outside the original corridor. Over time this can result in the formation of a non-optimal corridor. * This function will use a local area path search to try to re-optimize the corridor. * * The more inaccurate the agent movement, the more beneficial this function becomes. * Simply adjust the frequency of the call to match the needs of the agent. * * @param corridor the path corridor * @param navMesh the navigation mesh * @param filter the query filter * @returns true if the path was optimized, false otherwise */ export declare const optimizePathTopology: (corridor: PathCorridor, navMesh: NavMesh, filter: QueryFilter) => boolean; /** * Attempts to optimize the path if the specified point is visible from the current position. * * Inaccurate locomotion or dynamic obstacle avoidance can force the agent position significantly * outside the original corridor. Over time this can result in the formation of a non-optimal corridor. * Non-optimal paths can also form near the corners of tiles. * * This function uses an efficient local visibility search to try to optimize the corridor * between the current position and the target. * * The corridor will change only if the target is visible from the current position and moving * directly toward the point is better than following the existing path. * * The more inaccurate the agent movement, the more beneficial this function becomes. * Simply adjust the frequency of the call to match the needs of the agent. * * This function is not suitable for long distance searches. * * @param corridor the path corridor * @param next the point to search toward * @param pathOptimizationRange the maximum range to search * @param navMesh the navigation mesh * @param filter the query filter */ export declare const optimizePathVisibility: (corridor: PathCorridor, next: Vec3, pathOptimizationRange: number, navMesh: NavMesh, filter: QueryFilter) => void;