@woosh/meep-engine 2.131.3 → 2.131.5

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 (23) hide show
  1. package/package.json +1 -1
  2. package/src/core/collection/queue/Deque.d.ts.map +1 -1
  3. package/src/core/collection/queue/Deque.js +17 -12
  4. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD.d.ts +1 -0
  5. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD.d.ts.map +1 -1
  6. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD.js +1 -0
  7. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.d.ts +39 -0
  8. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.js +235 -214
  9. package/src/core/math/physics/mie/compute_lorenz_mie_optical_properties.d.ts.map +1 -1
  10. package/src/core/math/physics/mie/compute_lorenz_mie_optical_properties.js +3 -339
  11. package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.js +1 -1
  12. package/src/core/math/physics/mie/compute_mie_phase.d.ts +16 -0
  13. package/src/core/math/physics/mie/compute_mie_phase.d.ts.map +1 -0
  14. package/src/core/math/physics/mie/compute_mie_phase.js +84 -0
  15. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +29 -0
  16. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -0
  17. package/src/core/math/physics/mie/lorenz_mie_coefs.js +233 -0
  18. package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts +14 -0
  19. package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts.map +1 -0
  20. package/src/core/math/physics/mie/mie_ab_to_optical_properties.js +109 -0
  21. package/src/engine/animation/curve/AnimationCurve.d.ts +18 -3
  22. package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
  23. package/src/engine/animation/curve/AnimationCurve.js +69 -36
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Pure JavaScript game engine. Fully featured and production ready.",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.131.3",
8
+ "version": "2.131.5",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"Deque.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/queue/Deque.js"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH;IAgCI;;;OAGG;IACH,uBAFW,MAAM,EAUhB;IA4FD;;;OAGG;IACH,WAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,SAFa,IAAI,CAiBhB;IAED;;;OAGG;IACH,QAFa,MAAM,CAalB;IA6BD;;;;OAIG;IACH,UAHW,CAAC,GACC,OAAO,CAqBnB;IA4BD;;;;OAIG;IACH,OAHW,CAAC,GACC,OAAO,CAInB;IAED;;;OAGG;IACH,YAFW,CAAC,QAOX;IAED;;;OAGG;IACH,eAFa,CAAC,GAAC,SAAS,CAQvB;IAED;;;OAGG;IACH,YAFa,CAAC,GAAC,SAAS,CAIvB;IAED;;;;OAIG;IACH,WAHW,CAAC,GACC,IAAI,CAOhB;IAED;;;OAGG;IACH,cAFa,CAAC,CASb;IAGD;;;OAGG;IACH,WAFa,CAAC,GAAC,SAAS,CAKvB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,CAAC,GAAC,SAAS,CAmBvB;IAED;;;;;OAKG;IACH,iBAJW,CAAC,EAAE,kBACH,MAAM,GACJ,CAAC,EAAE,CAUf;IAoBL;;OAEG;IACH,gBAAoB;IACpB;;OAEG;IACH,uBAAoB;IACpB;;OAEG;IACH,eAAmB;IAEnB;;OAEG;IACH,iBA1GiB,IAAI,CA0GF;IAlCf;;;OAGG;IACH,qBAFa,UAAU,CAAC,EAAC,IAAI,CAAC,CAS7B;;CACJ"}
1
+ {"version":3,"file":"Deque.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/queue/Deque.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH;IAgCI;;;OAGG;IACH,uBAFW,MAAM,EAUhB;IA4FD;;;OAGG;IACH,WAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,SAFa,IAAI,CAiBhB;IAED;;;OAGG;IACH,QAFa,MAAM,CAalB;IA6BD;;;;;;;OAOG;IACH,UAHW,CAAC,GACC,OAAO,CAqBnB;IA4BD;;;;OAIG;IACH,OAHW,CAAC,GACC,OAAO,CAInB;IAED;;;OAGG;IACH,YAFW,CAAC,QAOX;IAED;;;OAGG;IACH,eAFa,CAAC,GAAC,SAAS,CAQvB;IAED;;;OAGG;IACH,YAFa,CAAC,GAAC,SAAS,CAIvB;IAED;;;;OAIG;IACH,WAHW,CAAC,GACC,IAAI,CAOhB;IAED;;;OAGG;IACH,cAFa,CAAC,CASb;IAGD;;;OAGG;IACH,WAFa,CAAC,GAAC,SAAS,CAKvB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,CAAC,GAAC,SAAS,CAmBvB;IAED;;;;;OAKG;IACH,iBAJW,CAAC,EAAE,kBACH,MAAM,GACJ,CAAC,EAAE,CAUf;IAoBL;;OAEG;IACH,gBAAoB;IACpB;;OAEG;IACH,uBAAoB;IACpB;;OAEG;IACH,eAAmB;IAEnB;;OAEG;IACH,iBA1GiB,IAAI,CA0GF;IAlCf;;;OAGG;IACH,qBAFa,UAAU,CAAC,EAAC,IAAI,CAAC,CAS7B;;CACJ"}
@@ -23,6 +23,8 @@ const EMPTY_ARRAY = new Array(0);
23
23
  * Queue data structure, first-in-first-out (FIFO).
