@woosh/meep-engine 2.68.0 → 2.69.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/build/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +698 -1269
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +698 -1269
- package/package.json +1 -1
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +55 -28
- package/src/core/bvh2/binary/2/BinaryUint32BVH.spec.js +3 -3
- package/src/core/bvh2/binary/2/bvh32_query_user_data_overlaps_clipping_volume.js +94 -0
- package/src/core/bvh2/binary/2/bvh32_query_user_data_ray.js +17 -18
- package/src/core/bvh2/bvh3/query/BVHQueryIntersectsFrustum.js +4 -2
- package/src/core/geom/3d/aabb/AABB3.js +14 -14
- package/src/core/geom/3d/aabb/aabb3_array_intersects_clipping_volume_array.js +30 -0
- package/src/core/geom/3d/aabb/aabb3_intersects_clipping_volume_array.js +51 -0
- package/src/core/geom/3d/frustum/{read_frustum_planes_to_array.js → read_three_planes_to_array.js} +5 -3
- package/src/core/geom/3d/triangle/triangle_intersects_clipping_volume.js +51 -0
- package/src/engine/ecs/terrain/ecs/TerrainSystem.js +2 -2
- package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.js +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +9 -46
- package/src/engine/graphics/geometry/buffered/query/GeometrySpatialQueryAccelerator.d.ts +2 -2
- package/src/engine/graphics/geometry/buffered/query/GeometrySpatialQueryAccelerator.js +79 -36
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_overlap_clipping_volume.js +88 -0
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_raycast.js +108 -0
- package/src/engine/graphics/geometry/bvh/buffered/bvh32_from_indexed_geometry.js +4 -30
- package/src/engine/graphics/geometry/bvh/buffered/bvh32_from_unindexed_geometry.js +30 -0
- package/src/engine/graphics/geometry/bvh/buffered/bvh32_set_leaf_from_triangle.js +41 -0
- package/src/engine/graphics/render/forward_plus/LightManager.js +2 -2
- package/src/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.js +2 -2
- package/src/engine/graphics/render/view/CameraView.js +8 -8
- package/src/core/bvh2/binary/BinaryBVH.js +0 -281
- package/src/core/bvh2/binary/IndexedBinaryBVH.js +0 -407
- package/src/core/bvh2/binary/IndexedBinaryBVH.spec.js +0 -27
- package/src/core/bvh2/binary/IndexedBinaryBVHVisitor.js +0 -11
- package/src/core/bvh2/binary/NodeType.js +0 -8
- package/src/core/bvh2/binary/RayLeafIntersectionVisitor.js +0 -59
- package/src/core/geom/3d/aabb/aabb3_array_intersects_frustum_array.js +0 -20
- package/src/core/geom/3d/aabb/aabb3_intersects_frustum_array.js +0 -35
- package/src/engine/graphics/geometry/buffered/query/ClippingPlaneContainmentComputingVisitor.js +0 -195
- package/src/engine/graphics/geometry/buffered/query/GeometryVisitor.js +0 -87
- package/src/engine/graphics/geometry/buffered/query/RaycastNearestHitComputingVisitor.js +0 -206
- package/src/engine/graphics/geometry/bvh/buffered/BinaryBVHFromBufferGeometry.js +0 -123
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by Alex on 29/05/2016.
|
|
3
|
-
*/
|
|
4
|
-
import IndexedBinaryBVH from '../../../../../core/bvh2/binary/IndexedBinaryBVH.js';
|
|
5
|
-
import { min3 } from "../../../../../core/math/min3.js";
|
|
6
|
-
import { max3 } from "../../../../../core/math/max3.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param {Float32Array|Float64Array|Array.<Number>} vertices
|
|
11
|
-
* @param {Uint8Array|Uint16Array|Uint32Array|Array.<Number>} indices
|
|
12
|
-
* @returns {IndexedBinaryBVH}
|
|
13
|
-
*/
|
|
14
|
-
function buildUnsorted(vertices, indices) {
|
|
15
|
-
//
|
|
16
|
-
const numNodes = indices.length / 3;
|
|
17
|
-
|
|
18
|
-
const tree = new IndexedBinaryBVH();
|
|
19
|
-
tree.initialize(numNodes);
|
|
20
|
-
|
|
21
|
-
for (let i = 0; i < numNodes; i++) {
|
|
22
|
-
|
|
23
|
-
const index3 = i * 3;
|
|
24
|
-
|
|
25
|
-
// read triangle vertex indices
|
|
26
|
-
const iA = indices[index3];
|
|
27
|
-
const iB = indices[index3 + 1];
|
|
28
|
-
const iC = indices[index3 + 2];
|
|
29
|
-
|
|
30
|
-
const a = iA * 3;
|
|
31
|
-
const b = iB * 3;
|
|
32
|
-
const c = iC * 3;
|
|
33
|
-
|
|
34
|
-
// read actual positions of each vertex
|
|
35
|
-
const aX = vertices[a];
|
|
36
|
-
const aY = vertices[a + 1];
|
|
37
|
-
const aZ = vertices[a + 2];
|
|
38
|
-
|
|
39
|
-
const bX = vertices[b];
|
|
40
|
-
const bY = vertices[b + 1];
|
|
41
|
-
const bZ = vertices[b + 2];
|
|
42
|
-
|
|
43
|
-
const cX = vertices[c];
|
|
44
|
-
const cY = vertices[c + 1];
|
|
45
|
-
const cZ = vertices[c + 2];
|
|
46
|
-
|
|
47
|
-
// compute bounds of the triangle
|
|
48
|
-
const x0 = min3(aX, bX, cX);
|
|
49
|
-
const y0 = min3(aY, bY, cY);
|
|
50
|
-
const z0 = min3(aZ, bZ, cZ);
|
|
51
|
-
|
|
52
|
-
const x1 = max3(aX, bX, cX);
|
|
53
|
-
const y1 = max3(aY, bY, cY);
|
|
54
|
-
const z1 = max3(aZ, bZ, cZ);
|
|
55
|
-
|
|
56
|
-
tree.writeLeaf(i, x0, y0, z0, x1, y1, z1);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// finalize build
|
|
60
|
-
tree.unsortedBuiltIntermediate();
|
|
61
|
-
|
|
62
|
-
return tree;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
* @param {Float32Array|Float64Array|Array.<Number>} vertices
|
|
68
|
-
* @returns {IndexedBinaryBVH}
|
|
69
|
-
*/
|
|
70
|
-
export function buildUnsortedUnindexed(vertices) {
|
|
71
|
-
//
|
|
72
|
-
const numNodes = vertices.length / 9;
|
|
73
|
-
|
|
74
|
-
const tree = new IndexedBinaryBVH();
|
|
75
|
-
tree.initialize(numNodes);
|
|
76
|
-
|
|
77
|
-
for (let i = 0; i < numNodes; i++) {
|
|
78
|
-
|
|
79
|
-
const index3 = i * 3;
|
|
80
|
-
|
|
81
|
-
// read triangle vertex indices
|
|
82
|
-
const iA = index3;
|
|
83
|
-
const iB = index3 + 1;
|
|
84
|
-
const iC = index3 + 2;
|
|
85
|
-
|
|
86
|
-
const a = iA * 3;
|
|
87
|
-
const b = iB * 3;
|
|
88
|
-
const c = iC * 3;
|
|
89
|
-
|
|
90
|
-
// read actual positions of each vertex
|
|
91
|
-
const aX = vertices[a];
|
|
92
|
-
const aY = vertices[a + 1];
|
|
93
|
-
const aZ = vertices[a + 2];
|
|
94
|
-
|
|
95
|
-
const bX = vertices[b];
|
|
96
|
-
const bY = vertices[b + 1];
|
|
97
|
-
const bZ = vertices[b + 2];
|
|
98
|
-
|
|
99
|
-
const cX = vertices[c];
|
|
100
|
-
const cY = vertices[c + 1];
|
|
101
|
-
const cZ = vertices[c + 2];
|
|
102
|
-
|
|
103
|
-
// compute bounds of the triangle
|
|
104
|
-
const x0 = min3(aX, bX, cX);
|
|
105
|
-
const y0 = min3(aY, bY, cY);
|
|
106
|
-
const z0 = min3(aZ, bZ, cZ);
|
|
107
|
-
|
|
108
|
-
const x1 = max3(aX, bX, cX);
|
|
109
|
-
const y1 = max3(aY, bY, cY);
|
|
110
|
-
const z1 = max3(aZ, bZ, cZ);
|
|
111
|
-
|
|
112
|
-
tree.writeLeaf(i, x0, y0, z0, x1, y1, z1);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// finalize build
|
|
116
|
-
tree.unsortedBuiltIntermediate();
|
|
117
|
-
|
|
118
|
-
return tree;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
buildUnsorted
|
|
123
|
-
};
|