@woosh/meep-engine 2.59.6 → 2.60.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.
Files changed (38) hide show
  1. package/build/meep.cjs +90 -91
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +90 -91
  4. package/package.json +1 -1
  5. package/src/core/bvh2/binary/IndexedBinaryBVH.js +2 -1
  6. package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.js +1 -1
  7. package/src/core/bvh2/serialization/serializeBinaryNode.js +4 -4
  8. package/src/core/collection/map/HashMap.js +1 -1
  9. package/src/core/collection/table/RowFirstTableSpec.js +1 -1
  10. package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_array_2d.js +1 -1
  11. package/src/core/geom/2d/quad-tree/QuadTreeNode.js +2 -2
  12. package/src/core/geom/2d/quad-tree/qt_collect_by_circle.js +1 -1
  13. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +1 -1
  14. package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.js +1 -1
  15. package/src/core/geom/packing/miniball/Miniball.js +0 -1
  16. package/src/core/geom/packing/miniball/Subspan.js +1 -3
  17. package/src/core/graph/coloring/colorizeGraph.js +1 -1
  18. package/src/core/localization/Localization.js +11 -11
  19. package/src/core/model/ModuleRegistry.js +4 -4
  20. package/src/core/process/task/Task.js +3 -3
  21. package/src/engine/EngineConfiguration.js +0 -1
  22. package/src/engine/EngineHarness.js +1 -1
  23. package/src/engine/ecs/EntityComponentDataset.js +2 -2
  24. package/src/engine/ecs/parent/EntityNode.js +10 -10
  25. package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
  26. package/src/engine/graphics/ecs/camera/CameraSystem.d.ts +2 -3
  27. package/src/engine/graphics/ecs/camera/CameraSystem.js +2 -3
  28. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -1
  29. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
  30. package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +2 -2
  31. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
  32. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
  33. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
  34. package/src/engine/graphics/render/view/CameraView.js +1 -1
  35. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
  36. package/src/engine/graphics/shaders/ClearShader.js +1 -1
  37. package/src/engine/graphics/shadows/testShadowMapRendering.js +1 -1
  38. package/src/misc/makeMaterialIconCached.js +8 -1
package/build/meep.cjs CHANGED
@@ -55942,8 +55942,9 @@ class IndexedBinaryBVH {
55942
55942
  }
55943
55943
 
55944
55944
  /**
55945
+ * @template T
55945
55946
  * @deprecated use {@link #writeLeaf} instead followed by {@link #unsortedBuiltIntermediate}
55946
- * @param {function(index:number,offset:number,data:*, writeBox:function):*} visitor
55947
+ * @param {function(index:number,offset:number,data:T, writeBox:function):void} visitor
55947
55948
  */
