@woosh/meep-engine 2.59.6 → 2.60.1

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 (41) hide show
  1. package/build/meep.cjs +194 -184
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +194 -184
  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/sphere/harmonics/sh3_dering_optimize_positive.js +3 -3
  14. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +1 -1
  15. package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.js +1 -1
  16. package/src/core/geom/packing/miniball/Miniball.js +0 -1
  17. package/src/core/geom/packing/miniball/Subspan.js +1 -3
  18. package/src/core/graph/coloring/colorizeGraph.js +1 -1
  19. package/src/core/localization/Localization.js +11 -11
  20. package/src/core/model/ModuleRegistry.js +4 -4
  21. package/src/core/process/task/Task.js +3 -3
  22. package/src/engine/EngineConfiguration.js +0 -1
  23. package/src/engine/EngineHarness.js +1 -1
  24. package/src/engine/ecs/EntityComponentDataset.js +2 -2
  25. package/src/engine/ecs/parent/EntityNode.js +10 -10
  26. package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
  27. package/src/engine/graphics/ecs/camera/Camera.js +11 -11
  28. package/src/engine/graphics/ecs/camera/CameraSystem.d.ts +2 -3
  29. package/src/engine/graphics/ecs/camera/CameraSystem.js +2 -3
  30. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -1
  31. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
  32. package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +2 -2
  33. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +15 -4
  34. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
  35. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
  36. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
  37. package/src/engine/graphics/render/view/CameraView.js +1 -1
  38. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
  39. package/src/engine/graphics/shaders/ClearShader.js +1 -1
  40. package/src/engine/graphics/shadows/testShadowMapRendering.js +1 -1
  41. package/src/misc/makeMaterialIconCached.js +8 -1
