@math.gl/culling 3.5.6 → 3.6.0-alpha.2
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/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +8 -0
- package/dist/es5/constants.js +7 -5
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/index.js +0 -12
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/algorithms/bounding-box-from-points.js.map +1 -1
- package/dist/es5/lib/algorithms/bounding-sphere-from-points.js.map +1 -1
- package/dist/es5/lib/algorithms/compute-eigen-decomposition.js.map +1 -1
- package/dist/es5/lib/bounding-volumes/axis-aligned-bounding-box.js +12 -6
- package/dist/es5/lib/bounding-volumes/axis-aligned-bounding-box.js.map +1 -1
- package/dist/es5/lib/bounding-volumes/bounding-sphere.js +8 -4
- package/dist/es5/lib/bounding-volumes/bounding-sphere.js.map +1 -1
- package/dist/es5/lib/bounding-volumes/bounding-volume.js +2 -0
- package/dist/es5/lib/bounding-volumes/bounding-volume.js.map +1 -0
- package/dist/es5/lib/bounding-volumes/oriented-bounding-box.js +4 -0
- package/dist/es5/lib/bounding-volumes/oriented-bounding-box.js.map +1 -1
- package/dist/es5/lib/culling-volume.js +6 -20
- package/dist/es5/lib/culling-volume.js.map +1 -1
- package/dist/es5/lib/perspective-frustum.js +17 -7
- package/dist/es5/lib/perspective-frustum.js.map +1 -1
- package/dist/es5/lib/perspective-off-center-frustum.js +17 -5
- package/dist/es5/lib/perspective-off-center-frustum.js.map +1 -1
- package/dist/es5/lib/plane.js +5 -1
- package/dist/es5/lib/plane.js.map +1 -1
- package/dist/esm/constants.js +7 -5
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/algorithms/bounding-box-from-points.js.map +1 -1
- package/dist/esm/lib/algorithms/bounding-sphere-from-points.js.map +1 -1
- package/dist/esm/lib/algorithms/compute-eigen-decomposition.js.map +1 -1
- package/dist/esm/lib/bounding-volumes/axis-aligned-bounding-box.js +15 -6
- package/dist/esm/lib/bounding-volumes/axis-aligned-bounding-box.js.map +1 -1
- package/dist/esm/lib/bounding-volumes/bounding-sphere.js +9 -4
- package/dist/esm/lib/bounding-volumes/bounding-sphere.js.map +1 -1
- package/dist/esm/lib/bounding-volumes/bounding-volume.js +2 -0
- package/dist/esm/lib/bounding-volumes/bounding-volume.js.map +1 -0
- package/dist/esm/lib/bounding-volumes/oriented-bounding-box.js +5 -0
- package/dist/esm/lib/bounding-volumes/oriented-bounding-box.js.map +1 -1
- package/dist/esm/lib/culling-volume.js +10 -16
- package/dist/esm/lib/culling-volume.js.map +1 -1
- package/dist/esm/lib/perspective-frustum.js +31 -5
- package/dist/esm/lib/perspective-frustum.js.map +1 -1
- package/dist/esm/lib/perspective-off-center-frustum.js +31 -3
- package/dist/esm/lib/perspective-off-center-frustum.js.map +1 -1
- package/dist/esm/lib/plane.js +6 -1
- package/dist/esm/lib/plane.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/{src → dist}/lib/algorithms/bounding-box-from-points.d.ts +3 -10
- package/dist/lib/algorithms/bounding-box-from-points.d.ts.map +1 -0
- package/dist/lib/algorithms/bounding-box-from-points.js +131 -0
- package/dist/{esm/lib → lib}/algorithms/bounding-sphere-from-points.d.ts +2 -5
- package/dist/lib/algorithms/bounding-sphere-from-points.d.ts.map +1 -0
- package/dist/lib/algorithms/bounding-sphere-from-points.js +140 -0
- package/dist/{es5/lib → lib}/algorithms/compute-eigen-decomposition.d.ts +7 -9
- package/dist/lib/algorithms/compute-eigen-decomposition.d.ts.map +1 -0
- package/dist/lib/algorithms/compute-eigen-decomposition.js +131 -0
- package/dist/lib/bounding-volumes/axis-aligned-bounding-box.d.ts +56 -0
- package/dist/lib/bounding-volumes/axis-aligned-bounding-box.d.ts.map +1 -0
- package/dist/lib/bounding-volumes/axis-aligned-bounding-box.js +111 -0
- package/dist/lib/bounding-volumes/bounding-sphere.d.ts +40 -0
- package/dist/lib/bounding-volumes/bounding-sphere.d.ts.map +1 -0
- package/dist/lib/bounding-volumes/bounding-sphere.js +118 -0
- package/dist/lib/bounding-volumes/bounding-volume.d.ts +30 -0
- package/dist/lib/bounding-volumes/bounding-volume.d.ts.map +1 -0
- package/dist/lib/bounding-volumes/bounding-volume.js +1 -0
- package/dist/lib/bounding-volumes/oriented-bounding-box.d.ts +67 -0
- package/dist/lib/bounding-volumes/oriented-bounding-box.d.ts.map +1 -0
- package/dist/lib/bounding-volumes/oriented-bounding-box.js +256 -0
- package/dist/lib/culling-volume.d.ts +46 -0
- package/dist/lib/culling-volume.d.ts.map +1 -0
- package/dist/lib/culling-volume.js +121 -0
- package/dist/lib/perspective-frustum.d.ts +140 -0
- package/dist/lib/perspective-frustum.d.ts.map +1 -0
- package/dist/lib/perspective-frustum.js +205 -0
- package/dist/lib/perspective-off-center-frustum.d.ts +122 -0
- package/dist/lib/perspective-off-center-frustum.d.ts.map +1 -0
- package/dist/lib/perspective-off-center-frustum.js +305 -0
- package/dist/lib/plane.d.ts +26 -0
- package/dist/lib/plane.d.ts.map +1 -0
- package/dist/lib/plane.js +63 -0
- package/package.json +5 -5
- package/src/constants.ts +8 -0
- package/src/{index.js → index.ts} +0 -4
- package/src/lib/algorithms/{bounding-box-from-points.js → bounding-box-from-points.ts} +17 -4
- package/src/lib/algorithms/{bounding-sphere-from-points.js → bounding-sphere-from-points.ts} +15 -3
- package/src/lib/algorithms/{compute-eigen-decomposition.js → compute-eigen-decomposition.ts} +40 -1
- package/src/lib/bounding-volumes/{axis-aligned-bounding-box.js → axis-aligned-bounding-box.ts} +45 -14
- package/src/lib/bounding-volumes/{bounding-sphere.js → bounding-sphere.ts} +44 -29
- package/src/lib/bounding-volumes/{bounding-volume.d.ts → bounding-volume.ts} +7 -7
- package/src/lib/bounding-volumes/{oriented-bounding-box.js → oriented-bounding-box.ts} +72 -14
- package/src/lib/{culling-volume.js → culling-volume.ts} +42 -34
- package/src/lib/{perspective-frustum.js → perspective-frustum.ts} +48 -66
- package/src/lib/{perspective-off-center-frustum.js → perspective-off-center-frustum.ts} +24 -14
- package/src/lib/{plane.js → plane.ts} +24 -17
- package/dist/es5/constants.d.ts +0 -6
- package/dist/es5/index.d.ts +0 -20
- package/dist/es5/lib/algorithms/bounding-box-from-points.d.ts +0 -22
- package/dist/es5/lib/algorithms/bounding-sphere-from-points.d.ts +0 -17
- package/dist/es5/lib/bounding-volumes/axis-aligned-bounding-box.d.ts +0 -51
- package/dist/es5/lib/bounding-volumes/bounding-sphere.d.ts +0 -52
- package/dist/es5/lib/bounding-volumes/bounding-volume.d.ts +0 -32
- package/dist/es5/lib/bounding-volumes/oriented-bounding-box.d.ts +0 -83
- package/dist/es5/lib/culling-volume.d.ts +0 -55
- package/dist/es5/lib/plane.d.ts +0 -38
- package/dist/esm/constants.d.ts +0 -6
- package/dist/esm/index.d.ts +0 -20
- package/dist/esm/lib/algorithms/bounding-box-from-points.d.ts +0 -22
- package/dist/esm/lib/algorithms/compute-eigen-decomposition.d.ts +0 -39
- package/dist/esm/lib/bounding-volumes/axis-aligned-bounding-box.d.ts +0 -51
- package/dist/esm/lib/bounding-volumes/bounding-sphere.d.ts +0 -52
- package/dist/esm/lib/bounding-volumes/bounding-volume.d.ts +0 -32
- package/dist/esm/lib/bounding-volumes/oriented-bounding-box.d.ts +0 -83
- package/dist/esm/lib/culling-volume.d.ts +0 -55
- package/dist/esm/lib/plane.d.ts +0 -38
- package/src/constants.d.ts +0 -6
- package/src/constants.js +0 -8
- package/src/index.d.ts +0 -20
- package/src/lib/algorithms/bounding-sphere-from-points.d.ts +0 -17
- package/src/lib/algorithms/compute-eigen-decomposition.d.ts +0 -39
- package/src/lib/bounding-volumes/axis-aligned-bounding-box.d.ts +0 -51
- package/src/lib/bounding-volumes/bounding-sphere.d.ts +0 -52
- package/src/lib/bounding-volumes/oriented-bounding-box.d.ts +0 -83
- package/src/lib/culling-volume.d.ts +0 -55
- package/src/lib/plane.d.ts +0 -38
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {Matrix3} from '@math.gl/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Computes the eigenvectors and eigenvalues of a symmetric matrix.
|
|
5
|
-
*
|
|
6
|
-
* - Returns a diagonal matrix and unitary matrix such that:
|
|
7
|
-
* `matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)`
|
|
8
|
-
* - The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
|
|
9
|
-
* of the unitary matrix are the corresponding eigenvectors.
|
|
10
|
-
* - This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,
|
|
11
|
-
* section 8.4.3 The Classical Jacobi Algorithm
|
|
12
|
-
*
|
|
13
|
-
* @param matrix The 3x3 matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
|
|
14
|
-
* @param result Optional object with unitary and diagonal properties which are matrices onto which to store the result.
|
|
15
|
-
* @returns An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* const a = //... symmetric matrix
|
|
19
|
-
* const result = {
|
|
20
|
-
* unitary : new Matrix3(),
|
|
21
|
-
* diagonal : new Matrix3()
|
|
22
|
-
* };
|
|
23
|
-
* computeEigenDecomposition(a, result);
|
|
24
|
-
*
|
|
25
|
-
* const unitaryTranspose = Matrix3.transpose(result.unitary, new Matrix3());
|
|
26
|
-
* const b = Matrix3.multiply(result.unitary, result.diagonal, new Matrix3());
|
|
27
|
-
* Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
|
|
28
|
-
*
|
|
29
|
-
* const lambda = result.diagonal.getColumn(0, new Vector3()).x; // first eigenvalue
|
|
30
|
-
* const v = result.unitary.getColumn(0, new Vector3()); // first eigenvector
|
|
31
|
-
* const c = v.multiplyByScalar(lambda); // equal to v.transformByMatrix3(a)
|
|
32
|
-
*/
|
|
33
|
-
export default function computeEigenDecomposition(
|
|
34
|
-
matrix: number[],
|
|
35
|
-
result?: object
|
|
36
|
-
): {
|
|
37
|
-
unitary: Matrix3;
|
|
38
|
-
diagonal: Matrix3;
|
|
39
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {BoundingVolume} from './bounding-volume';
|
|
2
|
-
import {Vector3} from '@math.gl/core';
|
|
3
|
-
import Plane from '../plane';
|
|
4
|
-
import {INTERSECTION_ENUM} from '../../constants';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* An axis aligned bounding box - aligned with coordinate axes
|
|
8
|
-
* @see BoundingVolume
|
|
9
|
-
* @see BoundingRectangle
|
|
10
|
-
* @see OrientedBoundingBox
|
|
11
|
-
*/
|
|
12
|
-
export default class AxisAlignedBoundingBox implements BoundingVolume {
|
|
13
|
-
/** The center point of the bounding box. */
|
|
14
|
-
readonly center: Vector3;
|
|
15
|
-
/** The positive half diagonal of the bounding box. */
|
|
16
|
-
readonly halfDiagonal: Vector3;
|
|
17
|
-
/** The minimum point defining the bounding box. [0, 0, 0] for empty box */
|
|
18
|
-
readonly minimum: Vector3;
|
|
19
|
-
/** The maximum point defining the bounding box. [0, 0, 0] for empty box */
|
|
20
|
-
readonly maximum: Vector3;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
|
|
24
|
-
* @param minimum=[0, 0, 0] The minimum point along the x, y, and z axes.
|
|
25
|
-
* @param maximum=[0, 0, 0] The maximum point along the x, y, and z axes.
|
|
26
|
-
* @param center The center of the box; automatically computed if not supplied.
|
|
27
|
-
*/
|
|
28
|
-
constructor(minimum?: readonly number[], maximum?: readonly number[], center?: readonly number[]);
|
|
29
|
-
|
|
30
|
-
/** Duplicates a AxisAlignedBoundingBox instance. */
|
|
31
|
-
clone(): AxisAlignedBoundingBox;
|
|
32
|
-
/** Compares the provided AxisAlignedBoundingBox component wise */
|
|
33
|
-
equals(right: AxisAlignedBoundingBox): boolean;
|
|
34
|
-
|
|
35
|
-
// BoundingVolume interface
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Applies a 4x4 affine transformation matrix to a bounding sphere.
|
|
39
|
-
* @param transform The transformation matrix to apply to the bounding sphere.
|
|
40
|
-
* @returns itself, i.e. the modified BoundingVolume.
|
|
41
|
-
*/
|
|
42
|
-
transform(transform: readonly number[]): this;
|
|
43
|
-
|
|
44
|
-
/** Computes the estimated distance from the closest point on a bounding box to a point. */
|
|
45
|
-
distanceTo(point: readonly number[]): number;
|
|
46
|
-
/** Computes the estimated distance squared from the closest point on a bounding box to a point. */
|
|
47
|
-
distanceSquaredTo(point: readonly number[]): number;
|
|
48
|
-
|
|
49
|
-
/** Determines which side of a plane a box is located. */
|
|
50
|
-
intersectPlane(plane: Plane): INTERSECTION_ENUM;
|
|
51
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {BoundingVolume} from './bounding-volume';
|
|
2
|
-
import {Vector3} from '@math.gl/core';
|
|
3
|
-
import {INTERSECTION_ENUM} from '../../constants';
|
|
4
|
-
import Plane from '../plane';
|
|
5
|
-
|
|
6
|
-
/** A BoundingSphere */
|
|
7
|
-
export default class BoundingSphere implements BoundingVolume {
|
|
8
|
-
center: Vector3;
|
|
9
|
-
radius: number;
|
|
10
|
-
|
|
11
|
-
/** Creates a bounding sphere */
|
|
12
|
-
constructor(center?: readonly number[], radius?: number);
|
|
13
|
-
|
|
14
|
-
/** Sets the bounding sphere from `center` and `radius`. */
|
|
15
|
-
fromCenterRadius(center: readonly number[], radius: number): this;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
|
|
19
|
-
* tightly and fully encompasses the box.
|
|
20
|
-
*/
|
|
21
|
-
fromCornerPoints(corner: readonly number[], oppositeCorner: readonly number[]): this;
|
|
22
|
-
|
|
23
|
-
/** Compares the provided BoundingSphere component wise */
|
|
24
|
-
equals(right: BoundingSphere): boolean;
|
|
25
|
-
|
|
26
|
-
/** Duplicates a BoundingSphere instance. */
|
|
27
|
-
clone(): this;
|
|
28
|
-
|
|
29
|
-
/** Computes a bounding sphere that contains both the left and right bounding spheres. */
|
|
30
|
-
union(boundingSphere: BoundingSphere): this;
|
|
31
|
-
|
|
32
|
-
/** Computes a bounding sphere by enlarging the provided sphere to contain the provided point. */
|
|
33
|
-
expand(point: readonly number[]): this;
|
|
34
|
-
|
|
35
|
-
// BoundingVolume interface
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Applies a 4x4 affine transformation matrix to a bounding sphere.
|
|
39
|
-
* @param sphere The bounding sphere to apply the transformation to.
|
|
40
|
-
* @param transform The transformation matrix to apply to the bounding sphere.
|
|
41
|
-
* @returns self.
|
|
42
|
-
*/
|
|
43
|
-
transform(transform: readonly number[]): this;
|
|
44
|
-
|
|
45
|
-
/** Computes the estimated distance squared from the closest point on a bounding sphere to a point. */
|
|
46
|
-
distanceSquaredTo(point: readonly number[]): number;
|
|
47
|
-
/** Computes the estimated distance from the closest point on a bounding sphere to a point. */
|
|
48
|
-
distanceTo(point: readonly number[]): number;
|
|
49
|
-
|
|
50
|
-
/** Determines which side of a plane a sphere is located. */
|
|
51
|
-
intersectPlane(plane: Plane): INTERSECTION_ENUM;
|
|
52
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// This file is derived from the Cesium math library under Apache 2 license
|
|
2
|
-
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
3
|
-
|
|
4
|
-
import {BoundingVolume} from './bounding-volume';
|
|
5
|
-
import {Vector3, Matrix3, Quaternion} from '@math.gl/core';
|
|
6
|
-
import BoundingSphere from './bounding-sphere';
|
|
7
|
-
import Plane from '../plane';
|
|
8
|
-
import {INTERSECTION_ENUM} from '../../constants';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* An OrientedBoundingBox of some object is a closed and convex cuboid.
|
|
12
|
-
* It can provide a tighter bounding volume than `BoundingSphere` or
|
|
13
|
-
* `AxisAlignedBoundingBox` in many cases.
|
|
14
|
-
*/
|
|
15
|
-
export default class OrientedBoundingBox implements BoundingVolume {
|
|
16
|
-
center: Vector3;
|
|
17
|
-
halfAxes: Matrix3;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* An OrientedBoundingBox of some object is a closed and convex cuboid.
|
|
21
|
-
* It can provide a tighter bounding volume than
|
|
22
|
-
* `BoundingSphere` or `AxisAlignedBoundingBox` in many cases.
|
|
23
|
-
*/
|
|
24
|
-
constructor(center?: readonly number[], halfAxes?: readonly number[]);
|
|
25
|
-
|
|
26
|
-
/** Returns an array with three halfSizes for the bounding box */
|
|
27
|
-
get halfSize(): number[];
|
|
28
|
-
|
|
29
|
-
/** Returns a quaternion describing the orientation of the bounding box */
|
|
30
|
-
get quaternion(): Quaternion;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Create OrientedBoundingBox from quaternion based OBB,
|
|
34
|
-
*/
|
|
35
|
-
fromCenterHalfSizeQuaternion(center: number[], halfSize: number[], quaternion: number[]): OrientedBoundingBox;
|
|
36
|
-
|
|
37
|
-
/** Duplicates a OrientedBoundingBox instance. */
|
|
38
|
-
clone(): OrientedBoundingBox;
|
|
39
|
-
|
|
40
|
-
/** Compares the provided OrientedBoundingBox component wise and returns */
|
|
41
|
-
equals(right: OrientedBoundingBox): boolean;
|
|
42
|
-
|
|
43
|
-
/** Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box. */
|
|
44
|
-
getBoundingSphere(result?: BoundingSphere): BoundingSphere;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The distances calculated by the vector from the center of the bounding box
|
|
48
|
-
* to position projected onto direction.
|
|
49
|
-
*
|
|
50
|
-
* - If you imagine the infinite number of planes with normal direction,
|
|
51
|
-
* this computes the smallest distance to the closest and farthest planes
|
|
52
|
-
* from `position` that intersect the bounding box.
|
|
53
|
-
*
|
|
54
|
-
* @param position The position to calculate the distance from.
|
|
55
|
-
* @param direction The direction from position.
|
|
56
|
-
* @param result An Interval (array of length 2) to store the nearest and farthest distances.
|
|
57
|
-
* @returns Interval (array of length 2) with nearest and farthest distances
|
|
58
|
-
* on the bounding box from position in direction.
|
|
59
|
-
*/
|
|
60
|
-
computePlaneDistances(position: readonly number[], direction: readonly number[], result?: number[]): number[];
|
|
61
|
-
|
|
62
|
-
// BoundingVolume interface
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Applies a 4x4 affine transformation matrix to a bounding sphere.
|
|
66
|
-
* @param transform The transformation matrix to apply to the bounding sphere.
|
|
67
|
-
* @returns itself, i.e. the modified BoundingVolume.
|
|
68
|
-
*/
|
|
69
|
-
transform(transform: readonly number[]): this;
|
|
70
|
-
|
|
71
|
-
/** Computes the estimated distance from the closest point on a bounding box to a point. */
|
|
72
|
-
distanceTo(point: readonly number[]): number;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Computes the estimated distance squared from the closest point
|
|
76
|
-
* on a bounding box to a point.
|
|
77
|
-
* See Geometric Tools for Computer Graphics 10.4.2
|
|
78
|
-
*/
|
|
79
|
-
distanceSquaredTo(point: readonly number[]): number;
|
|
80
|
-
|
|
81
|
-
/** Determines which side of a plane the oriented bounding box is located. */
|
|
82
|
-
intersectPlane(plane: Plane): INTERSECTION_ENUM;
|
|
83
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import {INTERSECTION_ENUM} from '../constants';
|
|
2
|
-
import BoundingSphere from './bounding-volumes/bounding-sphere';
|
|
3
|
-
import Plane from './plane';
|
|
4
|
-
|
|
5
|
-
// A culling volume defined by planes.
|
|
6
|
-
export default class CullingVolume {
|
|
7
|
-
/**
|
|
8
|
-
* For plane masks (as used in {@link CullingVolume#computeVisibilityWithPlaneMask}), this special value
|
|
9
|
-
* represents the case where the object bounding volume is entirely outside the culling volume.
|
|
10
|
-
*/
|
|
11
|
-
static readonly MASK_OUTSIDE: number;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value
|
|
15
|
-
* represents the case where the object bounding volume is entirely inside the culling volume.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
static readonly MASK_INSIDE: number;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value
|
|
22
|
-
* represents the case where the object bounding volume (may) intersect all planes of the culling volume.
|
|
23
|
-
* */
|
|
24
|
-
|
|
25
|
-
static readonly MASK_INDETERMINATE: number;
|
|
26
|
-
|
|
27
|
-
/** Array of clipping planes. */
|
|
28
|
-
readonly planes: Plane[];
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Create a new `CullingVolume` bounded by an array of clipping planed
|
|
32
|
-
* @param planes Array of clipping planes.
|
|
33
|
-
* */
|
|
34
|
-
|
|
35
|
-
constructor(planes?: Plane[]);
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
|
|
39
|
-
* The planes are aligned to the x, y, and z axes in world coordinates.
|
|
40
|
-
*/
|
|
41
|
-
fromBoundingSphere(boundingSphere: BoundingSphere): CullingVolume;
|
|
42
|
-
|
|
43
|
-
/** Determines whether a bounding volume intersects the culling volume. */
|
|
44
|
-
computeVisibility(boundingVolume): INTERSECTION_ENUM;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Determines whether a bounding volume intersects the culling volume.
|
|
48
|
-
*
|
|
49
|
-
* @param parentPlaneMask A bit mask from the boundingVolume's parent's check against the same culling
|
|
50
|
-
* volume, such that if (planeMask & (1 << planeIndex) === 0), for k < 31, then
|
|
51
|
-
* the parent (and therefore this) volume is completely inside plane[planeIndex]
|
|
52
|
-
* and that plane check can be skipped.
|
|
53
|
-
*/
|
|
54
|
-
computeVisibilityWithPlaneMask(boundingVolume: object, parentPlaneMask: number): number;
|
|
55
|
-
}
|
package/src/lib/plane.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// This file is derived from the Cesium math library under Apache 2 license
|
|
2
|
-
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
3
|
-
|
|
4
|
-
import {Vector3} from '@math.gl/core';
|
|
5
|
-
|
|
6
|
-
/** A plane in Hessian Normal Form */
|
|
7
|
-
export default class Plane {
|
|
8
|
-
readonly normal: Vector3;
|
|
9
|
-
readonly distance: number;
|
|
10
|
-
|
|
11
|
-
constructor(normal?: readonly number[], distance?: number);
|
|
12
|
-
|
|
13
|
-
fromNormalDistance(normal: readonly number[], distance: number);
|
|
14
|
-
|
|
15
|
-
/** Creates a plane from a normal and a point on the plane. */
|
|
16
|
-
fromPointNormal(point: readonly number[], normal: readonly number[]);
|
|
17
|
-
|
|
18
|
-
/** Creates a plane from the general equation */
|
|
19
|
-
fromCoefficients(a: number, b: number, c: number, d: number): Plane;
|
|
20
|
-
|
|
21
|
-
/** Duplicates a Plane instance. */
|
|
22
|
-
clone(): Plane;
|
|
23
|
-
|
|
24
|
-
/** Compares the provided Planes by normal and distance */
|
|
25
|
-
equals(right: Plane): Plane;
|
|
26
|
-
|
|
27
|
-
/** Computes the signed shortest distance of a point to a plane.
|
|
28
|
-
* The sign of the distance determines which side of the plane the point is on.
|
|
29
|
-
*/
|
|
30
|
-
getPointDistance(point: readonly number[]): number;
|
|
31
|
-
|
|
32
|
-
/** Transforms the plane by the given transformation matrix. */
|
|
33
|
-
transform(matrix4: readonly number[]): Plane;
|
|
34
|
-
|
|
35
|
-
/** Projects a point onto the plane. */
|
|
36
|
-
projectPointOntoPlane(point: readonly number[], result: Vector3): Vector3;
|
|
37
|
-
projectPointOntoPlane(point: readonly number[], result?: readonly number[]): readonly number[];
|
|
38
|
-
}
|