@woosh/meep-engine 2.34.41 → 2.34.45

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 (58) hide show
  1. package/core/bvh2/BinaryNode.js +10 -8
  2. package/core/bvh2/LeafNode.js +2 -1
  3. package/core/bvh2/aabb3/AABB3.js +879 -1059
  4. package/core/bvh2/aabb3/AABB3.spec.js +5 -7
  5. package/core/bvh2/aabb3/aabb3_array_intersects_ray.js +2 -2
  6. package/core/bvh2/aabb3/aabb3_box_surface_area_2.js +10 -0
  7. package/core/bvh2/aabb3/aabb3_compute_half_surface_area.js +16 -0
  8. package/core/bvh2/aabb3/aabb3_compute_surface_area.js +18 -0
  9. package/core/bvh2/aabb3/aabb3_expand_array.js +15 -0
  10. package/core/bvh2/aabb3/aabb3_intersect_aabb3.js +28 -0
  11. package/core/bvh2/aabb3/aabb3_intersect_ray_slab.js +73 -0
  12. package/core/bvh2/aabb3/{aabb3_intersects_frustum.js → aabb3_intersects_frustum_array.js} +16 -1
  13. package/core/bvh2/aabb3/aabb3_intersects_line_segment.js +79 -0
  14. package/core/bvh2/aabb3/aabb3_intersects_ray.js +92 -0
  15. package/core/bvh2/aabb3/{AABB3Math.spec.js → aabb3_intersects_ray.spec.js} +3 -3
  16. package/core/bvh2/aabb3/aabb3_intersects_ray_fast.js +176 -0
  17. package/core/bvh2/aabb3/aabb3_score_boxes_SAH.js +43 -0
  18. package/core/bvh2/aabb3/aabb_score_boxes_SAH_delta.js +37 -0
  19. package/core/bvh2/aabb3/deserializeAABB3.js +17 -0
  20. package/core/bvh2/aabb3/deserializeAABB3Encoded_v0.js +73 -0
  21. package/core/bvh2/aabb3/deserializeAABB3Quantized16Uint.js +36 -0
  22. package/core/bvh2/aabb3/serializeAABB3.js +13 -0
  23. package/core/bvh2/aabb3/serializeAABB3Quantized16Uint.js +33 -0
  24. package/core/bvh2/binary/2/BinaryUint32BVH.js +3 -3
  25. package/core/bvh2/binary/BinaryBVH.js +2 -2
  26. package/core/bvh2/binary/RayLeafIntersectionVisitor.js +2 -2
  27. package/core/bvh2/serialization/deserializeBinaryNode.js +1 -1
  28. package/core/bvh2/serialization/deserializeBinaryNodeFromBinaryBuffer.js +2 -1
  29. package/core/bvh2/serialization/serializeBinaryNode.js +1 -1
  30. package/core/bvh2/serialization/serializeBinaryNodeToBinaryBuffer.js +2 -1
  31. package/core/bvh2/transform/BottomUpOptimizingRebuilder.js +6 -5
  32. package/core/bvh2/transform/tryRotateSingleNode.js +2 -1
  33. package/core/geom/3d/frustum/{array_setFromProjectionMatrix.js → frustum_from_projection_matrix_array.js} +1 -1
  34. package/core/geom/3d/topology/TopoMesh.js +0 -8
  35. package/core/geom/3d/topology/TopoVertex.js +7 -6
  36. package/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +93 -5
  37. package/core/geom/3d/topology/simplify/quadratic/build_vertex_quadratics.js +7 -4
  38. package/core/geom/3d/topology/simplify/quadratic/compute_edge_collapse_cost_quadratic.js +7 -1
  39. package/core/geom/3d/topology/simplify/simplifyTopoMesh.js +1 -14
  40. package/core/math/fabsf.js +8 -0
  41. package/engine/development/performance/MetricCollection.js +6 -0
  42. package/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +1 -1
  43. package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +2 -2
  44. package/engine/graphics/ecs/mesh-v2/sample/prototypeShadedGeometry.js +23 -8
  45. package/engine/graphics/geometry/buffered/query/RaycastNearestHitComputingVisitor.js +2 -2
  46. package/engine/graphics/micron/build/buildMicronGeometryFromBufferGeometry.js +4 -0
  47. package/engine/graphics/micron/build/hierarchy/merge_patches.js +1 -1
  48. package/engine/graphics/micron/convert_three_object_to_micron.js +2 -0
  49. package/engine/graphics/micron/format/MicronGeometryPatchOccurance.js +3 -2
  50. package/engine/graphics/micron/prototypeVirtualGeometry.js +12 -7
  51. package/engine/graphics/micron/render/PatchCacheKey.js +1 -1
  52. package/engine/graphics/micron/render/VirtualGeometryBuilder.js +16 -43
  53. package/engine/graphics/micron/render/instanced/ThreeInstancedAdapter.js +5 -1
  54. package/engine/graphics/micron/render/refinement/ActivePatchList.js +4 -10
  55. package/engine/graphics/micron/render/refinement/RefinementSpec.js +16 -20
  56. package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
  57. package/package.json +1 -1
  58. package/core/bvh2/aabb3/AABB3Math.js +0 -579
@@ -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 / boxSurfaceArea2(a);
292
- bCost = b.leafNodeCount / boxSurfaceArea2(b);
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 = boxSurfaceArea2(left);
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 = boxSurfaceArea2(right);
494
+ rightArea = aabb3_box_surface_area_2(right);
493
495
  rightLeaves = right.leafNodeCount;
494
496
  }
495
497
 
496
- const thisArea = boxSurfaceArea2(this);
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 _boxSurfaceArea2(x0, y0, z0, x1, y1, z1) - boxSurfaceArea2(node);
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 = boxSurfaceArea2(addition);
1155
+ let r = aabb3_box_surface_area_2(addition);
1154
1156
 
1155
1157
  while (n !== null) {
1156
1158
 
@@ -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
  /**