@@ -7,7 +7,7 @@ import {
7
7
  * @param {Vector2} p1
8
8
  * @param {Vector2} p2
9
9
  * @param {Vector2} p3
10
- * @returns {[number,number]}
10
+ * @returns {number[]} 2 elements
11
11
  */
12
12
  export function line_segment_compute_line_segment_intersection_vectors_array_2d(p0, p1, p2, p3) {
13
13
  const p0_x = p0.x;
@@ -487,7 +487,7 @@ export class QuadTreeNode extends AABB2 {
487
487
 
488
488
  /**
489
489
  *
490
- * @param {QuadTreeDatum<D>[]} result
490
+ * @param {Array<QuadTreeDatum<D>>} result
491
491
  * @param {number} x
492
492
  * @param {number} y
493
493
  * @returns {number} number of intersecting objects added to the result
@@ -506,7 +506,7 @@ export class QuadTreeNode extends AABB2 {
506
506
 
507
507
  /**
508
508
  *
509
- * @param {QuadTreeDatum<D>[]} result
509
+ * @param {Array<QuadTreeDatum<D>>} result
510
510
  * @param {number} x0
511
511
  * @param {number} y0
512
512
  * @param {number} x1
@@ -8,7 +8,7 @@ const node_stack = [];
8
8
 
9
9
  /**
10
10
  * @template T
11
- * @param {QuadTreeDatum<T>[]} result
11
+ * @param {Array<QuadTreeDatum<T>>} result
12
12
  * @param {number} result_offset
13
13
  * @param {QuadTreeNode<T>} tree
14
14
  * @param {number} x
@@ -53,17 +53,17 @@ function factorial(n, d = 1) {
53
53
  }
54
54
 
55
55
  const F_PI = 3.14159265358979323846264338327950288;
56
- const F_2_PI = 0.636619772367581343075535053490057448;
57
56
  const F_2_SQRTPI = 1.12837916709551257389615890312154517;
58
57
  const F_SQRT2 = 1.41421356237309504880168872420969808;
59
58
  const F_SQRT1_2 = 0.707106781186547524400844362104849039;
60
59
  const M_SQRT_3 = 1.7320508076;
61
60
 
62
61
  /**
63
- * SH scaling factors:
64
- * returns sqrt((2*l + 1) / 4*pi) * sqrt( (l-|m|)! / (l+|m|)! )
62
+ * SH scaling factors
65
63
  */
66
64
  function Kml(m, l) {
65
+ // returns sqrt((2*l + 1) / 4*pi) * sqrt( (l-|m|)! / (l+|m|)! )
66
+
67
67
  m = m < 0 ? -m : m; // abs() is not constexpr
68
68
  const K = (2 * l + 1) * factorial((l - m), (l + m));
69
69
  return Math.sqrt(K) * (F_2_SQRTPI * 0.25);
@@ -135,7 +135,7 @@ export class TetrahedralMesh {
135
135
 
136
136
  /**
137
137
  * Traverse tetrahedrons
138
- * @param {(tet:number,mesh:TetrahedralMesh)=>*} visitor
138
+ * @param {function(tet:number,mesh:TetrahedralMesh):*} visitor
139
139
  * @param {*} [thisArg]
140
140
  */
141
141
  forEach(visitor, thisArg) {
@@ -134,7 +134,7 @@ function is_tetrahedron_degenerate(mesh, tet) {
134
134
  *
135
135
  * @param {TetrahedralMesh} mesh
136
136
  * @param {ArrayLike<number>} points
137
- * @param {(problem:string)=>*} [consumer]
137
+ * @param {function(problem:string):*} [consumer]
138
138
  * @returns {boolean}
139
139
  */
140
140
  export function validate_tetrahedral_mesh(mesh, points, consumer = noop) {
@@ -162,7 +162,6 @@ class Miniball {
162
162
  /**
163
163
  * TODO
164
164
  *
165
- * @return
166
165
  * @return {*}
167
166
  */
168
167
  support() {
@@ -273,8 +273,7 @@ export class Subspan {
273
273
  *
274
274
  * Complexity: O(dim^2).
275
275
  *
276
- * @param {number} index
277
- * index into <i>S</i> of the point to add
276
+ * @param {number} index index into <i>S</i> of the point to add
278
277
  */
279
278
  add(index) {
280
279
  let o = this.origin();
@@ -310,7 +309,6 @@ export class Subspan {
310
309
  * Euclidean coordinates of point <i>p</i>
311
310
  * @param {Array} w
312
311
  * the squared length of <i>w</i>
313
- * @return
314
312
  * @return {number}
315
313
  */
316
314
  shortestVectorToSpan(p, w) {
@@ -118,7 +118,7 @@ function updateNN(NN, a, vertexCount, colors, colorNumber) {
118
118
  * @param {number[]} NN
119
119
  * @param {number[]} color
120
120
  * @param {number} colorNumber
121
- * @return {(number)[]}
121
+ * @return {number[]}
122
122
  */
123
123
  function findSuitableY(vertexCount, a, NN, color, colorNumber) {
124
124
  var temp, tmp_y, y = 0;
@@ -1,13 +1,13 @@
1
- import { distance as levenshtein_distance } from "fastest-levenshtein";
2
- import { parseTooltipString } from "../../view/tooltip/gml/parser/parseTooltipString.js";
3
- import { assert } from "../assert.js";
1
+ import {distance as levenshtein_distance} from "fastest-levenshtein";
2
+ import {parseTooltipString} from "../../view/tooltip/gml/parser/parseTooltipString.js";
3
+ import {assert} from "../assert.js";
4
+ import {Cache} from "../cache/Cache.js";
5
+ import {computeHashArray} from "../collection/array/computeHashArray.js";
4
6
  import ObservedString from "../model/ObservedString.js";
5
- import { seedVariablesIntoTemplateString } from "../parser/seedVariablesIntoTemplateString.js";
6
- import { STRING_TEMPLATE_VARIABLE_REGEX } from "../parser/STRING_TEMPLATE_VARIABLE_REGEX.js";
7
- import { Cache } from "../cache/Cache.js";
8
- import { computeStringHash } from "../primitives/strings/computeStringHash.js";
9
- import { computeHashArray } from "../collection/array/computeHashArray.js";
10
- import { LanguageMetadata } from "./LanguageMetadata.js";
7
+ import {seedVariablesIntoTemplateString} from "../parser/seedVariablesIntoTemplateString.js";
8
+ import {STRING_TEMPLATE_VARIABLE_REGEX} from "../parser/STRING_TEMPLATE_VARIABLE_REGEX.js";
9
+ import {computeStringHash} from "../primitives/strings/computeStringHash.js";
10
+ import {LanguageMetadata} from "./LanguageMetadata.js";
11
11
 
12
12
  /**
13
13
  * Validation utility method
@@ -56,7 +56,7 @@ export class Localization {
56
56
  this.debug = true;
57
57
 
58
58
  /**
59
- * @type {Cache<string[], string>}
59
+ * @type {Cache<Array<string>, string>}
60
60
  * @private
61
61
  */
62
62
  this.__failure_cache = new Cache({
@@ -176,7 +176,7 @@ export class Localization {
176
176
  * @param {number} value
177
177
  */
178
178
  formatIntegerByThousands(value) {
179
- const formatter = new Intl.NumberFormat(this.locale.getValue(), { useGrouping: true });
179
+ const formatter = new Intl.NumberFormat(this.locale.getValue(), {useGrouping: true});
180
180
 
181
181
  return formatter.format(value);
182
182
  }
@@ -9,7 +9,7 @@ export class ModuleRegistry {
9
9
  #modules = new Map();
10
10
  /**
11
11
  *
12
- * @type {Map<*,string[]>}
12
+ * @type {Map<*,Array<string>>}
13
13
  */
14
14
  #reverse_lookup = new Map();
15
15
 
@@ -37,7 +37,7 @@ export class ModuleRegistry {
37
37
 
38
38
  /**
39
39
  *
40
- * @param {(name:string, module:*)=>void} visitor
40
+ * @param {function(name:string,module:*):void} visitor
41
41
  */
42
42
  traverse(visitor) {
43
43
  this.#modules.forEach((klass, name) => visitor(name, klass));
@@ -55,7 +55,7 @@ export class ModuleRegistry {
55
55
 
56
56
  /**
57
57
  *
58
- * @param {String} name
58
+ * @param {string} name
59
59
  * @returns {boolean}
60
60
  */
61
61
  has(name) {
@@ -64,7 +64,7 @@ export class ModuleRegistry {
64
64
 
65
65
  /**
66
66
  * @template T
67
- * @param {String} name
67
+ * @param {string} name
68
68
  * @param {T} module
69
69
  * @returns {boolean}
70
70
  */
@@ -55,7 +55,7 @@ class Task {
55
55
 
56
56
  /**
57
57
  *
58
- * @type {function(Task, executor:{run:function(Task)})}
58
+ * @type {function(Task, executor:ConcurrentExecutor)}
59
59
  */
60
60
  this.initialize = initializer;
61
61
 
@@ -149,7 +149,7 @@ class Task {
149
149
 
150
150
  /**
151
151
  *
152
- * @param {(Task|TaskGroup)[]} tasks
152
+ * @param {Array<(Task|TaskGroup)>} tasks
153
153
  */
154
154
  addDependencies(tasks) {
155
155
  if (!Array.isArray(tasks)) {
@@ -205,7 +205,7 @@ class Task {
205
205
 
206
206
  /**
207
207
  *
208
- * @param {(Task|TaskGroup)[]} tasks
208
+ * @param {Array<(Task|TaskGroup)>} tasks
209
209
  * @return {Promise}
210
210
  */
211
211
  static promiseAll(tasks) {
@@ -91,7 +91,6 @@ export class EngineConfiguration {
91
91
  }
92
92
 
93
93
  /**
94
- *
95
94
  * @param {System} systems
96
95
  */
97
96
  addManySystems(...systems) {
@@ -184,7 +184,7 @@ export class EngineHarness {
184
184
  em.addSystem(new TopDownCameraControllerSystem());
185
185
  }
186
186
  if (em.getSystem(CameraSystem) === null) {
187
- em.addSystem(new CameraSystem(engine.graphics.scene, engine.graphics))
187
+ em.addSystem(new CameraSystem(engine.graphics))
188
188
  }
189
189
 
190
190
  if (em.getSystem(SoundListenerSystem) === null) {
@@ -1094,7 +1094,7 @@ export class EntityComponentDataset {
1094
1094
  * Performs traversal on a subset of entities which have specified components.
1095
1095
  * @example traverseEntities([Transform,Renderable,Tag],function(transform, renderable, tag, entity){ ... }, this);
1096
1096
  * @param {Array} classes
1097
- * @param {function:boolean?} visitor Visitor can return optional "false" to terminate traversal earlier
1097
+ * @param {function(...args):boolean} visitor Visitor can return optional "false" to terminate traversal earlier
1098
1098
  * @param {object} [thisArg] specifies context object on which callbacks are to be called, optional
1099
1099
  */
1100
1100
  traverseEntities(classes, visitor, thisArg) {
@@ -1719,7 +1719,7 @@ export class EntityComponentDataset {
1719
1719
  /**
1720
1720
  * Main utility of this method is to facilitate serialization.
1721
1721
  * @param {Array} componentClasses
1722
- * @param {function(componentIndex:number,components:[], componentCount:number)} visitor
1722
+ * @param {function(componentIndex:number,components:Array, componentCount:number)} visitor
1723
1723
  */
1724
1724
  traverseEntitiesCompactedFiltered(componentClasses, visitor) {
1725
1725
 
@@ -1,12 +1,12 @@
1
- import { ParentEntity } from "./ParentEntity.js";
2
- import Entity from "../Entity.js";
3
- import { array_remove_first } from "../../../core/collection/array/array_remove_first.js";
4
- import { assert } from "../../../core/assert.js";
5
- import { array_push_if_unique } from "../../../core/collection/array/array_push_if_unique.js";
6
- import { Transform } from "../transform/Transform.js";
7
- import { TransformAttachment, TransformAttachmentFlags } from "../transform-attachment/TransformAttachment.js";
1
+ import {assert} from "../../../core/assert.js";
2
+ import {array_push_if_unique} from "../../../core/collection/array/array_push_if_unique.js";
3
+ import {array_remove_first} from "../../../core/collection/array/array_remove_first.js";
8
4
  import Signal from "../../../core/events/signal/Signal.js";
9
- import { EntityNodeFlags } from "./EntityNodeFlags.js";
5
+ import Entity from "../Entity.js";
6
+ import {TransformAttachment, TransformAttachmentFlags} from "../transform-attachment/TransformAttachment.js";
7
+ import {Transform} from "../transform/Transform.js";
8
+ import {EntityNodeFlags} from "./EntityNodeFlags.js";
9
+ import {ParentEntity} from "./ParentEntity.js";
10
10
 
11
11
  const DEFAULT_FLAGS = EntityNodeFlags.LiveManagement;
12
12
 
@@ -116,7 +116,7 @@ export class EntityNode {
116
116
 
117
117
  /**
118
118
  *
119
- * @param {(EntityNode) => *} visitor
119
+ * @param {function(node:EntityNode):*} visitor
120
120
  * @param {*} [context]
121
121
  */
122
122
  traverseChildren(visitor, context) {
@@ -125,7 +125,7 @@ export class EntityNode {
125
125
 
126
126
  /**
127
127
  *
128
- * @return {Readonly<EntityNode[]>}
128
+ * @return {Readonly<Array<EntityNode>>}
129
129
  */
130
130
  get children() {
131
131
  return this.__children;
@@ -92,7 +92,7 @@ function makeConfig(engine) {
92
92
  new AnimationSystem(graphics.viewport.size),
93
93
  new TopDownCameraControllerSystem(graphics),
94
94
  new TopDownCameraLanderSystem(),
95
- new CameraSystem(graphics.scene, graphics),
95
+ new CameraSystem(engine.graphics),
96
96
  new MeshSystem(engine),
97
97
  new ClingToTerrainSystem(),
98
98
  new TerrainSystem(graphics, assetManager),
@@ -3,18 +3,18 @@
3
3
  */
4
4
 
5
5
 
6
- import ObservedBoolean from "../../../../core/model/ObservedBoolean.js";
7
- import ObservedEnum from "../../../../core/model/ObservedEnum.js";
8
- import { Frustum } from 'three';
9
- import { assert } from "../../../../core/assert.js";
6
+ import {Frustum} from 'three';
7
+ import {assert} from "../../../../core/assert.js";
8
+ import {plane3_compute_ray_intersection} from "../../../../core/geom/3d/plane/plane3_compute_ray_intersection.js";
9
+ import {v3_distance_above_plane} from "../../../../core/geom/vec3/v3_distance_above_plane.js";
10
10
  import Vector1 from "../../../../core/geom/Vector1.js";
11
- import { unprojectPoint } from "./unprojectPoint.js";
12
11
  import Vector3 from "../../../../core/geom/Vector3.js";
13
- import { frustum_from_camera } from "./frustum_from_camera.js";
14
- import { invertQuaternionOrientation } from "./InvertQuaternionOrientation.js";
15
- import { v3_distance_above_plane } from "../../../../core/geom/vec3/v3_distance_above_plane.js";
16
- import { ProjectionType } from "./ProjectionType.js";
17
- import { plane3_compute_ray_intersection } from "../../../../core/geom/3d/plane/plane3_compute_ray_intersection.js";
12
+ import ObservedBoolean from "../../../../core/model/ObservedBoolean.js";
13
+ import ObservedEnum from "../../../../core/model/ObservedEnum.js";
14
+ import {frustum_from_camera} from "./frustum_from_camera.js";
15
+ import {invertQuaternionOrientation} from "./InvertQuaternionOrientation.js";
16
+ import {ProjectionType} from "./ProjectionType.js";
17
+ import {unprojectPoint} from "./unprojectPoint.js";
18
18
 
19
19
  /**
20
20
  * @class
@@ -51,7 +51,7 @@ export class Camera {
51
51
  *
52
52
  * @type {ObservedBoolean}
53
53
  */
54
- this.active = new ObservedBoolean(false);
54
+ this.active = new ObservedBoolean(true);
55
55
 
56
56
  /**
57
57
  * Near clipping plane
@@ -1,11 +1,10 @@
1
+ import {EntityComponentDataset} from "../../../ecs/EntityComponentDataset";
1
2
  import {System} from "../../../ecs/System";
2
- import {Scene} from "three";
3
3
  import {GraphicsEngine} from "../../GraphicsEngine";
4
- import {EntityComponentDataset} from "../../../ecs/EntityComponentDataset";
5
4
  import {Camera} from "./Camera";
6
5
 
7
6
  export class CameraSystem extends System<Camera> {
8
- constructor(scene: Scene, graphics: GraphicsEngine)
7
+ constructor(engine: GraphicsEngine)
9
8
 
10
9
  public static getFirstActiveCamera(ecd: EntityComponentDataset): { entity: number, component: Camera | undefined }
11
10
  }
@@ -21,14 +21,13 @@ import { ResourceAccessKind } from "../../../../core/model/ResourceAccessKind.js
21
21
  export class CameraSystem extends System {
22
22
  /**
23
23
  *
24
- * @param {THREE.Scene} scene
25
24
  * @param {GraphicsEngine} graphics
26
25
  * @constructor
27
26
  */
28
- constructor(scene, graphics) {
27
+ constructor(graphics) {
29
28
  super();
30
29
 
31
- this.scene = scene;
30
+ this.scene = graphics.scene;
32
31
 
33
32
  this.dependencies = [Camera, Transform];
34
33
 
@@ -102,7 +102,7 @@ function makeConfig(engine) {
102
102
  new AnimationSystem(graphics.viewport.size),
103
103
  new TopDownCameraControllerSystem(graphics),
104
104
  new TopDownCameraLanderSystem(),
105
- new CameraSystem(graphics.scene, graphics),
105
+ new CameraSystem(engine.graphics),
106
106
  new MeshSystem(engine),
107
107
  new ClingToTerrainSystem(),
108
108
  new TerrainSystem(graphics, assetManager),
@@ -106,7 +106,7 @@ function makeConfig(engine) {
106
106
  new AnimationSystem(graphics.viewport.size),
107
107
  new TopDownCameraControllerSystem(graphics),
108
108
  new TopDownCameraLanderSystem(),
109
- new CameraSystem(graphics.scene, graphics),
109
+ new CameraSystem(engine.graphics),
110
110
  new MeshSystem(engine),
111
111
  new ClingToTerrainSystem(),
112
112
  new TerrainSystem(graphics, assetManager),
@@ -38,14 +38,14 @@ function makeConfig(engine) {
38
38
  const assetManager = engine.assetManager;
39
39
  const devices = engine.devices;
40
40
 
41
- config.systems.push(
41
+ config.addManySystems(
42
42
  new ScriptSystem(),
43
43
  new PathFollowingSystem(),
44
44
  new TagSystem(),
45
45
  new TimerSystem(),
46
46
  new TopDownCameraControllerSystem(graphics),
47
47
  new TopDownCameraLanderSystem(),
48
- new CameraSystem(graphics.scene, graphics),
48
+ new CameraSystem(engine.graphics),
49
49
  new MeshSystem(graphics, assetManager),
50
50
  new TerrainSystem(graphics, assetManager),
51
51
  new WaterSystem(graphics),
@@ -21,9 +21,15 @@ import { array_copy } from "../../../../core/collection/array/array_copy.js";
21
21
  import { Cache } from "../../../../core/cache/Cache.js";
22
22
  import { computeMaterialHash } from "../../../asset/loaders/material/computeMaterialHash.js";
23
23
 
24
+ /**
25
+ * @typedef {Object} CacheKey
26
+ * @property {Material} color
27
+ * @property {Material} depth
28
+ */
29
+
24
30
  /**
25
31
  * @readonly
26
- * @type {Cache<Material, {color:Material, depth:Material}>}
32
+ * @type {Cache<Material,CacheKey>}
27
33
  */
28
34
  const material_cache = new Cache({
29
35
  maxWeight: 1024,
@@ -38,14 +44,14 @@ export class InstancedMeshGroup {
38
44
  constructor() {
39
45
  /**
40
46
  * Instanced geometry
41
- * @type {THREE.InstancedBufferGeometry|null}
47
+ * @type {InstancedBufferGeometry|null}
42
48
  * @private
43
49
  */
44
50
  this.__threeGeometry = null;
45
51
 
46
52
  /**
47
53
  * Geometry of a single instance
48
- * @type {THREE.BufferGeometry|null}
54
+ * @type {BufferGeometry|null}
49
55
  * @private
50
56
  */
51
57
  this.__threeInstanceGeometry = null;
@@ -73,7 +79,12 @@ export class InstancedMeshGroup {
73
79
  */
74
80
  this.growConstant = 16;
75
81
 
82
+ /**
83
+ *
84
+ * @type {number}
85
+ */
76
86
  this.shrinkFactor = 0.5;
87
+
77
88
  /**
78
89
  * Minimum capacity reduction for shrinkage to occur
79
90
  * @type {number}
@@ -238,7 +249,7 @@ export class InstancedMeshGroup {
238
249
  /**
239
250
  *
240
251
  * @param {THREE.Material|THREE.ShaderMaterial} sourceMaterial
241
- * @returns {{depth: Material, color: Material}}
252
+ * @returns {CacheKey}
242
253
  */
243
254
  #buildMaterial(sourceMaterial) {
244
255
  //console.warn(`building material : {id:${sourceMaterial.id}, name: ${sourceMaterial.name}, type: ${sourceMaterial.type}`)
@@ -99,7 +99,7 @@ function makeConfig(engine) {
99
99
  const guiSystem = new GUIElementSystem(engine.gui.view, engine);
100
100
  const headsUpDisplaySystem = new HeadsUpDisplaySystem(graphics);
101
101
 
102
- config.systems.push(
102
+ config.addManySystems(
103
103
  new TagSystem(),
104
104
  new AttachmentSystem(),
105
105
  new SoundEmitterSystem(assetManager, sound.destination, sound.context),
@@ -108,7 +108,7 @@ function makeConfig(engine) {
108
108
  guiSystem,
109
109
  new AnimationSystem(graphics.viewport.size),
110
110
  new TopDownCameraControllerSystem(graphics),
111
- new CameraSystem(graphics.scene, graphics),
111
+ new CameraSystem(engine.graphics),
112
112
  new MeshSystem(engine),
113
113
  new ClingToTerrainSystem(),
114
114
  new TerrainSystem(graphics, assetManager),
@@ -98,7 +98,7 @@ function makeConfig(engine) {
98
98
  new AnimationSystem(graphics.viewport.size),
99
99
  new TopDownCameraControllerSystem(graphics),
100
100
  new TopDownCameraLanderSystem(),
101
- new CameraSystem(graphics.scene, graphics),
101
+ new CameraSystem(engine.graphics),
102
102
  new MeshSystem(engine),
103
103
  new ClingToTerrainSystem(),
104
104
  new TerrainSystem(graphics, assetManager),
@@ -126,7 +126,7 @@ function makeConfig(engine) {
126
126
  new AnimationSystem(graphics.viewport.size),
127
127
  new TopDownCameraControllerSystem(graphics),
128
128
  new TopDownCameraLanderSystem(),
129
- new CameraSystem(graphics.scene, graphics),
129
+ new CameraSystem(engine.graphics),
130
130
  new MeshSystem(engine),
131
131
  new ClingToTerrainSystem(),
132
132
  new TerrainSystem(graphics, assetManager),
@@ -73,7 +73,7 @@ export class CameraView {
73
73
 
74
74
  /**
75
75
  *
76
- * @type {{transform:(Float32Array, Float32Array)=>void, context:*}[]}
76
+ * @type {Array<{transform:function(Float32Array, Float32Array):void, context:*}>}
77
77
  */
78
78
  this.projection_modifiers = [];
79
79
  }
@@ -103,7 +103,7 @@ function makeConfig(engine) {
103
103
  new AnimationSystem(graphics.viewport.size),
104
104
  new TopDownCameraControllerSystem(graphics),
105
105
  new TopDownCameraLanderSystem(),
106
- new CameraSystem(graphics.scene, graphics),
106
+ new CameraSystem(engine.graphics),
107
107
  new MeshSystem(engine),
108
108
  new ClingToTerrainSystem(),
109
109
  new TerrainSystem(graphics, assetManager),
@@ -24,7 +24,7 @@ const ClearShader = {
24
24
  "}"
25
25
 
26
26
 
27
- ].join("\n')
27
+ ].join("\n")
28
28
  };
29
29
 
30
30
  export default ClearShader;
@@ -79,7 +79,7 @@ function makeConfig(engine) {
79
79
  guiSystem,
80
80
  new AnimationSystem(graphics.viewport.size),
81
81
  new TopDownCameraControllerSystem(graphics),
82
- new CameraSystem(graphics.scene, graphics),
82
+ new CameraSystem(engine.graphics),
83
83
  new MeshSystem(engine),
84
84
  new ClingToTerrainSystem(),
85
85
  new TerrainSystem(graphics, assetManager),
@@ -4,9 +4,16 @@ import { computeMaterialHash } from "../engine/asset/loaders/material/computeMat
4
4
  import { makeMaterialIcon } from "./makeMaterialIcon.js";
5
5
  import { computeHashIntegerArray } from "../core/collection/array/computeHashIntegerArray.js";
6
6
 
7
+
8
+ /**
9
+ * @typedef {Object} CacheKey
10
+ * @property {number} size
11
+ * @property {Material} material
12
+ */
13
+
7
14
  /**
8
15
  *
9
- * @type {Cache<{size:number,material:THREE.Material}, Sampler2D>}
16
+ * @type {Cache<CacheKey, Sampler2D>}
10
17
  */
11
18
  const cache = new Cache({
12
19
  maxWeight: 1024000,