@woosh/meep-engine 2.117.35 → 2.117.36

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/meep.cjs CHANGED
@@ -66533,13 +66533,19 @@ function bvh32_geometry_overlap_clipping_volume(
66533
66533
  return false;
66534
66534
  }
66535
66535
 
66536
+ /**
66537
+ * 4-tuples
66538
+ * @type {number[]}
66539
+ */
66536
66540
  const scratch_planes = [];
66537
66541
 
66538
66542
  class GeometrySpatialQueryAccelerator {
66539
- constructor(cache_size = 100 * 1024 * 1024) {
66543
+ constructor(
66544
+ cache_size = 100 * 1024 * 1024
66545
+ ) {
66540
66546
 
66541
66547
  /**
66542
- *
66548
+ * @private
66543
66549
  * @type {Cache<THREE.BufferGeometry, BinaryUint32BVH>}
66544
66550
  */
66545
66551
  this.cache = new Cache({
@@ -66585,8 +66591,7 @@ class GeometrySpatialQueryAccelerator {
66585
66591
  */
66586
66592
  queryContainmentViaClippingPlanes(geometry, planes) {
66587
66593
 
66588
-
66589
- const bvh = this.__acquireBVH(geometry);
66594
+ const bvh = this.acquire_bvh(geometry);
66590
66595
 
66591
66596
  read_three_planes_to_array(planes, scratch_planes);
66592
66597
 
@@ -66660,7 +66665,7 @@ class GeometrySpatialQueryAccelerator {
66660
66665
  let bvh;
66661
66666
 
66662
66667
  try {
66663
- bvh = this.__acquireBVH(geometry);
66668
+ bvh = this.acquire_bvh(geometry);
66664
66669
  } catch (e) {
66665
66670
  return false;
66666
66671
  }
@@ -66725,11 +66730,22 @@ class GeometrySpatialQueryAccelerator {
66725
66730
  }
66726
66731
 
66727
66732
  /**
66728
- * @private
66733
+ * Destroys cache for a given geometry, useful for when geometry changes and cache needs to be invalidated
66734
+ * @param {THREE.BufferGeometry} geometry
66735
+ * @returns {boolean}
66736
+ */
66737
+ cache_remove_geometry(geometry) {
66738
+
66739
+ return this.cache.remove(geometry);
66740
+
66741
+ }
66742
+
66743
+ /**
66744
+ * NOTE: do not modify the BVH
66729
66745
  * @param {THREE.BufferGeometry} geometry
66730
66746
  * @returns {BinaryUint32BVH}
66731
66747
  */
66732
- __acquireBVH(geometry) {
66748
+ acquire_bvh(geometry) {
66733
66749
 
66734
66750
  const existing = this.cache.get(geometry);
66735
66751
 
@@ -66737,7 +66753,7 @@ class GeometrySpatialQueryAccelerator {
66737
66753
  return existing;
66738
66754
  }
66739
66755
 
66740
- const bvh = this.__buildBVH(geometry);
66756
+ const bvh = this.__build_bvh(geometry);
66741
66757
 
66742
66758
  this.cache.put(geometry, bvh);
66743
66759
 
@@ -66749,7 +66765,7 @@ class GeometrySpatialQueryAccelerator {
66749
66765
  * @param {THREE.BufferGeometry} geometry
66750
66766
  * @returns {BinaryUint32BVH}
66751
66767
  */
66752
- __buildBVH(geometry) {
66768
+ __build_bvh(geometry) {
66753
66769
  const bvh = new BinaryUint32BVH();
66754
66770
 
66755
66771
  const position_attribute = geometry.getAttribute('position');