@woosh/meep-engine 2.34.43 → 2.34.44
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/core/bvh2/BinaryNode.js +10 -8
- package/core/bvh2/LeafNode.js +2 -1
- package/core/bvh2/aabb3/AABB3.js +879 -1059
- package/core/bvh2/aabb3/AABB3.spec.js +5 -7
- package/core/bvh2/aabb3/aabb3_array_intersects_ray.js +2 -2
- package/core/bvh2/aabb3/aabb3_box_surface_area_2.js +10 -0
- package/core/bvh2/aabb3/aabb3_compute_half_surface_area.js +16 -0
- package/core/bvh2/aabb3/aabb3_compute_surface_area.js +18 -0
- package/core/bvh2/aabb3/aabb3_expand_array.js +15 -0
- package/core/bvh2/aabb3/aabb3_intersect_aabb3.js +28 -0
- package/core/bvh2/aabb3/aabb3_intersect_ray_slab.js +73 -0
- package/core/bvh2/aabb3/{aabb3_intersects_frustum.js → aabb3_intersects_frustum_array.js} +16 -1
- package/core/bvh2/aabb3/aabb3_intersects_line_segment.js +79 -0
- package/core/bvh2/aabb3/aabb3_intersects_ray.js +92 -0
- package/core/bvh2/aabb3/{AABB3Math.spec.js → aabb3_intersects_ray.spec.js} +3 -3
- package/core/bvh2/aabb3/aabb3_intersects_ray_fast.js +176 -0
- package/core/bvh2/aabb3/aabb3_score_boxes_SAH.js +43 -0
- package/core/bvh2/aabb3/aabb_score_boxes_SAH_delta.js +37 -0
- package/core/bvh2/aabb3/deserializeAABB3.js +17 -0
- package/core/bvh2/aabb3/deserializeAABB3Encoded_v0.js +73 -0
- package/core/bvh2/aabb3/deserializeAABB3Quantized16Uint.js +36 -0
- package/core/bvh2/aabb3/serializeAABB3.js +13 -0
- package/core/bvh2/aabb3/serializeAABB3Quantized16Uint.js +33 -0
- package/core/bvh2/binary/2/BinaryUint32BVH.js +3 -3
- package/core/bvh2/binary/BinaryBVH.js +2 -2
- package/core/bvh2/binary/RayLeafIntersectionVisitor.js +2 -2
- package/core/bvh2/serialization/deserializeBinaryNode.js +1 -1
- package/core/bvh2/serialization/deserializeBinaryNodeFromBinaryBuffer.js +2 -1
- package/core/bvh2/serialization/serializeBinaryNode.js +1 -1
- package/core/bvh2/serialization/serializeBinaryNodeToBinaryBuffer.js +2 -1
- package/core/bvh2/transform/BottomUpOptimizingRebuilder.js +6 -5
- package/core/bvh2/transform/tryRotateSingleNode.js +2 -1
- package/core/geom/3d/frustum/{array_setFromProjectionMatrix.js → frustum_from_projection_matrix_array.js} +1 -1
- package/core/math/fabsf.js +8 -0
- package/engine/development/performance/MetricCollection.js +6 -0
- package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +2 -2
- package/engine/graphics/ecs/mesh-v2/sample/prototypeShadedGeometry.js +3 -1
- package/engine/graphics/geometry/buffered/query/RaycastNearestHitComputingVisitor.js +2 -2
- package/engine/graphics/micron/format/MicronGeometryPatchOccurance.js +3 -2
- package/engine/graphics/micron/prototypeVirtualGeometry.js +4 -2
- package/engine/graphics/micron/render/PatchCacheKey.js +1 -1
- package/engine/graphics/micron/render/VirtualGeometryBuilder.js +15 -41
- package/engine/graphics/micron/render/instanced/ThreeInstancedAdapter.js +5 -1
- package/engine/graphics/micron/render/refinement/ActivePatchList.js +2 -2
- package/engine/graphics/micron/render/refinement/RefinementSpec.js +16 -20
- package/package.json +1 -1
- package/core/bvh2/aabb3/AABB3Math.js +0 -579
package/core/bvh2/BinaryNode.js
CHANGED
|
@@ -8,12 +8,14 @@ import { arrayQuickSort } from "../collection/array/arrayQuickSort.js";
|
|
|
8
8
|
import { max2 } from "../math/max2.js";
|
|
9
9
|
import { min2 } from "../math/min2.js";
|
|
10
10
|
import { computeSampleStandardDeviation } from "../math/statistics/computeSampleStandardDeviation.js";
|
|
11
|
-
import { _boxSurfaceArea2, aabb3_intersect_aabb3, boxSurfaceArea2 } from "./aabb3/AABB3Math.js";
|
|
12
11
|
import { isLeaf, LeafNode } from "./LeafNode.js";
|
|
13
12
|
import { Node } from "./Node.js";
|
|
14
13
|
import { surfaceAreaHeuristic } from "./sah/surfaceAreaHeuristic.js";
|
|
15
14
|
import { BVHVisitor } from "./traversal/BVHVisitor.js";
|
|
16
15
|
import { traverseBinaryNodeUsingVisitor } from "./traversal/traverseBinaryNodeUsingVisitor.js";
|
|
16
|
+
import { aabb3_intersect_aabb3 } from "./aabb3/aabb3_intersect_aabb3.js";
|
|
17
|
+
import { aabb3_box_surface_area_2 } from "./aabb3/aabb3_box_surface_area_2.js";
|
|
18
|
+
import { aabb3_compute_half_surface_area } from "./aabb3/aabb3_compute_half_surface_area.js";
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -288,8 +290,8 @@ export class BinaryNode extends Node {
|
|
|
288
290
|
}
|
|
289
291
|
|
|
290
292
|
//change costs to be based on balance
|
|
291
|
-
aCost = a.leafNodeCount /
|
|
292
|
-
bCost = b.leafNodeCount /
|
|
293
|
+
aCost = a.leafNodeCount / aabb3_box_surface_area_2(a);
|
|
294
|
+
bCost = b.leafNodeCount / aabb3_box_surface_area_2(b);
|
|
293
295
|
}
|
|
294
296
|
|
|
295
297
|
if (aCost === bCost) {
|
|
@@ -480,7 +482,7 @@ export class BinaryNode extends Node {
|
|
|
480
482
|
leftArea = 0;
|
|
481
483
|
leftLeaves = 0;
|
|
482
484
|
} else {
|
|
483
|
-
leftArea =
|
|
485
|
+
leftArea = aabb3_box_surface_area_2(left);
|
|
484
486
|
leftLeaves = left.leafNodeCount;
|
|
485
487
|
}
|
|
486
488
|
|
|
@@ -489,11 +491,11 @@ export class BinaryNode extends Node {
|
|
|
489
491
|
rightArea = 0;
|
|
490
492
|
rightLeaves = 0;
|
|
491
493
|
} else {
|
|
492
|
-
rightArea =
|
|
494
|
+
rightArea = aabb3_box_surface_area_2(right);
|
|
493
495
|
rightLeaves = right.leafNodeCount;
|
|
494
496
|
}
|
|
495
497
|
|
|
496
|
-
const thisArea =
|
|
498
|
+
const thisArea = aabb3_box_surface_area_2(this);
|
|
497
499
|
|
|
498
500
|
return surfaceAreaHeuristic(thisArea, leftArea, rightArea, leftLeaves, rightLeaves);
|
|
499
501
|
}
|
|
@@ -1140,7 +1142,7 @@ function inclusion_surface_area_heuristic(node, addition) {
|
|
|
1140
1142
|
const y1 = max2(node.y1, addition.y1);
|
|
1141
1143
|
const z1 = max2(node.z1, addition.z1);
|
|
1142
1144
|
|
|
1143
|
-
return
|
|
1145
|
+
return aabb3_compute_half_surface_area(x0, y0, z0, x1, y1, z1) - aabb3_box_surface_area_2(node);
|
|
1144
1146
|
}
|
|
1145
1147
|
|
|
1146
1148
|
/**
|
|
@@ -1150,7 +1152,7 @@ function inclusion_surface_area_heuristic(node, addition) {
|
|
|
1150
1152
|
*/
|
|
1151
1153
|
function inclusion_cost_lower_bound(node, addition) {
|
|
1152
1154
|
let n = node;
|
|
1153
|
-
let r =
|
|
1155
|
+
let r = aabb3_box_surface_area_2(addition);
|
|
1154
1156
|
|
|
1155
1157
|
while (n !== null) {
|
|
1156
1158
|
|
package/core/bvh2/LeafNode.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by Alex on 17/11/2014.
|
|
3
3
|
*/
|
|
4
|
-
import { deserializeAABB3, serializeAABB3 } from "./aabb3/AABB3.js";
|
|
5
4
|
import { Node } from "./Node.js";
|
|
5
|
+
import { serializeAABB3 } from "./aabb3/serializeAABB3.js";
|
|
6
|
+
import { deserializeAABB3 } from "./aabb3/deserializeAABB3.js";
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
/**
|