55948
55949
  setLeafs(visitor) {
55949
55950
  let offset = this.binaryNodeCount * 6;
@@ -60409,7 +60410,7 @@ class HashMap {
60409
60410
 
60410
60411
  /**
60411
60412
  * Note that dead entries are marked as such with a special reserved hash values, so records can be reused for new entries
60412
- * @type {MapEntry<K,V>[]}
60413
+ * @type {Array<MapEntry<K,V>>}
60413
60414
  */
60414
60415
  #entries = new Array(0);
60415
60416
 
@@ -64124,7 +64125,7 @@ class Task {
64124
64125
 
64125
64126
  /**
64126
64127
  *
64127
- * @type {function(Task, executor:{run:function(Task)})}
64128
+ * @type {function(Task, executor:ConcurrentExecutor)}
64128
64129
  */
64129
64130
  this.initialize = initializer;
64130
64131
 
@@ -64218,7 +64219,7 @@ class Task {
64218
64219
 
64219
64220
  /**
64220
64221
  *
64221
- * @param {(Task|TaskGroup)[]} tasks
64222
+ * @param {Array<(Task|TaskGroup)>} tasks
64222
64223
  */
64223
64224
  addDependencies(tasks) {
64224
64225
  if (!Array.isArray(tasks)) {
@@ -64274,7 +64275,7 @@ class Task {
64274
64275
 
64275
64276
  /**
64276
64277
  *
64277
- * @param {(Task|TaskGroup)[]} tasks
64278
+ * @param {Array<(Task|TaskGroup)>} tasks
64278
64279
  * @return {Promise}
64279
64280
  */
64280
64281
  static promiseAll(tasks) {
@@ -70654,14 +70655,13 @@ ResourceAccessSpecification.prototype.isResourceAccessSpecification = true;
70654
70655
  class CameraSystem extends System {
70655
70656
  /**
70656
70657
  *
70657
- * @param {THREE.Scene} scene
70658
70658
  * @param {GraphicsEngine} graphics
70659
70659
  * @constructor
70660
70660
  */
70661
- constructor(scene, graphics) {
70661
+ constructor(graphics) {
70662
70662
  super();
70663
70663
 
70664
- this.scene = scene;
70664
+ this.scene = graphics.scene;
70665
70665
 
70666
70666
  this.dependencies = [Camera, Transform];
70667
70667
 
@@ -72065,55 +72065,28 @@ class TerrainSystem extends System {
72065
72065
  }
72066
72066
 
72067
72067
  /**
72068
- * Component representing logical attachment to another entity, when parent disappears - so does the child
72068
+ * Remove first occurrence of element from the array
72069
+ * @template T
72070
+ * @param {T[]} array
72071
+ * @param {T} element
72072
+ * @param {number} [start_index]
72073
+ * @param {number} [length]
72074
+ * @return {boolean} true if element was removed, false if it was not found
72069
72075
  */
72070
- class ParentEntity {
72071
- /**
72072
- * * @constructor
72073
- */
72074
- constructor() {
72075
- /**
72076
- * Entity representing logical parent.
72077
- * Must not be mutated (changed) while component is attached to a dataset
72078
- * @type {number}
72079
- */
72080
- this.entity = -1;
72081
- }
72082
-
72083
- /**
72084
- *
72085
- * @param {number} entity
72086
- * @returns {ParentEntity}
72087
- */
72088
- static from(entity) {
72089
- const r = new ParentEntity();
72090
-
72091
- r.entity = entity;
72076
+ function array_remove_first(array, element, start_index = 0, length = array.length) {
72092
72077
 
72093
- return r;
72094
- }
72078
+ const end_index = start_index + length;
72095
72079
 
72096
- toJSON() {
72097
- return {
72098
- entity: this.entity,
72099
- };
72100
- }
72080
+ for (let i = start_index; i < end_index; i++) {
72081
+ if (array[i] === element) {
72082
+ array.splice(i, 1);
72101
72083
 
72102
- fromJSON({ entity }) {
72103
- this.entity = entity;
72084
+ return true;
72085
+ }
72104
72086
  }
72105
- }
72106
72087
 
72107
- /**
72108
- * @readonly
72109
- * @type {string}
72110
- */
72111
- ParentEntity.typeName = "ParentEntity";
72112
- /**
72113
- *
72114
- * @type {boolean}
72115
- */
72116
- ParentEntity.serializable = false;
72088
+ return false;
72089
+ }
72117
72090
 
72118
72091
  /**
72119
72092
  * de Bruijn sequence
@@ -75138,30 +75111,6 @@ function checkExistingComponents(entity, components, dataset) {
75138
75111
  return true;
75139
75112
  }
75140
75113
 
75141
- /**
75142
- * Remove first occurrence of element from the array
75143
- * @template T
75144
- * @param {T[]} array
75145
- * @param {T} element
75146
- * @param {number} [start_index]
75147
- * @param {number} [length]
75148
- * @return {boolean} true if element was removed, false if it was not found
75149
- */
75150
- function array_remove_first(array, element, start_index = 0, length = array.length) {
75151
-
75152
- const end_index = start_index + length;
75153
-
75154
- for (let i = start_index; i < end_index; i++) {
75155
- if (array[i] === element) {
75156
- array.splice(i, 1);
75157
-
75158
- return true;
75159
- }
75160
- }
75161
-
75162
- return false;
75163
- }
75164
-
75165
75114
  const TransformAttachmentFlags = {
75166
75115
  /**
75167
75116
  * Update will be performed when component is attached.
@@ -75279,6 +75228,57 @@ const EntityNodeFlags = {
75279
75228
  TransformObserved: 2
75280
75229
  };
75281
75230
 
75231
+ /**
75232
+ * Component representing logical attachment to another entity, when parent disappears - so does the child
75233
+ */
75234
+ class ParentEntity {
75235
+ /**
75236
+ * * @constructor
75237
+ */
75238
+ constructor() {
75239
+ /**
75240
+ * Entity representing logical parent.
75241
+ * Must not be mutated (changed) while component is attached to a dataset
75242
+ * @type {number}
75243
+ */
75244
+ this.entity = -1;
75245
+ }
75246
+
75247
+ /**
75248
+ *
75249
+ * @param {number} entity
75250
+ * @returns {ParentEntity}
75251
+ */
75252
+ static from(entity) {
75253
+ const r = new ParentEntity();
75254
+
75255
+ r.entity = entity;
75256
+
75257
+ return r;
75258
+ }
75259
+
75260
+ toJSON() {
75261
+ return {
75262
+ entity: this.entity,
75263
+ };
75264
+ }
75265
+
75266
+ fromJSON({ entity }) {
75267
+ this.entity = entity;
75268
+ }
75269
+ }
75270
+
75271
+ /**
75272
+ * @readonly
75273
+ * @type {string}
75274
+ */
75275
+ ParentEntity.typeName = "ParentEntity";
75276
+ /**
75277
+ *
75278
+ * @type {boolean}
75279
+ */
75280
+ ParentEntity.serializable = false;
75281
+
75282
75282
  const DEFAULT_FLAGS$1 = EntityNodeFlags.LiveManagement;
75283
75283
 
75284
75284
  class EntityNode {
@@ -75387,7 +75387,7 @@ class EntityNode {
75387
75387
 
75388
75388
  /**
75389
75389
  *
75390
- * @param {(EntityNode) => *} visitor
75390
+ * @param {function(node:EntityNode):*} visitor
75391
75391
  * @param {*} [context]
75392
75392
  */
75393
75393
  traverseChildren(visitor, context) {
@@ -75396,7 +75396,7 @@ class EntityNode {
75396
75396
 
75397
75397
  /**
75398
75398
  *
75399
- * @return {Readonly<EntityNode[]>}
75399
+ * @return {Readonly<Array<EntityNode>>}
75400
75400
  */
75401
75401
  get children() {
75402
75402
  return this.__children;
@@ -79617,7 +79617,7 @@ class ExplicitBinaryBoundingVolumeHierarchy {
79617
79617
 
79618
79618
  /**
79619
79619
  *
79620
- * @param {(node:number, tree:ExplicitBinaryBoundingVolumeHierarchy)=>void} callback
79620
+ * @param {function(node:number, tree:ExplicitBinaryBoundingVolumeHierarchy):void} callback
79621
79621
  * @param {*} [ctx]
79622
79622
  */
79623
79623
  traverse(callback, ctx) {
@@ -90393,7 +90393,7 @@ class CameraView {
90393
90393
 
90394
90394
  /**
90395
90395
  *
90396
- * @type {{transform:(Float32Array, Float32Array)=>void, context:*}[]}
90396
+ * @type {Array<{transform:function(Float32Array, Float32Array):void, context:*}>}
90397
90397
  */
90398
90398
  this.projection_modifiers = [];
90399
90399
  }
@@ -93762,7 +93762,7 @@ class EntityComponentDataset {
93762
93762
  * Performs traversal on a subset of entities which have specified components.
93763
93763
  * @example traverseEntities([Transform,Renderable,Tag],function(transform, renderable, tag, entity){ ... }, this);
93764
93764
  * @param {Array} classes
93765
- * @param {function:boolean?} visitor Visitor can return optional "false" to terminate traversal earlier
93765
+ * @param {function(...args):boolean} visitor Visitor can return optional "false" to terminate traversal earlier
93766
93766
  * @param {object} [thisArg] specifies context object on which callbacks are to be called, optional
93767
93767
  */
93768
93768
  traverseEntities(classes, visitor, thisArg) {
@@ -94387,7 +94387,7 @@ class EntityComponentDataset {
94387
94387
  /**
94388
94388
  * Main utility of this method is to facilitate serialization.
94389
94389
  * @param {Array} componentClasses
94390
- * @param {function(componentIndex:number,components:[], componentCount:number)} visitor
94390
+ * @param {function(componentIndex:number,components:Array, componentCount:number)} visitor
94391
94391
  */
94392
94392
  traverseEntitiesCompactedFiltered(componentClasses, visitor) {
94393
94393
 
@@ -105513,7 +105513,7 @@ class Localization {
105513
105513
  this.debug = true;
105514
105514
 
105515
105515
  /**
105516
- * @type {Cache<string[], string>}
105516
+ * @type {Cache<Array<string>, string>}
105517
105517
  * @private
105518
105518
  */
105519
105519
  this.__failure_cache = new Cache({
@@ -105633,7 +105633,7 @@ class Localization {
105633
105633
  * @param {number} value
105634
105634
  */
105635
105635
  formatIntegerByThousands(value) {
105636
- const formatter = new Intl.NumberFormat(this.locale.getValue(), { useGrouping: true });
105636
+ const formatter = new Intl.NumberFormat(this.locale.getValue(), {useGrouping: true});
105637
105637
 
105638
105638
  return formatter.format(value);
105639
105639
  }
@@ -105718,7 +105718,7 @@ class ModuleRegistry {
105718
105718
  #modules = new Map();
105719
105719
  /**
105720
105720
  *
105721
- * @type {Map<*,string[]>}
105721
+ * @type {Map<*,Array<string>>}
105722
105722
  */
105723
105723
  #reverse_lookup = new Map();
105724
105724
 
@@ -105746,7 +105746,7 @@ class ModuleRegistry {
105746
105746
 
105747
105747
  /**
105748
105748
  *
105749
- * @param {(name:string, module:*)=>void} visitor
105749
+ * @param {function(name:string,module:*):void} visitor
105750
105750
  */
105751
105751
  traverse(visitor) {
105752
105752
  this.#modules.forEach((klass, name) => visitor(name, klass));
@@ -105764,7 +105764,7 @@ class ModuleRegistry {
105764
105764
 
105765
105765
  /**
105766
105766
  *
105767
- * @param {String} name
105767
+ * @param {string} name
105768
105768
  * @returns {boolean}
105769
105769
  */
105770
105770
  has(name) {
@@ -105773,7 +105773,7 @@ class ModuleRegistry {
105773
105773
 
105774
105774
  /**
105775
105775
  * @template T
105776
- * @param {String} name
105776
+ * @param {string} name
105777
105777
  * @param {T} module
105778
105778
  * @returns {boolean}
105779
105779
  */
@@ -112573,7 +112573,7 @@ class QuadTreeNode extends AABB2 {
112573
112573
 
112574
112574
  /**
112575
112575
  *
112576
- * @param {QuadTreeDatum<D>[]} result
112576
+ * @param {Array<QuadTreeDatum<D>>} result
112577
112577
  * @param {number} x
112578
112578
  * @param {number} y
112579
112579
  * @returns {number} number of intersecting objects added to the result
@@ -112592,7 +112592,7 @@ class QuadTreeNode extends AABB2 {
112592
112592
 
112593
112593
  /**
112594
112594
  *
112595
- * @param {QuadTreeDatum<D>[]} result
112595
+ * @param {Array<QuadTreeDatum<D>>} result
112596
112596
  * @param {number} x0
112597
112597
  * @param {number} y0
112598
112598
  * @param {number} x1
@@ -120171,7 +120171,6 @@ class EngineConfiguration {
120171
120171
  }
120172
120172
 
120173
120173
  /**
120174
- *
120175
120174
  * @param {System} systems
120176
120175
  */
120177
120176
  addManySystems(...systems) {
@@ -121037,7 +121036,7 @@ class EngineHarness {
121037
121036
  em.addSystem(new TopDownCameraControllerSystem());
121038
121037
  }
121039
121038
  if (em.getSystem(CameraSystem) === null) {
121040
- em.addSystem(new CameraSystem(engine.graphics.scene, engine.graphics));
121039
+ em.addSystem(new CameraSystem(engine.graphics));
121041
121040
  }
121042
121041
 
121043
121042
  if (em.getSystem(SoundListenerSystem) === null) {