@woosh/meep-engine 2.59.5 → 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 (59) hide show
  1. package/build/meep.cjs +102 -103
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +102 -103
  4. package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.js +1 -1
  5. package/package.json +1 -1
  6. package/src/core/bvh2/binary/IndexedBinaryBVH.js +2 -1
  7. package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.js +1 -1
  8. package/src/core/bvh2/serialization/serializeBinaryNode.js +4 -4
  9. package/src/core/collection/list/List.js +2 -2
  10. package/src/core/collection/map/HashMap.js +1 -1
  11. package/src/core/collection/table/RowFirstTableSpec.js +1 -1
  12. package/src/core/debug/matchers/DescribeAs.js +2 -2
  13. package/src/core/debug/matchers/IsIn.js +4 -1
  14. package/src/core/debug/matchers/matchers.js +1 -1
  15. package/src/core/events/signal/Signal.js +1 -1
  16. package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_array_2d.js +1 -1
  17. package/src/core/geom/2d/quad-tree/QuadTreeNode.js +2 -2
  18. package/src/core/geom/2d/quad-tree/qt_collect_by_circle.js +1 -1
  19. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +1 -1
  20. package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.js +1 -1
  21. package/src/core/geom/packing/miniball/Miniball.js +0 -1
  22. package/src/core/geom/packing/miniball/Subspan.js +1 -3
  23. package/src/core/graph/coloring/colorizeGraph.js +1 -1
  24. package/src/core/localization/Localization.js +11 -11
  25. package/src/core/model/ModuleRegistry.js +4 -4
  26. package/src/core/primitives/strings/prefixTree/PrefixTree.js +2 -2
  27. package/src/core/process/buildPromiseChain.js +1 -1
  28. package/src/core/process/task/Task.js +3 -3
  29. package/src/core/process/worker/OnDemandWorkerManager.js +1 -1
  30. package/src/core/process/worker/WorkerProxy.js +1 -1
  31. package/src/core/process/worker/extractTransferables.js +1 -1
  32. package/src/engine/EngineConfiguration.js +0 -1
  33. package/src/engine/EngineHarness.js +1 -1
  34. package/src/engine/asset/loaders/material/computeTextureEquality.js +2 -2
  35. package/src/engine/ecs/Entity.js +1 -1
  36. package/src/engine/ecs/EntityBlueprint.js +1 -1
  37. package/src/engine/ecs/EntityComponentDataset.js +4 -4
  38. package/src/engine/ecs/System.js +1 -1
  39. package/src/engine/ecs/parent/EntityNode.js +10 -10
  40. package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
  41. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js +4 -4
  42. package/src/engine/graphics/ecs/camera/CameraSystem.d.ts +2 -3
  43. package/src/engine/graphics/ecs/camera/CameraSystem.js +2 -3
  44. package/src/engine/graphics/ecs/mesh-v2/sample/prototypeShadedGeometry.js +3 -3
  45. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -1
  46. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
  47. package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +2 -2
  48. package/src/engine/graphics/particles/node-based/simulation/GLSLSimulationShader.js +1 -1
  49. package/src/engine/graphics/particles/node-based/simulation/TransformFeedback.js +1 -1
  50. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
  51. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
  52. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
  53. package/src/engine/graphics/render/view/CameraView.js +1 -1
  54. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
  55. package/src/engine/graphics/shaders/ClearShader.js +1 -1
  56. package/src/engine/graphics/shadows/testShadowMapRendering.js +1 -1
  57. package/src/engine/input/ecs/components/InputController.js +1 -1
  58. package/src/engine/knowledge/database/StaticKnowledgeDataTable.js +1 -1
  59. package/src/misc/makeMaterialIconCached.js +8 -1
package/build/meep.cjs CHANGED
@@ -766,7 +766,7 @@ const dispatch_stack = [];
766
766
  let dispatch_stack_top = 0;
767
767
 
