import { type Vec3 } from '../math/vec3.js'; import type { PmoveTraceFn } from './types.js'; export declare const SLIDEMOVE_BLOCKED_FLOOR = 1; export declare const SLIDEMOVE_BLOCKED_WALL = 2; export interface SlideMoveResult { readonly velocity: Vec3; readonly planes: readonly Vec3[]; readonly stopped: boolean; } export interface SlideMoveParams { readonly origin: Vec3; readonly velocity: Vec3; readonly frametime: number; readonly overbounce: number; readonly trace: PmoveTraceFn; readonly maxBumps?: number; readonly maxClipPlanes?: number; readonly mins?: Vec3; readonly maxs?: Vec3; /** * Mirrors the pm->s.pm_time check in PM_StepSlideMove_Generic: if true, the * returned velocity is reset to the primal velocity after collision * resolution so time-based effects (like knockbacks) don't dampen. */ readonly hasTime?: boolean; } export interface SlideMoveOutcome extends SlideMoveResult { readonly origin: Vec3; readonly blocked: number; } export interface StepSlideMoveParams extends SlideMoveParams { readonly mins: Vec3; readonly maxs: Vec3; readonly stepSize?: number; } export interface StepSlideMoveOutcome extends SlideMoveOutcome { readonly stepped: boolean; readonly stepHeight: number; readonly stepNormal?: Vec3; } /** * Resolves a sequence of collision planes against a primal velocity using the same * plane iteration logic seen in PM_StepSlideMove_Generic (rerelease p_move.cpp). * The incoming planes should be ordered as they were encountered during traces; * the function will accumulate them, clip the velocity to be parallel to all planes, * and return zero velocity when three planes form an unresolvable corner or when * the adjusted velocity would oppose the primal direction. */ export declare function resolveSlideMove(initialVelocity: Vec3, planesEncountered: readonly Vec3[], overbounce: number, maxClipPlanes?: number, primalVelocity?: Vec3): SlideMoveResult; /** * Pure mirror of PM_SlideMoveGeneric from rerelease `p_move.cpp` (minus gravity/step handling). * Uses a caller-provided trace to collect collision planes, accumulates them through * `resolveSlideMove`, and returns the resulting origin/velocity/blocking state. */ export declare function slideMove(params: SlideMoveParams): SlideMoveOutcome; /** * Mirrors PM_StepSlideMove (rerelease p_move.cpp) in a pure form: attempts a * regular slide move, then retries from a stepped-up position when the first * attempt was blocked. The function compares planar distance traveled and the * steepness of the landing plane to decide whether to keep the step. */ export declare function stepSlideMove(params: StepSlideMoveParams): StepSlideMoveOutcome; //# sourceMappingURL=slide.d.ts.map