24
24
  * Double-ended queue backed by an array.
25
25
  * The fact that it's double-ended means you can add and remove from both ends.
26
+ *
27
+ * Note that the implementation is optimized for high speed and low memory usage; it avoids allocations entirely.
26
28
  * @template T
27
29
  */
28
30
  export class Deque {
@@ -236,9 +238,12 @@ export class Deque {
236
238
  }
237
239
 
238
240
  /**
239
- * Remove first occurrence of element from the queue
240
- * @param {T} e
241
- * @returns {boolean}
241
+ * Remove the first occurrence of an element from the queue. This means that if there are 2 instances of an element in the queue, only one will be removed.
242
+ *
243
+ * Note: the queue is intended for sequential access primarily, so if you often find yourself needing this method - consider using an alternative data structure, such as a {@link Map} or a {@link Set} as those excel at random access.
244
+ *
245
+ * @param {T} e element to remove
246
+ * @returns {boolean} true if the element was removed, false if the element was not found.
242
247
  */
243
248
  remove(e) {
244
249
  const i = this.#index_of(e);
@@ -290,14 +295,14 @@ export class Deque {
290
295
  /**
291
296
  *
292
297
  * @param {T} e
293
- * @returns {boolean}
298
+ * @returns {boolean} if the queue contains the element
294
299
  */
295
300
  has(e) {
296
301
  return this.#index_of(e) !== -1;
297
302
  }
298
303
 
299
304
  /**
300
- * Add element at the front of the queue
305
+ * Add the element at the front of the queue
301
306
  * @param {T} e
302
307
  */
303
308
  addFirst(e) {
@@ -308,7 +313,7 @@ export class Deque {
308
313
  }
309
314
 
310
315
  /**
311
- * Remove element from the front of the queue
316
+ * Remove an element from the front of the queue
312
317
  * @returns {T|undefined}
313
318
  */
314
319
  removeFirst() {
@@ -320,7 +325,7 @@ export class Deque {
320
325
  }
321
326
 
322
327
  /**
323
- * Peek element from the front of the queue without removing it
328
+ * Peek an element from the front of the queue without removing it
324
329
  * @returns {T|undefined}
325
330
  */
326
331
  getFirst() {
@@ -328,7 +333,7 @@ export class Deque {
328
333
  }
329
334
 
330
335
  /**
331
- * Add element at the end of the queue
336
+ * Add the element at the end of the queue
332
337
  * @param {T} e
333
338
  * @returns {void}
334
339
  */
@@ -340,7 +345,7 @@ export class Deque {
340
345
  }
341
346
 
342
347
  /**
343
- * Remove element from the end of the queue
348
+ * Remove an element from the end of the queue
344
349
  * @returns {T}
345
350
  */
346
351
  removeLast() {
@@ -354,7 +359,7 @@ export class Deque {
354
359
 
355
360
 
356
361
  /**
357
- * Peek element from the end of the queue without removing it
362
+ * Peek an element from the end of the queue without removing it
358
363
  * @returns {T|undefined}
359
364
  */
360
365
  getLast() {
@@ -363,9 +368,9 @@ export class Deque {
363
368
  }
364
369
 
365
370
  /**
366
- * Retrieved element by position from head. Where element at the head is position 0
371
+ * Retrieves the element by sequential position from the start of the queue; the element at the start is position 0.
367
372
  * @param {number} index
368
- * @returns {T|undefined} undefined if indexing element that is past the end, otherwise returns element at the position given
373
+ * @returns {T|undefined} undefined if indexing the element that is past the end, otherwise returns element at the position given
369
374
  */
370
375
  getElementByIndex(index) {
371
376
  assert.isNonNegativeInteger(index, 'index');
@@ -14,6 +14,7 @@ export namespace MIE_PARTICLES_STANDARD {
14
14
  export let cross_section_scattering: number[];
15
15
  export let cross_section_extinction: number[];
16
16
  export let extinction_intercept: number[];
17
+ export let g: number;
17
18
  export let albedo: number[];
18
19
  }
19
20
  namespace CONTINENTAL_HAZE_MEDIUM { }
@@ -1 +1 @@
1
- {"version":3,"file":"MIE_PARTICLES_STANDARD.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/mie/MIE_PARTICLES_STANDARD.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBI,6BAAgC"}
1
+ {"version":3,"file":"MIE_PARTICLES_STANDARD.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/mie/MIE_PARTICLES_STANDARD.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBI,6BAAgC"}
@@ -33,6 +33,7 @@ function make(diameter_m, refraction){
33
33
  cross_section_scattering: mie.scattering_coefficients, // [R_sca, G_sca, B_sca]
34
34
  cross_section_extinction: mie.extinction_coefficients, // [R_ext, G_ext, B_ext]
35
35
  extinction_intercept: mie.extinction_intercept,
36
+ g: mie.g,
36
37
  albedo: mie.albedo,
37
38
  }
38
39
  }
@@ -3,6 +3,7 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
3
3
  let radius: number;
4
4
  let cross_section_scattering: number[];
5
5
  let cross_section_extinction: number[];
6
+ let g: number;
6
7
  }
7
8
  namespace CONTINENTAL_HAZE_MEDIUM {
8
9
  let radius_1: number;
@@ -11,6 +12,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
11
12
  export { cross_section_scattering_1 as cross_section_scattering };
12
13
  let cross_section_extinction_1: number[];
13
14
  export { cross_section_extinction_1 as cross_section_extinction };
15
+ let g_1: number;
16
+ export { g_1 as g };
14
17
  }
15
18
  namespace CONTINENTAL_HAZE_LARGE {
16
19
  let radius_2: number;
@@ -19,6 +22,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
19
22
  export { cross_section_scattering_2 as cross_section_scattering };
20
23
  let cross_section_extinction_2: number[];
21
24
  export { cross_section_extinction_2 as cross_section_extinction };
25
+ let g_2: number;
26
+ export { g_2 as g };
22
27
  }
23
28
  namespace MARITIME_HAZE_SMALL {
24
29
  let radius_3: number;
@@ -27,6 +32,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
27
32
  export { cross_section_scattering_3 as cross_section_scattering };
28
33
  let cross_section_extinction_3: number[];
29
34
  export { cross_section_extinction_3 as cross_section_extinction };
35
+ let g_3: number;
36
+ export { g_3 as g };
30
37
  }
31
38
  namespace MARITIME_HAZE_MEDIUM {
32
39
  let radius_4: number;
@@ -35,6 +42,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
35
42
  export { cross_section_scattering_4 as cross_section_scattering };
36
43
  let cross_section_extinction_4: number[];
37
44
  export { cross_section_extinction_4 as cross_section_extinction };
45
+ let g_4: number;
46
+ export { g_4 as g };
38
47
  }
39
48
  namespace MARITIME_HAZE_LARGE {
40
49
  let radius_5: number;
@@ -43,6 +52,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
43
52
  export { cross_section_scattering_5 as cross_section_scattering };
44
53
  let cross_section_extinction_5: number[];
45
54
  export { cross_section_extinction_5 as cross_section_extinction };
55
+ let g_5: number;
56
+ export { g_5 as g };
46
57
  }
47
58
  namespace FOG_DROPLET_SMALL {
48
59
  let radius_6: number;
@@ -51,6 +62,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
51
62
  export { cross_section_scattering_6 as cross_section_scattering };
52
63
  let cross_section_extinction_6: number[];
53
64
  export { cross_section_extinction_6 as cross_section_extinction };
65
+ let g_6: number;
66
+ export { g_6 as g };
54
67
  }
55
68
  namespace FOG_DROPLET_MEDIUM {
56
69
  let radius_7: number;
@@ -59,6 +72,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
59
72
  export { cross_section_scattering_7 as cross_section_scattering };
60
73
  let cross_section_extinction_7: number[];
61
74
  export { cross_section_extinction_7 as cross_section_extinction };
75
+ let g_7: number;
76
+ export { g_7 as g };
62
77
  }
63
78
  namespace CLOUD_DROPLET_LARGE {
64
79
  let radius_8: number;
@@ -67,6 +82,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
67
82
  export { cross_section_scattering_8 as cross_section_scattering };
68
83
  let cross_section_extinction_8: number[];
69
84
  export { cross_section_extinction_8 as cross_section_extinction };
85
+ let g_8: number;
86
+ export { g_8 as g };
70
87
  }
71
88
  namespace SMOKE_PARTICLE_SMALL {
72
89
  let radius_9: number;
@@ -75,6 +92,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
75
92
  export { cross_section_scattering_9 as cross_section_scattering };
76
93
  let cross_section_extinction_9: number[];
77
94
  export { cross_section_extinction_9 as cross_section_extinction };
95
+ let g_9: number;
96
+ export { g_9 as g };
78
97
  }
79
98
  namespace SMOKE_PARTICLE_MEDIUM {
80
99
  let radius_10: number;
@@ -83,6 +102,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
83
102
  export { cross_section_scattering_10 as cross_section_scattering };
84
103
  let cross_section_extinction_10: number[];
85
104
  export { cross_section_extinction_10 as cross_section_extinction };
105
+ let g_10: number;
106
+ export { g_10 as g };
86
107
  }
87
108
  namespace SMOKE_PARTICLE_LARGE {
88
109
  let radius_11: number;
@@ -91,6 +112,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
91
112
  export { cross_section_scattering_11 as cross_section_scattering };
92
113
  let cross_section_extinction_11: number[];
93
114
  export { cross_section_extinction_11 as cross_section_extinction };
115
+ let g_11: number;
116
+ export { g_11 as g };
94
117
  }
95
118
  namespace SOOT_PARTICLE_SMALL {
96
119
  let radius_12: number;
@@ -99,6 +122,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
99
122
  export { cross_section_scattering_12 as cross_section_scattering };
100
123
  let cross_section_extinction_12: number[];
101
124
  export { cross_section_extinction_12 as cross_section_extinction };
125
+ let g_12: number;
126
+ export { g_12 as g };
102
127
  }
103
128
  namespace SOOT_AGGREGATE_MEDIUM {
104
129
  let radius_13: number;
@@ -107,6 +132,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
107
132
  export { cross_section_scattering_13 as cross_section_scattering };
108
133
  let cross_section_extinction_13: number[];
109
134
  export { cross_section_extinction_13 as cross_section_extinction };
135
+ let g_13: number;
136
+ export { g_13 as g };
110
137
  }
111
138
  namespace SOOT_AGGREGATE_LARGE {
112
139
  let radius_14: number;
@@ -115,6 +142,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
115
142
  export { cross_section_scattering_14 as cross_section_scattering };
116
143
  let cross_section_extinction_14: number[];
117
144
  export { cross_section_extinction_14 as cross_section_extinction };
145
+ let g_14: number;
146
+ export { g_14 as g };
118
147
  }
119
148
  namespace FINE_DUST_SMALL {
120
149
  let radius_15: number;
@@ -123,6 +152,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
123
152
  export { cross_section_scattering_15 as cross_section_scattering };
124
153
  let cross_section_extinction_15: number[];
125
154
  export { cross_section_extinction_15 as cross_section_extinction };
155
+ let g_15: number;
156
+ export { g_15 as g };
126
157
  }
127
158
  namespace COARSE_DUST_MEDIUM {
128
159
  let radius_16: number;
@@ -131,6 +162,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
131
162
  export { cross_section_scattering_16 as cross_section_scattering };
132
163
  let cross_section_extinction_16: number[];
133
164
  export { cross_section_extinction_16 as cross_section_extinction };
165
+ let g_16: number;
166
+ export { g_16 as g };
134
167
  }
135
168
  namespace COARSE_DUST_LARGE {
136
169
  let radius_17: number;
@@ -139,6 +172,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
139
172
  export { cross_section_scattering_17 as cross_section_scattering };
140
173
  let cross_section_extinction_17: number[];
141
174
  export { cross_section_extinction_17 as cross_section_extinction };
175
+ let g_17: number;
176
+ export { g_17 as g };
142
177
  }
143
178
  namespace POLLEN_PARTICLE_MEDIUM {
144
179
  let radius_18: number;
@@ -147,6 +182,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
147
182
  export { cross_section_scattering_18 as cross_section_scattering };
148
183
  let cross_section_extinction_18: number[];
149
184
  export { cross_section_extinction_18 as cross_section_extinction };
185
+ let g_18: number;
186
+ export { g_18 as g };
150
187
  }
151
188
  namespace POLLEN_PARTICLE_LARGE {
152
189
  let radius_19: number;
@@ -155,6 +192,8 @@ export namespace MIE_PARTICLES_STANDARD_PRECOMPUTED {
155
192
  export { cross_section_scattering_19 as cross_section_scattering };
156
193
  let cross_section_extinction_19: number[];
157
194
  export { cross_section_extinction_19 as cross_section_extinction };
195
+ let g_19: number;
196
+ export { g_19 as g };
158
197
  }
159
198
  }
160
199
  //# sourceMappingURL=MIE_PARTICLES_STANDARD_PRECOMPUTED.d.ts.map