768
768
  /**
769
- * Signal is a type of event bus. You can subscribe to events using {@link add) method and dispatch using sendN method where N is the number of arguments you wish to pass
769
+ * Signal is a type of event bus. You can subscribe to events using {@link add} method and dispatch using sendN method where N is the number of arguments you wish to pass
770
770
  * Signal is different from a normal event bus in that 1 signal corresponds to 1 event type. For example, in HTML you have `addEventListener` which lets you subscribe to any kind of event, let's use "mousedown" as a reference. Using a Signal you would instead have a signal corresponding to "mousedown" and dispatch this signal only for this event.
771
771
  * @example `const mouseDown = new Signal<MouseEvent>(); mouseDown.send1(myMouseEvent);`
772
772
  */
@@ -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
 
@@ -62753,8 +62754,8 @@ class List {
62753
62754
  }
62754
62755
 
62755
62756
  /**
62756
- *
62757
- * @param {[]} json
62757
+ * @template J
62758
+ * @param {J[]} json
62758
62759
  * @param {function} constructor
62759
62760
  */
62760
62761
  fromJSON(json, constructor) {
@@ -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) {
@@ -65112,7 +65113,7 @@ class WorkerProxy {
65112
65113
  /**
65113
65114
  * @template T
65114
65115
  * @param {number} name
65115
- * @param {[]} args
65116
+ * @param {Array} args
65116
65117
  * @return {Promise<T>}
65117
65118
  */
65118
65119
  $submitRequest(name, args) {
@@ -69420,7 +69421,7 @@ class System {
69420
69421
 
69421
69422
 
69422
69423
  /**
69423
- * @returns {[]} Component classes
69424
+ * @returns {Array} Component classes
69424
69425
  */
69425
69426
  get referenced_components() {
69426
69427
  const result = [];
@@ -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
 
@@ -71585,7 +71585,7 @@ class OnDemandWorkerManager {
71585
71585
  /**
71586
71586
  * @template T
71587
71587
  * @param {string} name
71588
- * @param {[]} [parameters]
71588
+ * @param {Array} [parameters]
71589
71589
  * @return {Promise<T>}
71590
71590
  */
71591
71591
  request(name, parameters) {
@@ -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
@@ -74823,7 +74796,7 @@ class Entity {
74823
74796
  * @returns {Entity}
74824
74797
  */
74825
74798
  add(componentInstance) {
74826
- if (componentInstance === undefined) {
74799
+ if (componentInstance === undefined || componentInstance === null) {
74827
74800
  throw new Error(`Can not add ${componentInstance} to Entity`);
74828
74801
  }
74829
74802
 
@@ -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;
@@ -77112,8 +77112,8 @@ function textureImagesEqual(a, b) {
77112
77112
 
77113
77113
  /**
77114
77114
  *
77115
- * @param {[]} a
77116
- * @param {[]} b
77115
+ * @param {Array} a
77116
+ * @param {Array} b
77117
77117
  * @returns {boolean}
77118
77118
  */
77119
77119
  function textureMipChainEqual(a, b) {
@@ -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
  }
@@ -93049,8 +93049,8 @@ class EntityComponentDataset {
93049
93049
  /**
93050
93050
  * Convenience method for retrieving a collection of components for a given entity
93051
93051
  * @param {number} entity ID of the entity
93052
- * @param {[]} componentClasses Classes of components to extract
93053
- * @returns {[]}
93052
+ * @param {Array} componentClasses Classes of components to extract
93053
+ * @returns {Array}
93054
93054
  */
93055
93055
  getComponents(entity, componentClasses) {
93056
93056
  assert.ok(this.entityExists(entity), `Entity ${entity} doesn't exist`);
@@ -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
  */
@@ -110346,7 +110346,7 @@ class InputController {
110346
110346
 
110347
110347
  /**
110348
110348
  *
110349
- * @param {[]} bindings
110349
+ * @param {Array} bindings
110350
110350
  */
110351
110351
  static from(bindings) {
110352
110352
  const ic = new InputController();
@@ -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) {