import { IRectangle, Rectangle } from './Rectangle'; import { Vector2 } from './Vector2'; /** * Test if two boxes collides. * * @param first - First box. * @param second - Second box. * @returns - True if colliding, else false. */ export declare function intersect(first: Required, second: Required): boolean; export declare class Hit { collider: Rectangle; /** * The overlap between the two objects, and is a vector that can be added to the colliding object’s position to move it back to a non-colliding state. * @type {Vector2} */ delta: Vector2; /** * The surface normal at the point of contact. * @type {Vector2} */ normal: Vector2; /** * The point of contact between the two objects (or an estimation of it, in some sweep tests). * @type {Vector2} */ position: Vector2; /** * Only defined for segment and sweep intersections, and is a fraction from 0 to 1 indicating how far along the line the collision occurred. * * _(This is the **t** value for the line equation **L(t) = A + t(B - A)**)._ * @type {number} */ time: number; constructor(collider: Rectangle); } /** * A function to test a collision and get information if colliding. * * @remarks Expensive function, if you just want to test collision, prefer using {@link intersect} function. * @param box1 - First rectangle. * @param box2 - Second rectangle. * @returns - The Hit result or `null` it not intersecting. */ export declare function collisionBoxes(box1: Required, box2: Required): Hit | null;