import type { Vec3 } from 'mathcat'; import type { NavMesh } from './nav-mesh.js'; import type { QueryFilter } from './nav-mesh-api.js'; import { type FindNodePathResult } from './nav-mesh-search.js'; import { type NodeRef, NodeType } from './node.js'; export declare enum FindSmoothPathResultFlags { NONE = 0, SUCCESS = 1, COMPLETE_PATH = 2, PARTIAL_PATH = 4, INVALID_INPUT = 8, FIND_NODE_PATH_FAILED = 16, FIND_STRAIGHT_PATH_FAILED = 32 } export declare enum SmoothPathPointFlags { START = 0, END = 1, OFFMESH = 2 } export type SmoothPathPoint = { position: Vec3; type: NodeType; nodeRef: NodeRef | null; /** @see SmoothPathPointFlags */ flags: number; }; export type FindSmoothPathResult = { /** whether the search completed successfully */ success: boolean; /** the status flags of the smooth pathfinding operation */ flags: FindSmoothPathResultFlags; /** the path points */ path: SmoothPathPoint[]; /** 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; }; export type FindSmoothPathOptions = { /** Step size for movement along the surface */ stepSize: number; /** Distance tolerance for reaching waypoints */ slop: number; /** Maximum number of path points */ maxPoints: number; /** Maximum raycast distance for any-angle shortcutting. 0 or undefined disables. */ raycastDistance?: number; }; /** * Find a smooth path between two positions on a NavMesh. * * This method computes a smooth path by iteratively moving along the navigation * mesh surface using the polygon path found between start and end positions. * The resulting path follows the surface more naturally than a straight path. * * If the end node cannot be reached through the navigation graph, * the path will go as far as possible toward the target. * * Internally: * - finds the closest poly for the start and end positions with @see findNearestPoly * - finds a nav mesh node path with @see findNodePath * - computes a smooth path by iteratively moving along the surface with @see moveAlongSurface * * @param navMesh The navigation mesh. * @param start The starting position in world space. * @param end The ending position in world space. * @param halfExtents The half extents for nearest polygon queries. * @param queryFilter The query filter. * @param options Configuration for the smooth pathfinding operation. * @returns The result of the smooth pathfinding operation, with path points containing position, type, and nodeRef information. */ export declare const findSmoothPath: (navMesh: NavMesh, start: Vec3, end: Vec3, halfExtents: Vec3, queryFilter: QueryFilter, options: FindSmoothPathOptions) => FindSmoothPathResult;