import type { Vec3 } from '../math/vec3.js'; import type { PmoveTraceFn } from './types.js'; export interface GoodPositionParams { readonly origin: Vec3; readonly mins: Vec3; readonly maxs: Vec3; readonly trace: PmoveTraceFn; } export declare function goodPosition(params: GoodPositionParams): boolean; export type SnapResolution = 'unchanged' | 'fixed' | 'reverted'; export interface SnapPositionParams extends GoodPositionParams { readonly velocity: Vec3; readonly previousOrigin: Vec3; } export interface SnapPositionResult { readonly origin: Vec3; readonly velocity: Vec3; readonly resolution: SnapResolution; } /** * Pure translation of PM_SnapPosition from rerelease `p_move.cpp`. * Attempts to keep the caller's origin in a valid location by first * checking the current origin against collision traces, then falling * back to the shared `fixStuckObjectGeneric` helper before finally * reverting to the provided previous origin when no fix is possible. */ export declare function snapPosition(params: SnapPositionParams): SnapPositionResult; export interface InitialSnapPositionParams extends GoodPositionParams { } export interface InitialSnapPositionResult { readonly origin: Vec3; readonly snapped: boolean; } /** * Pure translation of PM_InitialSnapPosition from rerelease `p_move.cpp`. * Tries a 3x3x3 grid of +/-1 unit offsets around the base origin to find * a valid collision-free spot, mirroring the search order of the C++ code. */ export declare function initialSnapPosition(params: InitialSnapPositionParams): InitialSnapPositionResult; //# sourceMappingURL=snap.d.ts.map