UNPKG

s2maps-gpu

Version:

S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.

52 lines (51 loc) 2.02 kB
import type { TmpWMID } from './WM.js'; import type { Face, S2CellId, VectorPoint } from 'gis-tools/index.js'; export * from './S2.js'; export * from './WM.js'; /** Found tile's allow easy access to it's shape and support out of bounds for WM */ export interface TileInView { id: S2CellId | TmpWMID; face: Face; zoom: number; x: number; y: number; wrappedID?: S2CellId; } /** * check 3D point boundries of a rectangle are within the range of [-1,1] * @param bl - bottom left point * @param br - bottom right point * @param tl - top left point * @param tr - top right point * @returns true if any point is within the range of [-1,1] */ export declare function pointBoundaries(bl: VectorPoint, br: VectorPoint, tl: VectorPoint, tr: VectorPoint): boolean; /** * test boxIntersect against the 4 lines of a rectangle * @param bl - bottom left * @param br - bottom right * @param tl - top left * @param tr - top right * @returns true if any line intersects */ export declare function boxIntersects(bl: VectorPoint, br: VectorPoint, tl: VectorPoint, tr: VectorPoint): boolean; /** * check line intersections of p1 and p2 against a [[-1, -1], [1, 1]] box. * @param p1 - the first point * @param p2 - the second point * @returns true if any line intersects with the box */ export declare function boxIntersect(p1: VectorPoint, p2: VectorPoint): boolean; /** * check if two lines intersect * @param x1 - the x-coordinate of the first point * @param y1 - the y-coordinate of the first point * @param x2 - the x-coordinate of the second point * @param y2 - the y-coordinate of the second point * @param x3 - the x-coordinate of the third point * @param y3 - the y-coordinate of the third point * @param x4 - the x-coordinate of the fourth point * @param y4 - the y-coordinate of the fourth point * @returns true if the lines intersect */ export declare function lineIntersect(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): boolean;