@math.gl/culling 4.1.0 → 4.2.0-alpha.5

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.
Files changed (54) hide show
  1. package/LICENSE +51 -0
  2. package/README.md +8 -1
  3. package/dist/index.cjs +660 -83
  4. package/dist/index.cjs.map +3 -4
  5. package/dist/index.d.ts +12 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/lib/bounding-volumes/oriented-bounding-box.d.ts +1 -1
  10. package/dist/lib/bounding-volumes/oriented-bounding-box.d.ts.map +1 -1
  11. package/dist/lib/bounding-volumes/oriented-bounding-box.js.map +1 -1
  12. package/dist/lib/plane.d.ts +9 -0
  13. package/dist/lib/plane.d.ts.map +1 -1
  14. package/dist/lib/plane.js +22 -1
  15. package/dist/lib/plane.js.map +1 -1
  16. package/dist/lib/ray.d.ts +13 -0
  17. package/dist/lib/ray.d.ts.map +1 -0
  18. package/dist/lib/ray.js +28 -0
  19. package/dist/lib/ray.js.map +1 -0
  20. package/dist/lib/shapes/box-shape.d.ts +19 -0
  21. package/dist/lib/shapes/box-shape.d.ts.map +1 -0
  22. package/dist/lib/shapes/box-shape.js +69 -0
  23. package/dist/lib/shapes/box-shape.js.map +1 -0
  24. package/dist/lib/shapes/capsule-shape.d.ts +23 -0
  25. package/dist/lib/shapes/capsule-shape.d.ts.map +1 -0
  26. package/dist/lib/shapes/capsule-shape.js +151 -0
  27. package/dist/lib/shapes/capsule-shape.js.map +1 -0
  28. package/dist/lib/shapes/cylinder-shape.d.ts +22 -0
  29. package/dist/lib/shapes/cylinder-shape.d.ts.map +1 -0
  30. package/dist/lib/shapes/cylinder-shape.js +99 -0
  31. package/dist/lib/shapes/cylinder-shape.js.map +1 -0
  32. package/dist/lib/shapes/implicit-shape.d.ts +55 -0
  33. package/dist/lib/shapes/implicit-shape.d.ts.map +1 -0
  34. package/dist/lib/shapes/implicit-shape.js +143 -0
  35. package/dist/lib/shapes/implicit-shape.js.map +1 -0
  36. package/dist/lib/shapes/plane-shape.d.ts +26 -0
  37. package/dist/lib/shapes/plane-shape.d.ts.map +1 -0
  38. package/dist/lib/shapes/plane-shape.js +72 -0
  39. package/dist/lib/shapes/plane-shape.js.map +1 -0
  40. package/dist/lib/shapes/sphere-shape.d.ts +18 -0
  41. package/dist/lib/shapes/sphere-shape.d.ts.map +1 -0
  42. package/dist/lib/shapes/sphere-shape.js +43 -0
  43. package/dist/lib/shapes/sphere-shape.js.map +1 -0
  44. package/package.json +4 -4
  45. package/src/index.ts +13 -0
  46. package/src/lib/bounding-volumes/oriented-bounding-box.ts +2 -1
  47. package/src/lib/plane.ts +28 -1
  48. package/src/lib/ray.ts +31 -0
  49. package/src/lib/shapes/box-shape.ts +78 -0
  50. package/src/lib/shapes/capsule-shape.ts +232 -0
  51. package/src/lib/shapes/cylinder-shape.ts +133 -0
  52. package/src/lib/shapes/implicit-shape.ts +209 -0
  53. package/src/lib/shapes/plane-shape.ts +78 -0
  54. package/src/lib/shapes/sphere-shape.ts +60 -0
package/LICENSE CHANGED
@@ -22,6 +22,33 @@ THE SOFTWARE.
22
22
 
23
23
  ---
24
24
 
25
+ Some primitive tessellation approaches were originally inspired by the TDL WebGL samples under
26
+ the New BSD License:
27
+
28
+ Copyright (c) 2011, Google Inc. All rights reserved.
29
+
30
+ Redistribution and use in source and binary forms, with or without modification, are permitted
31
+ provided that the following conditions are met:
32
+
33
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions
34
+ and the following disclaimer.
35
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of
36
+ conditions and the following disclaimer in the documentation and/or other materials provided
37
+ with the distribution.
38
+ 3. Neither the name of Google Inc. nor the names of its contributors may be used to endorse or
39
+ promote products derived from this software without specific prior written permission.
40
+
41
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
42
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
43
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
44
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
47
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
+
50
+ ---
51
+
25
52
  math.gl builds on docs and code from "gl-matrix", which is MIT licensed as follows:
26
53
 
27
54
  Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
@@ -87,3 +114,27 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87
114
  See the License for the specific language governing permissions and limitations under the License.
88
115
 
89
116
  Cesium-derived code can be found in the submodule: modules/3d-tiles
117
+
118
+ ---
119
+
120
+ The @math.gl/geometry primitive tessellators are adapted from luma.gl under the MIT License:
121
+
122
+ Copyright (c) 2020 vis.gl contributors
123
+
124
+ Permission is hereby granted, free of charge, to any person obtaining a copy
125
+ of this software and associated documentation files (the "Software"), to deal
126
+ in the Software without restriction, including without limitation the rights
127
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
128
+ copies of the Software, and to permit persons to whom the Software is
129
+ furnished to do so, subject to the following conditions:
130
+
131
+ The above copyright notice and this permission notice shall be included in
132
+ all copies or substantial portions of the Software.
133
+
134
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
135
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
136
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
137
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
138
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
139
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
140
+ THE SOFTWARE.
package/README.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  [math.gl](https://math.gl/docs) is a suite of math modules for 3D applications.
4
4
 
5
- This module contains classes for bounding boxes, view frustum intersections etc.
5
+ This module contains classes for bounding boxes, view frustum intersections and analytic shapes.
6
+
7
+ The `BoxShape`, `CapsuleShape`, `CylinderShape`, `PlaneShape` and `SphereShape` classes follow the
8
+ glTF 2.1 draft shape conventions. They support point containment and distance, plane/frustum
9
+ classification, ray intersections, affine transforms and conservative enclosing bounds. Shape
10
+ distance is exact under rigid or uniform-scale transforms and estimated under non-uniform scale or
11
+ shear. `PlaneShape` represents an unbounded half-space and therefore has no finite bounding box or
12
+ bounding sphere.
6
13
 
7
14
  For documentation please visit the [website](https://math.gl).