export interface Vec3 { readonly x: number; readonly y: number; readonly z: number; readonly [index: number]: number; } export declare const ZERO_VEC3: Vec3; export declare const STOP_EPSILON = 0.1; export interface Bounds3 { readonly mins: Vec3; readonly maxs: Vec3; } export type Mat3Row = readonly [number, number, number]; export type Mat3 = readonly [Mat3Row, Mat3Row, Mat3Row]; export declare function copyVec3(a: Vec3): Vec3; export declare function addVec3(a: Vec3, b: Vec3): Vec3; export declare function subtractVec3(a: Vec3, b: Vec3): Vec3; export declare function multiplyVec3(a: Vec3, b: Vec3): Vec3; export declare function scaleVec3(a: Vec3, scalar: number): Vec3; export declare function negateVec3(a: Vec3): Vec3; export declare function dotVec3(a: Vec3, b: Vec3): number; export declare function crossVec3(a: Vec3, b: Vec3): Vec3; export declare function lengthSquaredVec3(a: Vec3): number; export declare function lengthVec3(a: Vec3): number; export declare function distance(a: Vec3, b: Vec3): number; export declare function vec3Equals(a: Vec3, b: Vec3): boolean; /** * Returns the normalized vector. If the vector is zero-length, the * input is returned to mirror the rerelease q_vec3 semantics. */ export declare function normalizeVec3(a: Vec3): Vec3; /** * Projects a point onto a plane defined by the given normal. * Based on ProjectPointOnPlane in the rerelease q_vec3 helpers. */ export declare function projectPointOnPlane(point: Vec3, normal: Vec3): Vec3; /** * Computes a perpendicular vector to the provided direction using the * smallest axial component heuristic used by the rerelease. * Assumes the input is normalized. */ export declare function perpendicularVec3(src: Vec3): Vec3; export declare function closestPointToBox(point: Vec3, mins: Vec3, maxs: Vec3): Vec3; export declare function distanceBetweenBoxesSquared(aMins: Vec3, aMaxs: Vec3, bMins: Vec3, bMaxs: Vec3): number; export declare function createEmptyBounds3(): Bounds3; export declare function addPointToBounds(point: Vec3, bounds: Bounds3): Bounds3; export declare function boxesIntersect(a: Bounds3, b: Bounds3): boolean; /** * Mirrors PM_ClipVelocity from `rerelease/p_move.cpp`: slide the incoming velocity off * a plane normal, applying an overbounce scale and zeroing tiny components so callers can * detect blocked axes using STOP_EPSILON. */ export declare function clipVelocityVec3(inVel: Vec3, normal: Vec3, overbounce: number): Vec3; /** * Slide a velocity across one or more clip planes using the same plane set resolution logic * seen in the inner loop of `PM_StepSlideMove_Generic` (rerelease `p_move.cpp`). When a single * plane is provided this devolves to PM_ClipVelocity; with two planes it projects onto the * crease defined by their cross product; with more planes it zeroes the velocity to avoid * oscillations. */ export declare function clipVelocityAgainstPlanes(velocity: Vec3, planes: readonly Vec3[], overbounce: number, primalVelocity?: Vec3): Vec3; /** * Alias retained for ergonomics; mirrors PM_ClipVelocity semantics. */ export declare function slideClipVelocityVec3(inVel: Vec3, normal: Vec3, overbounce: number): Vec3; /** * Project an offset from a point in forward/right(/up) space into world space. * Mirrors G_ProjectSource and G_ProjectSource2 in rerelease q_vec3. */ export declare function projectSourceVec3(point: Vec3, distance: Vec3, forward: Vec3, right: Vec3): Vec3; export declare function projectSourceVec3WithUp(point: Vec3, distance: Vec3, forward: Vec3, right: Vec3, up: Vec3): Vec3; /** * Spherical linear interpolation between two vectors, mirroring q_vec3::slerp. * This is intended for direction vectors; callers should pre-normalize if needed. */ export declare function slerpVec3(from: Vec3, to: Vec3, t: number): Vec3; export declare function concatRotationMatrices(a: Mat3, b: Mat3): Mat3; export declare function rotatePointAroundVector(dir: Vec3, point: Vec3, degrees: number): Vec3; //# sourceMappingURL=vec3.d.ts.map