import type { Vec3 } from 'mathcat'; export type ObstacleCircle = { /** Position of the obstacle */ p: Vec3; /** Velocity of the obstacle */ vel: Vec3; /** Desired velocity of the obstacle */ dvel: Vec3; /** Radius of the obstacle */ rad: number; /** Direction to obstacle center (used for side selection during sampling) */ dp: Vec3; /** Normal pointing away from velocity (used for side selection during sampling) */ np: Vec3; }; export type ObstacleSegment = { /** End points of the obstacle segment */ p: Vec3; q: Vec3; /** True if agent is very close to segment */ touch: boolean; }; export type ObstacleAvoidanceParams = { velBias: number; weightDesVel: number; weightCurVel: number; weightSide: number; weightToi: number; horizTime: number; gridSize: number; adaptiveDivs: number; adaptiveRings: number; adaptiveDepth: number; }; export type ObstacleAvoidanceDebugData = { samples: Array<{ vel: Vec3; ssize: number; pen: number; vpen: number; vcpen: number; spen: number; tpen: number; }>; }; export type ObstacleAvoidanceQuery = { circles: ObstacleCircle[]; segments: ObstacleSegment[]; maxCircles: number; maxSegments: number; circleCount: number; segmentCount: number; params: ObstacleAvoidanceParams; invHorizTime: number; vmax: number; invVmax: number; pattern: Float32Array; }; /** * Creates a new obstacle avoidance query. */ export declare const createObstacleAvoidanceQuery: (maxCircles: number, maxSegments: number) => ObstacleAvoidanceQuery; /** * Creates debug data for obstacle avoidance. */ export declare const createObstacleAvoidanceDebugData: () => ObstacleAvoidanceDebugData; /** * Resets the obstacle avoidance query. */ export declare const resetObstacleAvoidanceQuery: (query: ObstacleAvoidanceQuery) => void; /** * Resets debug data. */ export declare const resetObstacleAvoidanceDebugData: (debug: ObstacleAvoidanceDebugData) => void; /** * Adds a circular obstacle to the query. */ export declare const addCircleObstacle: (query: ObstacleAvoidanceQuery, pos: Vec3, rad: number, vel: Vec3, dvel: Vec3) => void; /** * Adds a segment obstacle to the query. */ export declare const addSegmentObstacle: (query: ObstacleAvoidanceQuery, p: Vec3, q: Vec3) => void; /** * Sample velocity using grid-based approach. */ export declare const sampleVelocityGrid: (query: ObstacleAvoidanceQuery, pos: Vec3, rad: number, vmax: number, vel: Vec3, dvel: Vec3, params: ObstacleAvoidanceParams, debug?: ObstacleAvoidanceDebugData) => { nvel: Vec3; samples: number; }; /** * Sample velocity using adaptive approach. */ export declare const sampleVelocityAdaptive: (query: ObstacleAvoidanceQuery, pos: Vec3, rad: number, vmax: number, vel: Vec3, dvel: Vec3, params: ObstacleAvoidanceParams, outVelocity: Vec3, debug?: ObstacleAvoidanceDebugData) => number;