@ac-kit/math-geometry 0.2.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +321 -0
- package/README.md +363 -52
- package/dist/_brand.d.ts +14 -0
- package/dist/_brand.d.ts.map +1 -0
- package/dist/_brand.js +2 -0
- package/dist/_brand.js.map +1 -0
- package/dist/_ear-clipping.d.ts +20 -0
- package/dist/_ear-clipping.d.ts.map +1 -0
- package/dist/_ear-clipping.js +360 -0
- package/dist/_ear-clipping.js.map +1 -0
- package/dist/_polygon3-cross.d.ts +23 -0
- package/dist/_polygon3-cross.d.ts.map +1 -0
- package/dist/_polygon3-cross.js +418 -0
- package/dist/_polygon3-cross.js.map +1 -0
- package/dist/_ray3-intersect.d.ts +19 -0
- package/dist/_ray3-intersect.d.ts.map +1 -0
- package/dist/_ray3-intersect.js +122 -0
- package/dist/_ray3-intersect.js.map +1 -0
- package/dist/_triangle3-cross.d.ts +66 -0
- package/dist/_triangle3-cross.d.ts.map +1 -0
- package/dist/_triangle3-cross.js +396 -0
- package/dist/_triangle3-cross.js.map +1 -0
- package/dist/box2-array-boundary.d.ts +50 -0
- package/dist/box2-array-boundary.d.ts.map +1 -0
- package/dist/box2-array-boundary.js +97 -0
- package/dist/box2-array-boundary.js.map +1 -0
- package/dist/box2-array.d.ts +42 -0
- package/dist/box2-array.d.ts.map +1 -0
- package/dist/box2-array.js +134 -0
- package/dist/box2-array.js.map +1 -0
- package/dist/box2-componentwise.d.ts +110 -0
- package/dist/box2-componentwise.d.ts.map +1 -0
- package/dist/box2-componentwise.js +325 -0
- package/dist/box2-componentwise.js.map +1 -0
- package/dist/box2-grid-index.d.ts +67 -0
- package/dist/box2-grid-index.d.ts.map +1 -0
- package/dist/box2-grid-index.js +198 -0
- package/dist/box2-grid-index.js.map +1 -0
- package/dist/box2-record.d.ts +83 -0
- package/dist/box2-record.d.ts.map +1 -0
- package/dist/box2-record.js +124 -0
- package/dist/box2-record.js.map +1 -0
- package/dist/box2.d.ts +38 -0
- package/dist/box2.d.ts.map +1 -0
- package/dist/box2.js +97 -0
- package/dist/box2.js.map +1 -0
- package/dist/box3-array-boundary.d.ts +50 -0
- package/dist/box3-array-boundary.d.ts.map +1 -0
- package/dist/box3-array-boundary.js +107 -0
- package/dist/box3-array-boundary.js.map +1 -0
- package/dist/box3-componentwise.d.ts +110 -0
- package/dist/box3-componentwise.d.ts.map +1 -0
- package/dist/box3-componentwise.js +392 -0
- package/dist/box3-componentwise.js.map +1 -0
- package/dist/box3-record.d.ts +92 -0
- package/dist/box3-record.d.ts.map +1 -0
- package/dist/box3-record.js +147 -0
- package/dist/box3-record.js.map +1 -0
- package/dist/box3.d.ts +19 -16
- package/dist/box3.d.ts.map +1 -1
- package/dist/box3.js +73 -76
- package/dist/box3.js.map +1 -1
- package/dist/box4-array-boundary.d.ts +50 -0
- package/dist/box4-array-boundary.d.ts.map +1 -0
- package/dist/box4-array-boundary.js +117 -0
- package/dist/box4-array-boundary.js.map +1 -0
- package/dist/box4-componentwise.d.ts +110 -0
- package/dist/box4-componentwise.d.ts.map +1 -0
- package/dist/box4-componentwise.js +459 -0
- package/dist/box4-componentwise.js.map +1 -0
- package/dist/box4-record.d.ts +96 -0
- package/dist/box4-record.d.ts.map +1 -0
- package/dist/box4-record.js +167 -0
- package/dist/box4-record.js.map +1 -0
- package/dist/box4.d.ts +13 -8
- package/dist/box4.d.ts.map +1 -1
- package/dist/box4.js +27 -5
- package/dist/box4.js.map +1 -1
- package/dist/circle2-array-boundary.d.ts +51 -0
- package/dist/circle2-array-boundary.d.ts.map +1 -0
- package/dist/circle2-array-boundary.js +93 -0
- package/dist/circle2-array-boundary.js.map +1 -0
- package/dist/circle2-array.d.ts +17 -0
- package/dist/circle2-array.d.ts.map +1 -0
- package/dist/circle2-array.js +44 -0
- package/dist/circle2-array.js.map +1 -0
- package/dist/circle2-record.d.ts +81 -0
- package/dist/circle2-record.d.ts.map +1 -0
- package/dist/circle2-record.js +114 -0
- package/dist/circle2-record.js.map +1 -0
- package/dist/circle2.d.ts +27 -82
- package/dist/circle2.d.ts.map +1 -1
- package/dist/circle2.js +59 -104
- package/dist/circle2.js.map +1 -1
- package/dist/coordinates/cylindrical-record.d.ts +86 -0
- package/dist/coordinates/cylindrical-record.d.ts.map +1 -0
- package/dist/coordinates/cylindrical-record.js +114 -0
- package/dist/coordinates/cylindrical-record.js.map +1 -0
- package/dist/coordinates/horizontal-record.d.ts +86 -0
- package/dist/coordinates/horizontal-record.d.ts.map +1 -0
- package/dist/coordinates/horizontal-record.js +114 -0
- package/dist/coordinates/horizontal-record.js.map +1 -0
- package/dist/coordinates/horizontal.d.ts +48 -0
- package/dist/coordinates/horizontal.d.ts.map +1 -0
- package/dist/coordinates/horizontal.js +100 -0
- package/dist/coordinates/horizontal.js.map +1 -0
- package/dist/coordinates/index.d.ts +10 -0
- package/dist/coordinates/index.d.ts.map +1 -0
- package/dist/coordinates/index.js +10 -0
- package/dist/coordinates/index.js.map +1 -0
- package/dist/coordinates/longitude-latitude-record.d.ts +81 -0
- package/dist/coordinates/longitude-latitude-record.d.ts.map +1 -0
- package/dist/coordinates/longitude-latitude-record.js +104 -0
- package/dist/coordinates/longitude-latitude-record.js.map +1 -0
- package/dist/coordinates/longitude-latitude.d.ts +33 -0
- package/dist/coordinates/longitude-latitude.d.ts.map +1 -0
- package/dist/coordinates/longitude-latitude.js +78 -0
- package/dist/coordinates/longitude-latitude.js.map +1 -0
- package/dist/coordinates/polar-record.d.ts +77 -0
- package/dist/coordinates/polar-record.d.ts.map +1 -0
- package/dist/coordinates/polar-record.js +104 -0
- package/dist/coordinates/polar-record.js.map +1 -0
- package/dist/coordinates/polar.d.ts +28 -0
- package/dist/coordinates/polar.d.ts.map +1 -0
- package/dist/coordinates/polar.js +68 -0
- package/dist/coordinates/polar.js.map +1 -0
- package/dist/coordinates/spherical-cylindrical.d.ts +49 -0
- package/dist/coordinates/spherical-cylindrical.d.ts.map +1 -0
- package/dist/coordinates/spherical-cylindrical.js +110 -0
- package/dist/coordinates/spherical-cylindrical.js.map +1 -0
- package/dist/coordinates/spherical-record.d.ts +86 -0
- package/dist/coordinates/spherical-record.d.ts.map +1 -0
- package/dist/coordinates/spherical-record.js +114 -0
- package/dist/coordinates/spherical-record.js.map +1 -0
- package/dist/frustum3-record.d.ts +132 -0
- package/dist/frustum3-record.d.ts.map +1 -0
- package/dist/frustum3-record.js +333 -0
- package/dist/frustum3-record.js.map +1 -0
- package/dist/frustum3.d.ts +60 -0
- package/dist/frustum3.d.ts.map +1 -0
- package/dist/frustum3.js +186 -0
- package/dist/frustum3.js.map +1 -0
- package/dist/index.d.ts +36 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -16
- package/dist/index.js.map +1 -1
- package/dist/line2-record.d.ts +87 -0
- package/dist/line2-record.d.ts.map +1 -0
- package/dist/line2-record.js +123 -0
- package/dist/line2-record.js.map +1 -0
- package/dist/line2.d.ts +24 -33
- package/dist/line2.d.ts.map +1 -1
- package/dist/line2.js +78 -52
- package/dist/line2.js.map +1 -1
- package/dist/line3-record.d.ts +91 -0
- package/dist/line3-record.d.ts.map +1 -0
- package/dist/line3-record.js +146 -0
- package/dist/line3-record.js.map +1 -0
- package/dist/line3.d.ts +11 -24
- package/dist/line3.d.ts.map +1 -1
- package/dist/line3.js +32 -36
- package/dist/line3.js.map +1 -1
- package/dist/mesh/_generator-kit.d.ts +14 -0
- package/dist/mesh/_generator-kit.d.ts.map +1 -0
- package/dist/mesh/_generator-kit.js +39 -0
- package/dist/mesh/_generator-kit.js.map +1 -0
- package/dist/mesh/_index-kernels-u16.d.ts +85 -0
- package/dist/mesh/_index-kernels-u16.d.ts.map +1 -0
- package/dist/mesh/_index-kernels-u16.js +1045 -0
- package/dist/mesh/_index-kernels-u16.js.map +1 -0
- package/dist/mesh/_index-kernels-u32.d.ts +85 -0
- package/dist/mesh/_index-kernels-u32.d.ts.map +1 -0
- package/dist/mesh/_index-kernels-u32.js +1045 -0
- package/dist/mesh/_index-kernels-u32.js.map +1 -0
- package/dist/mesh/generate-box.d.ts +16 -0
- package/dist/mesh/generate-box.d.ts.map +1 -0
- package/dist/mesh/generate-box.js +79 -0
- package/dist/mesh/generate-box.js.map +1 -0
- package/dist/mesh/generate-cylinder.d.ts +25 -0
- package/dist/mesh/generate-cylinder.d.ts.map +1 -0
- package/dist/mesh/generate-cylinder.js +117 -0
- package/dist/mesh/generate-cylinder.js.map +1 -0
- package/dist/mesh/generate-heightfield.d.ts +24 -0
- package/dist/mesh/generate-heightfield.d.ts.map +1 -0
- package/dist/mesh/generate-heightfield.js +48 -0
- package/dist/mesh/generate-heightfield.js.map +1 -0
- package/dist/mesh/generate-plane.d.ts +18 -0
- package/dist/mesh/generate-plane.d.ts.map +1 -0
- package/dist/mesh/generate-plane.js +39 -0
- package/dist/mesh/generate-plane.js.map +1 -0
- package/dist/mesh/generate-sphere.d.ts +50 -0
- package/dist/mesh/generate-sphere.d.ts.map +1 -0
- package/dist/mesh/generate-sphere.js +244 -0
- package/dist/mesh/generate-sphere.js.map +1 -0
- package/dist/mesh/index.d.ts +8 -0
- package/dist/mesh/index.d.ts.map +1 -0
- package/dist/mesh/index.js +8 -0
- package/dist/mesh/index.js.map +1 -0
- package/dist/mesh/mesh3-kernels.d.ts +122 -0
- package/dist/mesh/mesh3-kernels.d.ts.map +1 -0
- package/dist/mesh/mesh3-kernels.js +220 -0
- package/dist/mesh/mesh3-kernels.js.map +1 -0
- package/dist/mesh/mesh3.d.ts +66 -0
- package/dist/mesh/mesh3.d.ts.map +1 -0
- package/dist/mesh/mesh3.js +128 -0
- package/dist/mesh/mesh3.js.map +1 -0
- package/dist/plane3-record.d.ts +88 -0
- package/dist/plane3-record.d.ts.map +1 -0
- package/dist/plane3-record.js +123 -0
- package/dist/plane3-record.js.map +1 -0
- package/dist/plane3.d.ts +43 -28
- package/dist/plane3.d.ts.map +1 -1
- package/dist/plane3.js +149 -48
- package/dist/plane3.js.map +1 -1
- package/dist/polygon2.d.ts +132 -29
- package/dist/polygon2.d.ts.map +1 -1
- package/dist/polygon2.js +529 -96
- package/dist/polygon2.js.map +1 -1
- package/dist/polygon3.d.ts +56 -21
- package/dist/polygon3.d.ts.map +1 -1
- package/dist/polygon3.js +239 -91
- package/dist/polygon3.js.map +1 -1
- package/dist/polyline2.d.ts +37 -0
- package/dist/polyline2.d.ts.map +1 -0
- package/dist/polyline2.js +146 -0
- package/dist/polyline2.js.map +1 -0
- package/dist/polyline3.d.ts +35 -0
- package/dist/polyline3.d.ts.map +1 -0
- package/dist/polyline3.js +159 -0
- package/dist/polyline3.js.map +1 -0
- package/dist/quadtree.d.ts +255 -0
- package/dist/quadtree.d.ts.map +1 -0
- package/dist/quadtree.js +1096 -0
- package/dist/quadtree.js.map +1 -0
- package/dist/ray2-record.d.ts +86 -0
- package/dist/ray2-record.d.ts.map +1 -0
- package/dist/ray2-record.js +123 -0
- package/dist/ray2-record.js.map +1 -0
- package/dist/ray2.d.ts +38 -13
- package/dist/ray2.d.ts.map +1 -1
- package/dist/ray2.js +85 -22
- package/dist/ray2.js.map +1 -1
- package/dist/ray3-array.d.ts +27 -0
- package/dist/ray3-array.d.ts.map +1 -0
- package/dist/ray3-array.js +89 -0
- package/dist/ray3-array.js.map +1 -0
- package/dist/ray3-record.d.ts +90 -0
- package/dist/ray3-record.d.ts.map +1 -0
- package/dist/ray3-record.js +146 -0
- package/dist/ray3-record.js.map +1 -0
- package/dist/ray3.d.ts +72 -25
- package/dist/ray3.d.ts.map +1 -1
- package/dist/ray3.js +233 -64
- package/dist/ray3.js.map +1 -1
- package/dist/segment2-record.d.ts +80 -0
- package/dist/segment2-record.d.ts.map +1 -0
- package/dist/segment2-record.js +122 -0
- package/dist/segment2-record.js.map +1 -0
- package/dist/segment2.d.ts +39 -19
- package/dist/segment2.d.ts.map +1 -1
- package/dist/segment2.js +104 -42
- package/dist/segment2.js.map +1 -1
- package/dist/segment3-record.d.ts +90 -0
- package/dist/segment3-record.d.ts.map +1 -0
- package/dist/segment3-record.js +146 -0
- package/dist/segment3-record.js.map +1 -0
- package/dist/segment3.d.ts +24 -12
- package/dist/segment3.d.ts.map +1 -1
- package/dist/segment3.js +67 -30
- package/dist/segment3.js.map +1 -1
- package/dist/size.d.ts +40 -0
- package/dist/size.d.ts.map +1 -0
- package/dist/size.js +72 -0
- package/dist/size.js.map +1 -0
- package/dist/sphere3-array-boundary.d.ts +51 -0
- package/dist/sphere3-array-boundary.d.ts.map +1 -0
- package/dist/sphere3-array-boundary.js +98 -0
- package/dist/sphere3-array-boundary.js.map +1 -0
- package/dist/sphere3-record.d.ts +88 -0
- package/dist/sphere3-record.d.ts.map +1 -0
- package/dist/sphere3-record.js +123 -0
- package/dist/sphere3-record.js.map +1 -0
- package/dist/sphere3.d.ts +55 -12
- package/dist/sphere3.d.ts.map +1 -1
- package/dist/sphere3.js +233 -24
- package/dist/sphere3.js.map +1 -1
- package/dist/spherical/cap.d.ts +56 -0
- package/dist/spherical/cap.d.ts.map +1 -0
- package/dist/spherical/cap.js +363 -0
- package/dist/spherical/cap.js.map +1 -0
- package/dist/spherical/great-circle.d.ts +39 -0
- package/dist/spherical/great-circle.d.ts.map +1 -0
- package/dist/spherical/great-circle.js +158 -0
- package/dist/spherical/great-circle.js.map +1 -0
- package/dist/spherical/index.d.ts +3 -0
- package/dist/spherical/index.d.ts.map +1 -0
- package/dist/spherical/index.js +3 -0
- package/dist/spherical/index.js.map +1 -0
- package/dist/triangle2-record.d.ts +91 -0
- package/dist/triangle2-record.d.ts.map +1 -0
- package/dist/triangle2-record.js +146 -0
- package/dist/triangle2-record.js.map +1 -0
- package/dist/triangle2.d.ts +29 -14
- package/dist/triangle2.d.ts.map +1 -1
- package/dist/triangle2.js +86 -22
- package/dist/triangle2.js.map +1 -1
- package/dist/triangle3-record.d.ts +97 -0
- package/dist/triangle3-record.d.ts.map +1 -0
- package/dist/triangle3-record.js +178 -0
- package/dist/triangle3-record.js.map +1 -0
- package/dist/triangle3.d.ts +60 -17
- package/dist/triangle3.d.ts.map +1 -1
- package/dist/triangle3.js +287 -38
- package/dist/triangle3.js.map +1 -1
- package/package.json +15 -8
- package/dist/angles.d.ts +0 -31
- package/dist/angles.d.ts.map +0 -1
- package/dist/angles.js +0 -53
- package/dist/angles.js.map +0 -1
- package/dist/coordinate-spaces.d.ts +0 -39
- package/dist/coordinate-spaces.d.ts.map +0 -1
- package/dist/coordinate-spaces.js +0 -52
- package/dist/coordinate-spaces.js.map +0 -1
- package/dist/coordinates-vec2.d.ts +0 -7
- package/dist/coordinates-vec2.d.ts.map +0 -1
- package/dist/coordinates-vec2.js +0 -35
- package/dist/coordinates-vec2.js.map +0 -1
- package/dist/coordinates-vec3.d.ts +0 -11
- package/dist/coordinates-vec3.d.ts.map +0 -1
- package/dist/coordinates-vec3.js +0 -61
- package/dist/coordinates-vec3.js.map +0 -1
- package/dist/coordinates.d.ts +0 -54
- package/dist/coordinates.d.ts.map +0 -1
- package/dist/coordinates.js +0 -2
- package/dist/coordinates.js.map +0 -1
- package/dist/euler-angles-quaternion.d.ts +0 -7
- package/dist/euler-angles-quaternion.d.ts.map +0 -1
- package/dist/euler-angles-quaternion.js +0 -100
- package/dist/euler-angles-quaternion.js.map +0 -1
- package/dist/euler-angles.d.ts +0 -33
- package/dist/euler-angles.d.ts.map +0 -1
- package/dist/euler-angles.js +0 -35
- package/dist/euler-angles.js.map +0 -1
- package/dist/geometry-vectors.d.ts +0 -11
- package/dist/geometry-vectors.d.ts.map +0 -1
- package/dist/geometry-vectors.js +0 -19
- package/dist/geometry-vectors.js.map +0 -1
- package/dist/mesh3.d.ts +0 -32
- package/dist/mesh3.d.ts.map +0 -1
- package/dist/mesh3.js +0 -142
- package/dist/mesh3.js.map +0 -1
- package/dist/point2.d.ts +0 -41
- package/dist/point2.d.ts.map +0 -1
- package/dist/point2.js +0 -92
- package/dist/point2.js.map +0 -1
- package/dist/point3.d.ts +0 -43
- package/dist/point3.d.ts.map +0 -1
- package/dist/point3.js +0 -103
- package/dist/point3.js.map +0 -1
- package/dist/point4.d.ts +0 -12
- package/dist/point4.d.ts.map +0 -1
- package/dist/point4.js +0 -28
- package/dist/point4.js.map +0 -1
- package/dist/rect2.d.ts +0 -54
- package/dist/rect2.d.ts.map +0 -1
- package/dist/rect2.js +0 -149
- package/dist/rect2.js.map +0 -1
- package/dist/size2.d.ts +0 -33
- package/dist/size2.d.ts.map +0 -1
- package/dist/size2.js +0 -81
- package/dist/size2.js.map +0 -1
- package/dist/size3.d.ts +0 -21
- package/dist/size3.d.ts.map +0 -1
- package/dist/size3.js +0 -59
- package/dist/size3.js.map +0 -1
- package/dist/size4.d.ts +0 -10
- package/dist/size4.d.ts.map +0 -1
- package/dist/size4.js +0 -16
- package/dist/size4.js.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReadonlyBox2 } from "./box2-record.js";
|
|
2
|
+
/**
|
|
3
|
+
* The index of the first box that contains the point `(x, y)`, boundary
|
|
4
|
+
* included, or `−1`. O(n).
|
|
5
|
+
*
|
|
6
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
7
|
+
*/
|
|
8
|
+
export declare function box2ArrayFindIndexContainingXy(boxes: Float64Array, x: number, y: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* The index of the last box that contains the point `(x, y)`, boundary
|
|
11
|
+
* included, or `−1`: the topmost one when later boxes are drawn over earlier
|
|
12
|
+
* ones. O(n).
|
|
13
|
+
*
|
|
14
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
15
|
+
*/
|
|
16
|
+
export declare function box2ArrayFindLastIndexContainingXy(boxes: Float64Array, x: number, y: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Writes the index of every box that contains the point `(x, y)` into `out`, in
|
|
19
|
+
* increasing order, and returns how many. O(n).
|
|
20
|
+
*
|
|
21
|
+
* @param out At least as long as the number of boxes.
|
|
22
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4 or `out` is
|
|
23
|
+
* shorter than the number of boxes.
|
|
24
|
+
*/
|
|
25
|
+
export declare function box2ArrayContainingXy(out: Uint32Array, boxes: Float64Array, x: number, y: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* The index of the first box that shares a point with `box`, boundaries
|
|
28
|
+
* included, or `−1`. An empty `box` intersects nothing. O(n).
|
|
29
|
+
*
|
|
30
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
31
|
+
*/
|
|
32
|
+
export declare function box2ArrayFindIndexIntersecting(boxes: Float64Array, box: ReadonlyBox2): number;
|
|
33
|
+
/**
|
|
34
|
+
* Writes the index of every box that shares a point with `box` into `out`, in
|
|
35
|
+
* increasing order, and returns how many. O(n).
|
|
36
|
+
*
|
|
37
|
+
* @param out At least as long as the number of boxes.
|
|
38
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4 or `out` is
|
|
39
|
+
* shorter than the number of boxes.
|
|
40
|
+
*/
|
|
41
|
+
export declare function box2ArrayIntersecting(out: Uint32Array, boxes: Float64Array, box: ReadonlyBox2): number;
|
|
42
|
+
//# sourceMappingURL=box2-array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box2-array.d.ts","sourceRoot":"","sources":["../src/box2-array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAkBrD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,KAAK,EAAE,YAAY,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACP,MAAM,CAaR;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CACjD,KAAK,EAAE,YAAY,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACP,MAAM,CAaR;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,YAAY,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACP,MAAM,CAmBR;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,YAAY,GACf,MAAM,CAsBR;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,YAAY,GACf,MAAM,CA4BR"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hit-tests over packed boxes (`[minX, minY, maxX, maxY]` per box in a
|
|
3
|
+
* `Float64Array`), for UI picking: one pass, no allocation, each index counted
|
|
4
|
+
* in boxes. Every function throws a `RangeError` once, up front, when the
|
|
5
|
+
* buffer is not a whole number of boxes. A box with a `NaN` bound contains and
|
|
6
|
+
* intersects nothing.
|
|
7
|
+
*/
|
|
8
|
+
function assertWholeBoxes_(name, boxes) {
|
|
9
|
+
if (boxes.length % 4 !== 0) {
|
|
10
|
+
throw new RangeError(`${name}: boxes has ${boxes.length} numbers, not a multiple of 4.`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The index of the first box that contains the point `(x, y)`, boundary
|
|
15
|
+
* included, or `−1`. O(n).
|
|
16
|
+
*
|
|
17
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
18
|
+
*/
|
|
19
|
+
export function box2ArrayFindIndexContainingXy(boxes, x, y) {
|
|
20
|
+
assertWholeBoxes_("box2ArrayFindIndexContainingXy", boxes);
|
|
21
|
+
for (let offset = 0; offset < boxes.length; offset += 4) {
|
|
22
|
+
if (x >= boxes[offset] &&
|
|
23
|
+
x <= boxes[offset + 2] &&
|
|
24
|
+
y >= boxes[offset + 1] &&
|
|
25
|
+
y <= boxes[offset + 3]) {
|
|
26
|
+
return offset / 4;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return -1;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The index of the last box that contains the point `(x, y)`, boundary
|
|
33
|
+
* included, or `−1`: the topmost one when later boxes are drawn over earlier
|
|
34
|
+
* ones. O(n).
|
|
35
|
+
*
|
|
36
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
37
|
+
*/
|
|
38
|
+
export function box2ArrayFindLastIndexContainingXy(boxes, x, y) {
|
|
39
|
+
assertWholeBoxes_("box2ArrayFindLastIndexContainingXy", boxes);
|
|
40
|
+
for (let offset = boxes.length - 4; offset >= 0; offset -= 4) {
|
|
41
|
+
if (x >= boxes[offset] &&
|
|
42
|
+
x <= boxes[offset + 2] &&
|
|
43
|
+
y >= boxes[offset + 1] &&
|
|
44
|
+
y <= boxes[offset + 3]) {
|
|
45
|
+
return offset / 4;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return -1;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Writes the index of every box that contains the point `(x, y)` into `out`, in
|
|
52
|
+
* increasing order, and returns how many. O(n).
|
|
53
|
+
*
|
|
54
|
+
* @param out At least as long as the number of boxes.
|
|
55
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4 or `out` is
|
|
56
|
+
* shorter than the number of boxes.
|
|
57
|
+
*/
|
|
58
|
+
export function box2ArrayContainingXy(out, boxes, x, y) {
|
|
59
|
+
assertWholeBoxes_("box2ArrayContainingXy", boxes);
|
|
60
|
+
if (out.length < boxes.length / 4) {
|
|
61
|
+
throw new RangeError(`box2ArrayContainingXy: out holds ${out.length} indices for ${boxes.length / 4} boxes.`);
|
|
62
|
+
}
|
|
63
|
+
let count = 0;
|
|
64
|
+
for (let offset = 0; offset < boxes.length; offset += 4) {
|
|
65
|
+
if (x >= boxes[offset] &&
|
|
66
|
+
x <= boxes[offset + 2] &&
|
|
67
|
+
y >= boxes[offset + 1] &&
|
|
68
|
+
y <= boxes[offset + 3]) {
|
|
69
|
+
out[count++] = offset / 4;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return count;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The index of the first box that shares a point with `box`, boundaries
|
|
76
|
+
* included, or `−1`. An empty `box` intersects nothing. O(n).
|
|
77
|
+
*
|
|
78
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
79
|
+
*/
|
|
80
|
+
export function box2ArrayFindIndexIntersecting(boxes, box) {
|
|
81
|
+
assertWholeBoxes_("box2ArrayFindIndexIntersecting", boxes);
|
|
82
|
+
const minX = box[0];
|
|
83
|
+
const minY = box[1];
|
|
84
|
+
const maxX = box[2];
|
|
85
|
+
const maxY = box[3];
|
|
86
|
+
if (!(minX <= maxX && minY <= maxY)) {
|
|
87
|
+
return -1;
|
|
88
|
+
}
|
|
89
|
+
for (let offset = 0; offset < boxes.length; offset += 4) {
|
|
90
|
+
if (boxes[offset] <= maxX &&
|
|
91
|
+
minX <= boxes[offset + 2] &&
|
|
92
|
+
boxes[offset + 1] <= maxY &&
|
|
93
|
+
minY <= boxes[offset + 3] &&
|
|
94
|
+
boxes[offset] <= boxes[offset + 2] &&
|
|
95
|
+
boxes[offset + 1] <= boxes[offset + 3]) {
|
|
96
|
+
return offset / 4;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return -1;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Writes the index of every box that shares a point with `box` into `out`, in
|
|
103
|
+
* increasing order, and returns how many. O(n).
|
|
104
|
+
*
|
|
105
|
+
* @param out At least as long as the number of boxes.
|
|
106
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4 or `out` is
|
|
107
|
+
* shorter than the number of boxes.
|
|
108
|
+
*/
|
|
109
|
+
export function box2ArrayIntersecting(out, boxes, box) {
|
|
110
|
+
assertWholeBoxes_("box2ArrayIntersecting", boxes);
|
|
111
|
+
if (out.length < boxes.length / 4) {
|
|
112
|
+
throw new RangeError(`box2ArrayIntersecting: out holds ${out.length} indices for ${boxes.length / 4} boxes.`);
|
|
113
|
+
}
|
|
114
|
+
const minX = box[0];
|
|
115
|
+
const minY = box[1];
|
|
116
|
+
const maxX = box[2];
|
|
117
|
+
const maxY = box[3];
|
|
118
|
+
let count = 0;
|
|
119
|
+
if (!(minX <= maxX && minY <= maxY)) {
|
|
120
|
+
return count;
|
|
121
|
+
}
|
|
122
|
+
for (let offset = 0; offset < boxes.length; offset += 4) {
|
|
123
|
+
if (boxes[offset] <= maxX &&
|
|
124
|
+
minX <= boxes[offset + 2] &&
|
|
125
|
+
boxes[offset + 1] <= maxY &&
|
|
126
|
+
minY <= boxes[offset + 3] &&
|
|
127
|
+
boxes[offset] <= boxes[offset + 2] &&
|
|
128
|
+
boxes[offset + 1] <= boxes[offset + 3]) {
|
|
129
|
+
out[count++] = offset / 4;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return count;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=box2-array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box2-array.js","sourceRoot":"","sources":["../src/box2-array.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,SAAS,iBAAiB,CAAC,IAAY,EAAE,KAAmB;IAC3D,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,UAAU,CACnB,GAAG,IAAI,eAAe,KAAK,CAAC,MAAM,gCAAgC,CAClE,CAAC;IACH,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC7C,KAAmB,EACnB,CAAS,EACT,CAAS;IAET,iBAAiB,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;IAC3D,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,CAAC;QACzD,IACC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAE;YACnB,CAAC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IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE;YAC1B,KAAK,CAAC,MAAM,CAAE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE;YACpC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,EACvC,CAAC;YACF,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ReadonlyVec2, Vec2 } from "@ac-kit/math-linear";
|
|
2
|
+
import type { ReadonlyBox2, Box2 } from "./box2-record.js";
|
|
3
|
+
/**
|
|
4
|
+
* Writes the empty box into `out`: `+∞` minima and `−∞` maxima, so that the
|
|
5
|
+
* union with any box is that box and nothing intersects it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function box2Empty(out: Box2): Box2;
|
|
8
|
+
/**
|
|
9
|
+
* Writes the box of the given `center` and `size` (the full extent on each
|
|
10
|
+
* axis) into `out`. A negative size gives an empty box.
|
|
11
|
+
*/
|
|
12
|
+
export declare function box2FromCenterSize(out: Box2, center: ReadonlyVec2, size: ReadonlyVec2): Box2;
|
|
13
|
+
/** Writes the box spanned by any two opposite corners into `out`. */
|
|
14
|
+
export declare function box2FromCorners(out: Box2, a: ReadonlyVec2, b: ReadonlyVec2): Box2;
|
|
15
|
+
/**
|
|
16
|
+
* Writes the bounds of the 2-number points of `points` into `out`; an empty
|
|
17
|
+
* buffer gives the empty box. A point with a `NaN` component leaves that axis
|
|
18
|
+
* to the other points. O(n).
|
|
19
|
+
*
|
|
20
|
+
* @throws {RangeError} When `points.length` is not a multiple of 2.
|
|
21
|
+
*/
|
|
22
|
+
export declare function box2FromPoints(out: Box2, points: Float64Array): Box2;
|
|
23
|
+
/**
|
|
24
|
+
* Like {@link box2FromPoints} for interleaved data: point `i` starts at `offset +
|
|
25
|
+
* i·stride`, both counted in numbers, for `count` points. O(count).
|
|
26
|
+
*
|
|
27
|
+
* @throws {RangeError} When `count` is not a non-negative integer or the last
|
|
28
|
+
* point does not fit in `points`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function box2FromPointsStrided(out: Box2, points: Float64Array, offset: number, stride: number, count: number): Box2;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the box has a minimum above its maximum on some axis. `NaN` is not
|
|
33
|
+
* above anything.
|
|
34
|
+
*/
|
|
35
|
+
export declare function box2IsEmpty(box: ReadonlyBox2): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Writes the extent of the box on each axis, `max − min`, into `out`. An empty
|
|
38
|
+
* box gives negative extents.
|
|
39
|
+
*/
|
|
40
|
+
export declare function box2Size(out: Vec2, box: ReadonlyBox2): Vec2;
|
|
41
|
+
/**
|
|
42
|
+
* Writes the centre of the box into `out`. An empty box gives `NaN` where a
|
|
43
|
+
* bound is infinite.
|
|
44
|
+
*/
|
|
45
|
+
export declare function box2Center(out: Vec2, box: ReadonlyBox2): Vec2;
|
|
46
|
+
/** Whether `point` lies in the box, boundary included. */
|
|
47
|
+
export declare function box2ContainsPoint(box: ReadonlyBox2, point: ReadonlyVec2): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether `inner` lies in the box, boundary included. An empty `inner` is
|
|
50
|
+
* contained in any box.
|
|
51
|
+
*/
|
|
52
|
+
export declare function box2ContainsBox2(box: ReadonlyBox2, inner: ReadonlyBox2): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the two boxes share a point, boundaries included. An empty box (an
|
|
55
|
+
* inverted axis) intersects nothing.
|
|
56
|
+
*/
|
|
57
|
+
export declare function box2IntersectsBox2(a: ReadonlyBox2, b: ReadonlyBox2): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Writes the common part of two boxes into `out`; disjoint boxes give an empty
|
|
60
|
+
* box ({@link box2IsEmpty}).
|
|
61
|
+
*/
|
|
62
|
+
export declare function box2Intersection(out: Box2, a: ReadonlyBox2, b: ReadonlyBox2): Box2;
|
|
63
|
+
/**
|
|
64
|
+
* Writes the smallest box holding both boxes into `out`; an empty box (an
|
|
65
|
+
* inverted axis) adds nothing, and two empty boxes give {@link box2Empty}. `out`
|
|
66
|
+
* may be `a` or `b`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function box2Union(out: Box2, a: ReadonlyBox2, b: ReadonlyBox2): Box2;
|
|
69
|
+
/** Writes the smallest box holding `box` and `point` into `out`. */
|
|
70
|
+
export declare function box2ExpandByPoint(out: Box2, box: ReadonlyBox2, point: ReadonlyVec2): Box2;
|
|
71
|
+
/**
|
|
72
|
+
* Writes `box` grown by `margin` on every side into `out`; a negative margin
|
|
73
|
+
* insets and may empty the box.
|
|
74
|
+
*/
|
|
75
|
+
export declare function box2ExpandByScalar(out: Box2, box: ReadonlyBox2, margin: number): Box2;
|
|
76
|
+
/** Writes `box` moved by `offset` into `out`. */
|
|
77
|
+
export declare function box2Translate(out: Box2, box: ReadonlyBox2, offset: ReadonlyVec2): Box2;
|
|
78
|
+
/**
|
|
79
|
+
* Writes the point of the box nearest to `point` into `out`; `out` may be
|
|
80
|
+
* `point`. An empty box gives an unspecified point.
|
|
81
|
+
*/
|
|
82
|
+
export declare function box2ClampPoint(out: Vec2, box: ReadonlyBox2, point: ReadonlyVec2): Vec2;
|
|
83
|
+
/** The distance from `point` to the box: `0` inside or on it. */
|
|
84
|
+
export declare function box2DistanceToPoint(box: ReadonlyBox2, point: ReadonlyVec2): number;
|
|
85
|
+
/**
|
|
86
|
+
* Writes the bounds interpolated from `a` (`t = 0`) to `b` (`t = 1`, exact)
|
|
87
|
+
* into `out`. Not math-scalar's `lerp`, which is `a + (b − a)·t` and misses `b`
|
|
88
|
+
* by rounding at `t = 1`.
|
|
89
|
+
*/
|
|
90
|
+
export declare function box2Lerp(out: Box2, a: ReadonlyBox2, b: ReadonlyBox2, t: number): Box2;
|
|
91
|
+
/**
|
|
92
|
+
* Writes the coordinates of `point` inside the box, `0` at the minimum corner
|
|
93
|
+
* and `1` at the maximum, into `out`: the inverse of {@link box2PointAt}. A flat
|
|
94
|
+
* axis gives non-finite coordinates.
|
|
95
|
+
*/
|
|
96
|
+
export declare function box2Parameter(out: Vec2, box: ReadonlyBox2, point: ReadonlyVec2): Vec2;
|
|
97
|
+
/**
|
|
98
|
+
* Writes the point of the box at `parameter` (`0` at the minimum corner, `1` at
|
|
99
|
+
* the maximum) into `out`.
|
|
100
|
+
*/
|
|
101
|
+
export declare function box2PointAt(out: Vec2, box: ReadonlyBox2, parameter: ReadonlyVec2): Vec2;
|
|
102
|
+
/**
|
|
103
|
+
* Writes the union of every box of `boxes` (4 numbers each) into `out`; an
|
|
104
|
+
* empty buffer, or one of empty (inverted) boxes only, gives the empty box.
|
|
105
|
+
* O(n).
|
|
106
|
+
*
|
|
107
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
108
|
+
*/
|
|
109
|
+
export declare function box2ArrayUnion(out: Box2, boxes: Float64Array): Box2;
|
|
110
|
+
//# sourceMappingURL=box2-componentwise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box2-componentwise.d.ts","sourceRoot":"","sources":["../src/box2-componentwise.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAMzC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,YAAY,GAChB,IAAI,CAMN;AAED,qEAAqE;AACrE,wBAAgB,eAAe,CAC9B,GAAG,EAAE,IAAI,EACT,CAAC,EAAE,YAAY,EACf,C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B,KAAK,EAAE,YAAY,GACjB,IAAI,CAMN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,GACZ,IAAI,CAMN;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAC5B,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,YAAY,GAClB,IAAI,CAMN;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,YAAY,GACjB,IAAI,CAIN;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,YAAY,GACjB,MAAM,CAIR;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACvB,GAAG,EAAE,IAAI,EACT,CAAC,EAAE,YAAY,EACf,CAAC,EAAE,YAAY,EACf,CAAC,EAAE,MAAM,GACP,IAAI,CAgBN;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,YAAY,GACjB,IAAI,CAIN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,YAAY,GACrB,IAAI,CAIN;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CA4BnE"}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
// Generated from scripts/templates/box-componentwise.liquid by scripts/generate-records.ts. Do not edit.
|
|
2
|
+
import { inverseLerp, lerp } from "@ac-kit/math-scalar";
|
|
3
|
+
/**
|
|
4
|
+
* Writes the empty box into `out`: `+∞` minima and `−∞` maxima, so that the
|
|
5
|
+
* union with any box is that box and nothing intersects it.
|
|
6
|
+
*/
|
|
7
|
+
export function box2Empty(out) {
|
|
8
|
+
out[0] = Number.POSITIVE_INFINITY;
|
|
9
|
+
out[1] = Number.POSITIVE_INFINITY;
|
|
10
|
+
out[2] = Number.NEGATIVE_INFINITY;
|
|
11
|
+
out[3] = Number.NEGATIVE_INFINITY;
|
|
12
|
+
return out;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Writes the box of the given `center` and `size` (the full extent on each
|
|
16
|
+
* axis) into `out`. A negative size gives an empty box.
|
|
17
|
+
*/
|
|
18
|
+
export function box2FromCenterSize(out, center, size) {
|
|
19
|
+
out[0] = center[0] - size[0] / 2;
|
|
20
|
+
out[2] = center[0] + size[0] / 2;
|
|
21
|
+
out[1] = center[1] - size[1] / 2;
|
|
22
|
+
out[3] = center[1] + size[1] / 2;
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
/** Writes the box spanned by any two opposite corners into `out`. */
|
|
26
|
+
export function box2FromCorners(out, a, b) {
|
|
27
|
+
out[0] = Math.min(a[0], b[0]);
|
|
28
|
+
out[2] = Math.max(a[0], b[0]);
|
|
29
|
+
out[1] = Math.min(a[1], b[1]);
|
|
30
|
+
out[3] = Math.max(a[1], b[1]);
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Writes the bounds of the 2-number points of `points` into `out`; an empty
|
|
35
|
+
* buffer gives the empty box. A point with a `NaN` component leaves that axis
|
|
36
|
+
* to the other points. O(n).
|
|
37
|
+
*
|
|
38
|
+
* @throws {RangeError} When `points.length` is not a multiple of 2.
|
|
39
|
+
*/
|
|
40
|
+
export function box2FromPoints(out, points) {
|
|
41
|
+
const length = points.length;
|
|
42
|
+
if (length % 2 !== 0) {
|
|
43
|
+
throw new RangeError(`box2FromPoints: points has ${length} numbers, not a multiple of 2.`);
|
|
44
|
+
}
|
|
45
|
+
let min0 = Number.POSITIVE_INFINITY;
|
|
46
|
+
let max0 = Number.NEGATIVE_INFINITY;
|
|
47
|
+
let min1 = Number.POSITIVE_INFINITY;
|
|
48
|
+
let max1 = Number.NEGATIVE_INFINITY;
|
|
49
|
+
for (let index = 0; index < length; index += 2) {
|
|
50
|
+
const value0 = points[index];
|
|
51
|
+
if (value0 < min0) {
|
|
52
|
+
min0 = value0;
|
|
53
|
+
}
|
|
54
|
+
if (value0 > max0) {
|
|
55
|
+
max0 = value0;
|
|
56
|
+
}
|
|
57
|
+
const value1 = points[index + 1];
|
|
58
|
+
if (value1 < min1) {
|
|
59
|
+
min1 = value1;
|
|
60
|
+
}
|
|
61
|
+
if (value1 > max1) {
|
|
62
|
+
max1 = value1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
out[0] = min0;
|
|
66
|
+
out[2] = max0;
|
|
67
|
+
out[1] = min1;
|
|
68
|
+
out[3] = max1;
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Like {@link box2FromPoints} for interleaved data: point `i` starts at `offset +
|
|
73
|
+
* i·stride`, both counted in numbers, for `count` points. O(count).
|
|
74
|
+
*
|
|
75
|
+
* @throws {RangeError} When `count` is not a non-negative integer or the last
|
|
76
|
+
* point does not fit in `points`.
|
|
77
|
+
*/
|
|
78
|
+
export function box2FromPointsStrided(out, points, offset, stride, count) {
|
|
79
|
+
if (!Number.isInteger(count) ||
|
|
80
|
+
count < 0 ||
|
|
81
|
+
(count > 0 &&
|
|
82
|
+
!(offset >= 0 &&
|
|
83
|
+
stride >= 0 &&
|
|
84
|
+
offset + (count - 1) * stride + 2 <= points.length))) {
|
|
85
|
+
throw new RangeError(`box2FromPointsStrided: ${count} points at offset ${offset} and stride ${stride} do not fit in ${points.length} numbers.`);
|
|
86
|
+
}
|
|
87
|
+
let min0 = Number.POSITIVE_INFINITY;
|
|
88
|
+
let max0 = Number.NEGATIVE_INFINITY;
|
|
89
|
+
let min1 = Number.POSITIVE_INFINITY;
|
|
90
|
+
let max1 = Number.NEGATIVE_INFINITY;
|
|
91
|
+
for (let point = 0, index = offset; point < count; point++, index += stride) {
|
|
92
|
+
const value0 = points[index];
|
|
93
|
+
if (value0 < min0) {
|
|
94
|
+
min0 = value0;
|
|
95
|
+
}
|
|
96
|
+
if (value0 > max0) {
|
|
97
|
+
max0 = value0;
|
|
98
|
+
}
|
|
99
|
+
const value1 = points[index + 1];
|
|
100
|
+
if (value1 < min1) {
|
|
101
|
+
min1 = value1;
|
|
102
|
+
}
|
|
103
|
+
if (value1 > max1) {
|
|
104
|
+
max1 = value1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
out[0] = min0;
|
|
108
|
+
out[2] = max0;
|
|
109
|
+
out[1] = min1;
|
|
110
|
+
out[3] = max1;
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Whether the box has a minimum above its maximum on some axis. `NaN` is not
|
|
115
|
+
* above anything.
|
|
116
|
+
*/
|
|
117
|
+
export function box2IsEmpty(box) {
|
|
118
|
+
return box[0] > box[2] || box[1] > box[3];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Writes the extent of the box on each axis, `max − min`, into `out`. An empty
|
|
122
|
+
* box gives negative extents.
|
|
123
|
+
*/
|
|
124
|
+
export function box2Size(out, box) {
|
|
125
|
+
out[0] = box[2] - box[0];
|
|
126
|
+
out[1] = box[3] - box[1];
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Writes the centre of the box into `out`. An empty box gives `NaN` where a
|
|
131
|
+
* bound is infinite.
|
|
132
|
+
*/
|
|
133
|
+
export function box2Center(out, box) {
|
|
134
|
+
out[0] = (box[0] + box[2]) / 2;
|
|
135
|
+
out[1] = (box[1] + box[3]) / 2;
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
/** Whether `point` lies in the box, boundary included. */
|
|
139
|
+
export function box2ContainsPoint(box, point) {
|
|
140
|
+
return (point[0] >= box[0] &&
|
|
141
|
+
point[0] <= box[2] &&
|
|
142
|
+
point[1] >= box[1] &&
|
|
143
|
+
point[1] <= box[3]);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Whether `inner` lies in the box, boundary included. An empty `inner` is
|
|
147
|
+
* contained in any box.
|
|
148
|
+
*/
|
|
149
|
+
export function box2ContainsBox2(box, inner) {
|
|
150
|
+
return (box2IsEmpty(inner) ||
|
|
151
|
+
(inner[0] >= box[0] &&
|
|
152
|
+
inner[2] <= box[2] &&
|
|
153
|
+
inner[1] >= box[1] &&
|
|
154
|
+
inner[3] <= box[3]));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Whether the two boxes share a point, boundaries included. An empty box (an
|
|
158
|
+
* inverted axis) intersects nothing.
|
|
159
|
+
*/
|
|
160
|
+
export function box2IntersectsBox2(a, b) {
|
|
161
|
+
return (a[0] <= a[2] &&
|
|
162
|
+
b[0] <= b[2] &&
|
|
163
|
+
a[0] <= b[2] &&
|
|
164
|
+
b[0] <= a[2] &&
|
|
165
|
+
a[1] <= a[3] &&
|
|
166
|
+
b[1] <= b[3] &&
|
|
167
|
+
a[1] <= b[3] &&
|
|
168
|
+
b[1] <= a[3]);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Writes the common part of two boxes into `out`; disjoint boxes give an empty
|
|
172
|
+
* box ({@link box2IsEmpty}).
|
|
173
|
+
*/
|
|
174
|
+
export function box2Intersection(out, a, b) {
|
|
175
|
+
out[0] = Math.max(a[0], b[0]);
|
|
176
|
+
out[2] = Math.min(a[2], b[2]);
|
|
177
|
+
out[1] = Math.max(a[1], b[1]);
|
|
178
|
+
out[3] = Math.min(a[3], b[3]);
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Writes the smallest box holding both boxes into `out`; an empty box (an
|
|
183
|
+
* inverted axis) adds nothing, and two empty boxes give {@link box2Empty}. `out`
|
|
184
|
+
* may be `a` or `b`.
|
|
185
|
+
*/
|
|
186
|
+
export function box2Union(out, a, b) {
|
|
187
|
+
if (box2IsEmpty(a)) {
|
|
188
|
+
if (box2IsEmpty(b)) {
|
|
189
|
+
return box2Empty(out);
|
|
190
|
+
}
|
|
191
|
+
out[0] = b[0];
|
|
192
|
+
out[2] = b[2];
|
|
193
|
+
out[1] = b[1];
|
|
194
|
+
out[3] = b[3];
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
if (box2IsEmpty(b)) {
|
|
198
|
+
out[0] = a[0];
|
|
199
|
+
out[2] = a[2];
|
|
200
|
+
out[1] = a[1];
|
|
201
|
+
out[3] = a[3];
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
204
|
+
out[0] = Math.min(a[0], b[0]);
|
|
205
|
+
out[2] = Math.max(a[2], b[2]);
|
|
206
|
+
out[1] = Math.min(a[1], b[1]);
|
|
207
|
+
out[3] = Math.max(a[3], b[3]);
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
/** Writes the smallest box holding `box` and `point` into `out`. */
|
|
211
|
+
export function box2ExpandByPoint(out, box, point) {
|
|
212
|
+
out[0] = Math.min(box[0], point[0]);
|
|
213
|
+
out[2] = Math.max(box[2], point[0]);
|
|
214
|
+
out[1] = Math.min(box[1], point[1]);
|
|
215
|
+
out[3] = Math.max(box[3], point[1]);
|
|
216
|
+
return out;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Writes `box` grown by `margin` on every side into `out`; a negative margin
|
|
220
|
+
* insets and may empty the box.
|
|
221
|
+
*/
|
|
222
|
+
export function box2ExpandByScalar(out, box, margin) {
|
|
223
|
+
out[0] = box[0] - margin;
|
|
224
|
+
out[2] = box[2] + margin;
|
|
225
|
+
out[1] = box[1] - margin;
|
|
226
|
+
out[3] = box[3] + margin;
|
|
227
|
+
return out;
|
|
228
|
+
}
|
|
229
|
+
/** Writes `box` moved by `offset` into `out`. */
|
|
230
|
+
export function box2Translate(out, box, offset) {
|
|
231
|
+
out[0] = box[0] + offset[0];
|
|
232
|
+
out[2] = box[2] + offset[0];
|
|
233
|
+
out[1] = box[1] + offset[1];
|
|
234
|
+
out[3] = box[3] + offset[1];
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Writes the point of the box nearest to `point` into `out`; `out` may be
|
|
239
|
+
* `point`. An empty box gives an unspecified point.
|
|
240
|
+
*/
|
|
241
|
+
export function box2ClampPoint(out, box, point) {
|
|
242
|
+
out[0] = Math.min(Math.max(point[0], box[0]), box[2]);
|
|
243
|
+
out[1] = Math.min(Math.max(point[1], box[1]), box[3]);
|
|
244
|
+
return out;
|
|
245
|
+
}
|
|
246
|
+
/** The distance from `point` to the box: `0` inside or on it. */
|
|
247
|
+
export function box2DistanceToPoint(box, point) {
|
|
248
|
+
const delta0 = Math.max(box[0] - point[0], 0, point[0] - box[2]);
|
|
249
|
+
const delta1 = Math.max(box[1] - point[1], 0, point[1] - box[3]);
|
|
250
|
+
return Math.sqrt(delta0 * delta0 + delta1 * delta1);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Writes the bounds interpolated from `a` (`t = 0`) to `b` (`t = 1`, exact)
|
|
254
|
+
* into `out`. Not math-scalar's `lerp`, which is `a + (b − a)·t` and misses `b`
|
|
255
|
+
* by rounding at `t = 1`.
|
|
256
|
+
*/
|
|
257
|
+
export function box2Lerp(out, a, b, t) {
|
|
258
|
+
// The endpoints are copied: the blend below would give `NaN` for an empty
|
|
259
|
+
// box (`0 · ∞`) and turn `−0` into `+0`.
|
|
260
|
+
if (t === 0 || t === 1) {
|
|
261
|
+
const source = t === 0 ? a : b;
|
|
262
|
+
out[0] = source[0];
|
|
263
|
+
out[2] = source[2];
|
|
264
|
+
out[1] = source[1];
|
|
265
|
+
out[3] = source[3];
|
|
266
|
+
return out;
|
|
267
|
+
}
|
|
268
|
+
out[0] = a[0] * (1 - t) + b[0] * t;
|
|
269
|
+
out[2] = a[2] * (1 - t) + b[2] * t;
|
|
270
|
+
out[1] = a[1] * (1 - t) + b[1] * t;
|
|
271
|
+
out[3] = a[3] * (1 - t) + b[3] * t;
|
|
272
|
+
return out;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Writes the coordinates of `point` inside the box, `0` at the minimum corner
|
|
276
|
+
* and `1` at the maximum, into `out`: the inverse of {@link box2PointAt}. A flat
|
|
277
|
+
* axis gives non-finite coordinates.
|
|
278
|
+
*/
|
|
279
|
+
export function box2Parameter(out, box, point) {
|
|
280
|
+
out[0] = inverseLerp(box[0], box[2], point[0]);
|
|
281
|
+
out[1] = inverseLerp(box[1], box[3], point[1]);
|
|
282
|
+
return out;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Writes the point of the box at `parameter` (`0` at the minimum corner, `1` at
|
|
286
|
+
* the maximum) into `out`.
|
|
287
|
+
*/
|
|
288
|
+
export function box2PointAt(out, box, parameter) {
|
|
289
|
+
out[0] = lerp(box[0], box[2], parameter[0]);
|
|
290
|
+
out[1] = lerp(box[1], box[3], parameter[1]);
|
|
291
|
+
return out;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Writes the union of every box of `boxes` (4 numbers each) into `out`; an
|
|
295
|
+
* empty buffer, or one of empty (inverted) boxes only, gives the empty box.
|
|
296
|
+
* O(n).
|
|
297
|
+
*
|
|
298
|
+
* @throws {RangeError} When `boxes.length` is not a multiple of 4.
|
|
299
|
+
*/
|
|
300
|
+
export function box2ArrayUnion(out, boxes) {
|
|
301
|
+
const length = boxes.length;
|
|
302
|
+
if (length % 4 !== 0) {
|
|
303
|
+
throw new RangeError(`box2ArrayUnion: boxes has ${length} numbers, not a multiple of 4.`);
|
|
304
|
+
}
|
|
305
|
+
let min0 = Number.POSITIVE_INFINITY;
|
|
306
|
+
let max0 = Number.NEGATIVE_INFINITY;
|
|
307
|
+
let min1 = Number.POSITIVE_INFINITY;
|
|
308
|
+
let max1 = Number.NEGATIVE_INFINITY;
|
|
309
|
+
for (let index = 0; index < length; index += 4) {
|
|
310
|
+
if (boxes[index] > boxes[index + 2] ||
|
|
311
|
+
boxes[index + 1] > boxes[index + 3]) {
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
min0 = Math.min(min0, boxes[index]);
|
|
315
|
+
max0 = Math.max(max0, boxes[index + 2]);
|
|
316
|
+
min1 = Math.min(min1, boxes[index + 1]);
|
|
317
|
+
max1 = Math.max(max1, boxes[index + 3]);
|
|
318
|
+
}
|
|
319
|
+
out[0] = min0;
|
|
320
|
+
out[2] = max0;
|
|
321
|
+
out[1] = min1;
|
|
322
|
+
out[3] = max1;
|
|
323
|
+
return out;
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=box2-componentwise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box2-componentwise.js","sourceRoot":"","sources":["../src/box2-componentwise.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAGzG,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAIxD;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,GAAS;IAClC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAClC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAClC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAClC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAClC,OAAO,GAAG,CAAC;AACZ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CACjC,GAAS,EACT,MAAoB,EACpB,IAAkB;IAElB,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,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