@woosh/meep-engine 2.131.21 → 2.131.23
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/package.json +1 -1
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +1 -2
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +6 -14
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.js +10 -16
- package/src/engine/animation/EntityAnimation.d.ts +65 -0
- package/src/engine/animation/EntityAnimation.d.ts.map +1 -0
- package/src/engine/animation/EntityAnimation.js +112 -101
- package/src/engine/ecs/gui/GUIElementSystem.js +1 -1
- package/src/engine/ecs/gui/menu/radial/updateAnimationState.d.ts +2 -1
- package/src/engine/ecs/gui/menu/radial/updateAnimationState.d.ts.map +1 -1
- package/src/engine/ecs/gui/menu/radial/updateAnimationState.js +2 -1
- package/src/engine/ecs/gui/position/ViewportPositionSystem.js +1 -1
- package/src/engine/ecs/speaker/VoiceSystem.d.ts +1 -0
- package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
- package/src/engine/ecs/speaker/VoiceSystem.js +6 -1
- package/src/engine/ecs/systems/AnimationSystem.d.ts.map +1 -1
- package/src/engine/ecs/systems/AnimationSystem.js +1 -0
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.
|
|
8
|
+
"version": "2.131.23",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/AABB2.js"],"names":[],"mappings":";AAaA;;;GAGG;AACH;IACI
|
|
1
|
+
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/AABB2.js"],"names":[],"mappings":"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"}
|
|
@@ -21,7 +21,6 @@ class AABB2 {
|
|
|
21
21
|
* @param {number} [y0=0]
|
|
22
22
|
* @param {number} [x1=0]
|
|
23
23
|
* @param {number} [y1=0]
|
|
24
|
-
* @constructor
|
|
25
24
|
*/
|
|
26
25
|
constructor(
|
|
27
26
|
x0 = 0,
|
|
@@ -673,7 +672,7 @@ class AABB2 {
|
|
|
673
672
|
}
|
|
674
673
|
|
|
675
674
|
/**
|
|
676
|
-
* returns {
|
|
675
|
+
* @returns {this}
|
|
677
676
|
*/
|
|
678
677
|
setNegativelyInfiniteBounds() {
|
|
679
678
|
return this.set(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);
|
|
@@ -3,26 +3,18 @@ export function cadd(a: any, b: any): Float64Array;
|
|
|
3
3
|
export function cmult(a: any, b: any): Float64Array;
|
|
4
4
|
export function cdiv(a: any, b: any): Float64Array;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* "Computing the Scattering Properties of Participating Media Using Lorenz-Mie Theory"
|
|
9
|
-
*
|
|
10
|
-
* By authors: Jeppe Revall Frisvad
|
|
11
|
-
* Niels Joergen Christensen
|
|
12
|
-
* Henrik Wann Jensen
|
|
13
|
-
*
|
|
14
|
-
* Code written by Jeppe Revall Frisvad, 2017.
|
|
15
|
-
* Copyright (c) Jeppe Revall Frisvad 2017
|
|
16
|
-
*
|
|
17
|
-
* Permission is granted to anyone to use this code as
|
|
18
|
-
* software for any purpose, including commercial applications.
|
|
19
|
-
* However, the software is provided 'as-is' without any warranty.
|
|
6
|
+
* Implementation of Lorenz-Mie theory.
|
|
7
|
+
* Useful for calculating physically correct radiation scattering events for particles in a medium.
|
|
20
8
|
*
|
|
21
9
|
* @param {number} radius_m - Particle radius (in meters).
|
|
22
10
|
* @param {number} wavelength_m - Wavelength of light in vacuum (in meters).
|
|
23
11
|
* @param {vec2} n_p - Complex refractive index of the particle
|
|
24
12
|
* @param {vec2} n_med - Complex refractive index of the medium (e.g., [1.0, 0.0] for air).
|
|
25
13
|
* @returns {Float64Array} Mie coefficients a_n and b_n in form [a_n0.r, a_n0.i, b_n0.r, b_n0.i, ... a_nN.r, a_nN.i, b_nN.r, b_nN.i]
|
|
14
|
+
*
|
|
15
|
+
* @see "Computing the Scattering Properties of Participating Media Using Lorenz-Mie Theory", SIGGRAPH 2007 by Frisvad et al.
|
|
16
|
+
* @see https://en.wikipedia.org/wiki/Mie_scattering
|
|
17
|
+
* @author Alexander Goldring (c) 2025
|
|
26
18
|
*/
|
|
27
19
|
export function lorenz_mie_coefs(wavelength_m: number, radius_m: number, n_p: typeof vec2, n_med: typeof vec2): Float64Array;
|
|
28
20
|
//# sourceMappingURL=lorenz_mie_coefs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lorenz_mie_coefs.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/mie/lorenz_mie_coefs.js"],"names":[],"mappings":"AAOA,mDAEC;AAMD,mDAMC;AAWD,oDAOC;AAED,mDAOC;
|
|
1
|
+
{"version":3,"file":"lorenz_mie_coefs.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/mie/lorenz_mie_coefs.js"],"names":[],"mappings":"AAOA,mDAEC;AAMD,mDAMC;AAWD,oDAOC;AAED,mDAOC;AAgHD;;;;;;;;;;;;;GAaG;AACH,+CATW,MAAM,YADN,MAAM,yCAIJ,YAAY,CAyDxB"}
|
|
@@ -85,6 +85,7 @@ function psi_zeta(n, z, A, old_B, old_psi_zeta) {
|
|
|
85
85
|
* @param {vec2} old_B - The previous B coefficient (B_{n-1}).
|
|
86
86
|
* @param {vec2} old_psi_zeta - The previous psi_zeta product term.
|
|
87
87
|
* @returns {vec2} The new B_n coefficient (complex number).
|
|
88
|
+
* @ignore
|
|
88
89
|
*/
|
|
89
90
|
function B(n, z, A, old_B, old_psi_zeta) {
|
|
90
91
|
|
|
@@ -106,6 +107,7 @@ function B(n, z, A, old_B, old_psi_zeta) {
|
|
|
106
107
|
* @param {vec2} B_n - The current B_n(z) coefficient.
|
|
107
108
|
* @param {vec2} old_R - The previous R coefficient (R_{n-1}).
|
|
108
109
|
* @returns {vec2} The new R_n coefficient (complex number).
|
|
110
|
+
* @ignore
|
|
109
111
|
*/
|
|
110
112
|
function R(n, z, A, B_n, old_R) {
|
|
111
113
|
if (n > 0) {
|
|
@@ -129,8 +131,8 @@ function R(n, z, A, B_n, old_R) {
|
|
|
129
131
|
* @param {vec2} old_B - The previous B_{n-1}(x) coefficient.
|
|
130
132
|
* @param {vec2} old_R - The previous R_{n-1}(x) coefficient.
|
|
131
133
|
* @param {vec2} old_psi_zeta - The previous psi_zeta product.
|
|
132
|
-
* @returns {vec4} A vec4 [Re(a_n), Im(a_n), Re(b_n), Im(b_n)] with state properties
|
|
133
|
-
*
|
|
134
|
+
* @returns {vec4} A vec4 [Re(a_n), Im(a_n), Re(b_n), Im(b_n)] with state properties (.old_B, .old_R, .old_psi_zeta) attached for the next iteration.
|
|
135
|
+
* @ignore
|
|
134
136
|
*/
|
|
135
137
|
function LorenzMie_ab(n, size, n_p, n_med, A_p, A_med, old_B, old_R, old_psi_zeta) {
|
|
136
138
|
|
|
@@ -157,26 +159,18 @@ function LorenzMie_ab(n, size, n_p, n_med, A_p, A_med, old_B, old_R, old_psi_zet
|
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* "Computing the Scattering Properties of Participating Media Using Lorenz-Mie Theory"
|
|
163
|
-
*
|
|
164
|
-
* By authors: Jeppe Revall Frisvad
|
|
165
|
-
* Niels Joergen Christensen
|
|
166
|
-
* Henrik Wann Jensen
|
|
167
|
-
*
|
|
168
|
-
* Code written by Jeppe Revall Frisvad, 2017.
|
|
169
|
-
* Copyright (c) Jeppe Revall Frisvad 2017
|
|
170
|
-
*
|
|
171
|
-
* Permission is granted to anyone to use this code as
|
|
172
|
-
* software for any purpose, including commercial applications.
|
|
173
|
-
* However, the software is provided 'as-is' without any warranty.
|
|
162
|
+
* Implementation of Lorenz-Mie theory.
|
|
163
|
+
* Useful for calculating physically correct radiation scattering events for particles in a medium.
|
|
174
164
|
*
|
|
175
165
|
* @param {number} radius_m - Particle radius (in meters).
|
|
176
166
|
* @param {number} wavelength_m - Wavelength of light in vacuum (in meters).
|
|
177
167
|
* @param {vec2} n_p - Complex refractive index of the particle
|
|
178
168
|
* @param {vec2} n_med - Complex refractive index of the medium (e.g., [1.0, 0.0] for air).
|
|
179
169
|
* @returns {Float64Array} Mie coefficients a_n and b_n in form [a_n0.r, a_n0.i, b_n0.r, b_n0.i, ... a_nN.r, a_nN.i, b_nN.r, b_nN.i]
|
|
170
|
+
*
|
|
171
|
+
* @see "Computing the Scattering Properties of Participating Media Using Lorenz-Mie Theory", SIGGRAPH 2007 by Frisvad et al.
|
|
172
|
+
* @see https://en.wikipedia.org/wiki/Mie_scattering
|
|
173
|
+
* @author Alexander Goldring (c) 2025
|
|
180
174
|
*/
|
|
181
175
|
export function lorenz_mie_coefs(
|
|
182
176
|
wavelength_m,
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export default EntityAnimation;
|
|
2
|
+
declare class EntityAnimation {
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {number} entity
|
|
6
|
+
*/
|
|
7
|
+
constructor(entity: number);
|
|
8
|
+
/**
|
|
9
|
+
* @type {Array.<AnimationSpec>} animationSpecs
|
|
10
|
+
*/
|
|
11
|
+
animationSpecs: Array<AnimationSpec>;
|
|
12
|
+
ended: ObservedValue;
|
|
13
|
+
entity: number;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @returns {Promise<any>}
|
|
17
|
+
*/
|
|
18
|
+
promiseEnd(): Promise<any>;
|
|
19
|
+
__create(type: any, parameter: any, duration: any, transitionFunction: any): this;
|
|
20
|
+
translate(parameter: any, duration: any, timingFunction: any): this;
|
|
21
|
+
fade(parameter: any, duration: any, timingFunction: any): this;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {function(animation:EntityAnimation):void} callback
|
|
25
|
+
* @returns {EntityAnimation}
|
|
26
|
+
*/
|
|
27
|
+
onEnded(callback: any): EntityAnimation;
|
|
28
|
+
start(em: any): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
declare class AnimationSpec {
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param {AnimationSpec.Type} type
|
|
37
|
+
* @param {number} parameter
|
|
38
|
+
* @param {number} duration in seconds
|
|
39
|
+
* @param {function(x:number):number} transitionFunction
|
|
40
|
+
*/
|
|
41
|
+
constructor(type: {
|
|
42
|
+
TRANSLATE: number;
|
|
43
|
+
FADE: number;
|
|
44
|
+
}, parameter: number, duration: number, transitionFunction: any);
|
|
45
|
+
parameter: number;
|
|
46
|
+
duration: number;
|
|
47
|
+
transitionFunction: any;
|
|
48
|
+
type: {
|
|
49
|
+
TRANSLATE: number;
|
|
50
|
+
FADE: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {Tween|null}
|
|
55
|
+
*/
|
|
56
|
+
tween: Tween | null;
|
|
57
|
+
}
|
|
58
|
+
declare namespace AnimationSpec {
|
|
59
|
+
namespace Type {
|
|
60
|
+
let TRANSLATE: number;
|
|
61
|
+
let FADE: number;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
import ObservedValue from '../../core/model/ObservedValue.js';
|
|
65
|
+
//# sourceMappingURL=EntityAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityAnimation.d.ts","sourceRoot":"","sources":["../../../../src/engine/animation/EntityAnimation.js"],"names":[],"mappings":";AAiCA;IAQI;;;OAGG;IACH,oBAFW,MAAM,EAIhB;IAbD;;OAEG;IACH,gBAFU,MAAO,aAAa,CAAC,CAEX;IAEpB,qBAAiC;IAO7B,eAAoB;IAGxB;;;OAGG;IACH,cAFa,QAAQ,GAAG,CAAC,CAUxB;IAED,kFAGC;IAED,oEAEC;IAED,+DAEC;IAED;;;;OAIG;IACH,wBAFa,eAAe,CAW3B;IAED,qBA4CC;CACJ;AAtID;;GAEG;AACH;IACI;;;;;;OAMG;IACH;;;kBAJW,MAAM,YACN,MAAM,2BAchB;IAVG,kBAA0B;IAC1B,iBAAwB;IACxB,wBAA4C;IAC5C;;;MAAgB;IAEhB;;;OAGG;IACH,OAFU,QAAM,IAAI,CAEH;CAExB;;;;;;;0BA1ByB,mCAAmC"}
|
|
@@ -2,130 +2,141 @@ import ObservedValue from '../../core/model/ObservedValue.js';
|
|
|
2
2
|
import Animations from './Animations.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param {AnimationSpec.Type} type
|
|
7
|
-
* @param {number} parameter
|
|
8
|
-
* @param {number} duration in seconds
|
|
9
|
-
* @param {function(x:number):number} transitionFunction
|
|
10
|
-
* @constructor
|
|
11
|
-
* @see {Tween} for more information on transition function
|
|
5
|
+
* @ignore
|
|
12
6
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
class AnimationSpec {
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {AnimationSpec.Type} type
|
|
11
|
+
* @param {number} parameter
|
|
12
|
+
* @param {number} duration in seconds
|
|
13
|
+
* @param {function(x:number):number} transitionFunction
|
|
14
|
+
*/
|
|
15
|
+
constructor(type, parameter, duration, transitionFunction) {
|
|
16
|
+
this.parameter = parameter;
|
|
17
|
+
this.duration = duration;
|
|
18
|
+
this.transitionFunction = transitionFunction;
|
|
19
|
+
this.type = type;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {Tween|null}
|
|
24
|
+
*/
|
|
25
|
+
this.tween = null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
21
28
|
|
|
22
29
|
AnimationSpec.Type = {
|
|
23
30
|
TRANSLATE: 0,
|
|
24
31
|
FADE: 1
|
|
25
32
|
};
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
const EntityAnimation = function (entity) {
|
|
34
|
-
this.entity = entity;
|
|
35
|
-
this.animationSpecs = [];
|
|
36
|
-
|
|
37
|
-
this.ended = new ObservedValue(false);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @returns {Promise<any>}
|
|
43
|
-
*/
|
|
44
|
-
EntityAnimation.prototype.promiseEnd = function () {
|
|
45
|
-
return new Promise((resolve, reject) => {
|
|
46
|
-
if (this.ended.getValue()) {
|
|
47
|
-
resolve();
|
|
48
|
-
} else {
|
|
49
|
-
this.ended.onChanged.addOne(resolve);
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
};
|
|
34
|
+
class EntityAnimation {
|
|
35
|
+
/**
|
|
36
|
+
* @type {Array.<AnimationSpec>} animationSpecs
|
|
37
|
+
*/
|
|
38
|
+
animationSpecs = [];
|
|
53
39
|
|
|
54
|
-
|
|
55
|
-
this.animationSpecs.push(new AnimationSpec(type, parameter, duration, transitionFunction));
|
|
56
|
-
return this;
|
|
57
|
-
};
|
|
40
|
+
ended = new ObservedValue(false);
|
|
58
41
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param {number} entity
|
|
45
|
+
*/
|
|
46
|
+
constructor(entity) {
|
|
47
|
+
this.entity = entity;
|
|
48
|
+
}
|
|
62
49
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @returns {Promise<any>}
|
|
53
|
+
*/
|
|
54
|
+
promiseEnd() {
|
|
55
|
+
return new Promise((resolve, reject) => {
|
|
56
|
+
if (this.ended.getValue()) {
|
|
57
|
+
resolve();
|
|
58
|
+
} else {
|
|
59
|
+
this.ended.onChanged.addOne(resolve);
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
}
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*/
|
|
72
|
-
EntityAnimation.prototype.onEnded = function (callback) {
|
|
73
|
-
const self = this;
|
|
74
|
-
this.ended.onChanged.add(function (v) {
|
|
75
|
-
if (v) {
|
|
76
|
-
callback(self);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
64
|
+
__create(type, parameter, duration, transitionFunction) {
|
|
65
|
+
this.animationSpecs.push(new AnimationSpec(type, parameter, duration, transitionFunction));
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
79
68
|
|
|
80
|
-
|
|
81
|
-
|
|
69
|
+
translate(parameter, duration, timingFunction) {
|
|
70
|
+
return this.__create(AnimationSpec.Type.TRANSLATE, parameter, duration, timingFunction);
|
|
71
|
+
}
|
|
82
72
|
|
|
73
|
+
fade(parameter, duration, timingFunction) {
|
|
74
|
+
return this.__create(AnimationSpec.Type.FADE, parameter, duration, timingFunction);
|
|
75
|
+
}
|
|
83
76
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @param {function(animation:EntityAnimation):void} callback
|
|
80
|
+
* @returns {EntityAnimation}
|
|
81
|
+
*/
|
|
82
|
+
onEnded(callback) {
|
|
83
|
+
const self = this;
|
|
84
|
+
this.ended.onChanged.add(function (v) {
|
|
85
|
+
if (v) {
|
|
86
|
+
callback(self);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
87
92
|
|
|
88
|
-
|
|
93
|
+
start(em) {
|
|
94
|
+
const entity = this.entity;
|
|
95
|
+
const self = this;
|
|
89
96
|
|
|
90
|
-
|
|
91
|
-
spec.tween = Animations.translate(entity, em, spec.parameter, spec.duration, spec.transitionFunction);
|
|
92
|
-
}
|
|
97
|
+
this.ended.set(false);
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
function buildTranslation(spec, em) {
|
|
100
|
+
spec.tween = Animations.translate(entity, em, spec.parameter, spec.duration, spec.transitionFunction);
|
|
101
|
+
}
|
|
97
102
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
case AnimationSpec.Type.TRANSLATE:
|
|
101
|
-
buildTranslation(spec, em);
|
|
102
|
-
break;
|
|
103
|
-
case AnimationSpec.Type.FADE:
|
|
104
|
-
buildFade(spec, em);
|
|
105
|
-
break;
|
|
106
|
-
default:
|
|
107
|
-
console.error('Unknown animation type:', spec.type);
|
|
103
|
+
function buildFade(spec, em) {
|
|
104
|
+
spec.tween = Animations.fade(entity, em, spec.parameter, spec.duration, spec.transitionFunction);
|
|
108
105
|
}
|
|
109
|
-
});
|
|
110
|
-
let runningTweenCount = 0;
|
|
111
106
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
this.animationSpecs.forEach(function (spec) {
|
|
108
|
+
switch (spec.type) {
|
|
109
|
+
case AnimationSpec.Type.TRANSLATE:
|
|
110
|
+
buildTranslation(spec, em);
|
|
111
|
+
break;
|
|
112
|
+
case AnimationSpec.Type.FADE:
|
|
113
|
+
buildFade(spec, em);
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
console.error('Unknown animation type:', spec.type);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
let runningTweenCount = 0;
|
|
120
|
+
|
|
121
|
+
function handleTweenEnded() {
|
|
122
|
+
runningTweenCount--;
|
|
123
|
+
if (runningTweenCount <= 0) {
|
|
124
|
+
self.ended.set(true);
|
|
125
|
+
}
|
|
116
126
|
}
|
|
127
|
+
|
|
128
|
+
//start all tweens
|
|
129
|
+
this.animationSpecs.forEach(function (spec) {
|
|
130
|
+
const tween = spec.tween;
|
|
131
|
+
if (tween !== null) {
|
|
132
|
+
runningTweenCount++;
|
|
133
|
+
tween.on.ended.add(handleTweenEnded);
|
|
134
|
+
tween.build(em);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
117
137
|
}
|
|
138
|
+
}
|
|
118
139
|
|
|
119
|
-
//start all tweens
|
|
120
|
-
this.animationSpecs.forEach(function (spec) {
|
|
121
|
-
const tween = spec.tween;
|
|
122
|
-
if (tween !== null) {
|
|
123
|
-
runningTweenCount++;
|
|
124
|
-
tween.on.ended.add(handleTweenEnded);
|
|
125
|
-
tween.build(em);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
140
|
|
|
130
141
|
export default EntityAnimation;
|
|
131
142
|
|
|
@@ -5,7 +5,7 @@ import GUIElement, { GUIElementFlag } from './GUIElement.js';
|
|
|
5
5
|
import { GUIElementEvent } from "./GUIElementEvent.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @this {
|
|
8
|
+
* @this {el:GUIElement, system:GUIElementSystem, entity: number}
|
|
9
9
|
* @param {boolean} v
|
|
10
10
|
* @ignore
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateAnimationState.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/gui/menu/radial/updateAnimationState.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"updateAnimationState.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/gui/menu/radial/updateAnimationState.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wDAJW,MAAM,SACN,MAAM,QAWhB"}
|
|
@@ -12,7 +12,7 @@ import ViewportPosition from './ViewportPosition.js';
|
|
|
12
12
|
const CSS_CLASS = 'ecs-viewport-position-component';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @this {
|
|
15
|
+
* @this {system:ViewportPositionSystem, vp: ViewportPosition, el: GUIElement}
|
|
16
16
|
* @ignore
|
|
17
17
|
*/
|
|
18
18
|
function updatePosition() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/speaker/VoiceSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VoiceSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/speaker/VoiceSystem.js"],"names":[],"mappings":"AA+JA;IACI;;;;OAIG;IACH;;;OA2FC;IArFG,+BAA2B;IAE3B,qYAQC;IAGD;;;OAGG;IACH,0BAAuB;IAEvB;;;OAGG;IACH,eAAe;IAEf;;;OAGG;IACH,4BAAiB;IAEjB;;;OAGG;IACH,8BAAgB;IAEhB;;;OAGG;IACH,eAAoB;IAEpB;;;;OAIG;IACH,iCAAyC;IAEzC;;;;OAIG;IACH,kBAAkC;IAIlC;;;;OAIG;IACH,eAAkB;IAElB;;;;OAIG;IACH,oBAAgC;IAEhC;;;OAGG;IACH,oBAAqC;IAErC;;;;OAIG;IACH,gBAAoB;IAGxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAEF,2CAqBE;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,MAAM,SACN,KAAK,QAsBf;IAED;;;;;;OAMG;IACH,wBAoBC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,WACN,MAAM,SACN,KAAK,QAuHf;CACJ;sCA3bqC,oCAAoC;sBAIpD,YAAY;uBAPX,sBAAsB;4CAnBD,oDAAoD;0BAwBtE,2BAA2B;6BAHxB,qCAAqC;2BADvC,8BAA8B;2BAL9B,6BAA6B;sCAClB,wCAAwC;kCAR5C,sDAAsD"}
|
|
@@ -36,18 +36,21 @@ import { VoiceFlags } from "./VoiceFlags.js";
|
|
|
36
36
|
/**
|
|
37
37
|
* Delay before the user notices the text and begins to read
|
|
38
38
|
* @type {number}
|
|
39
|
+
* @ignore
|
|
39
40
|
*/
|
|
40
41
|
const TIMING_NOTICE_DELAY = 0.5;
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Minimum time to read something
|
|
44
45
|
* @type {number}
|
|
46
|
+
* @ignore
|
|
45
47
|
*/
|
|
46
48
|
const TIMING_MINIMUM_READ_TIME = 1.2;
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
*
|
|
50
52
|
* @type {LineDescription[]}
|
|
53
|
+
* @ignore
|
|
51
54
|
*/
|
|
52
55
|
const temp_lines = [];
|
|
53
56
|
|
|
@@ -144,8 +147,9 @@ SPEECH_BUBBLE_ANIMATION_OUTRO.addKey(0.2, [0]);
|
|
|
144
147
|
SPEECH_BUBBLE_ANIMATION_OUTRO.addTransition(0, TransitionFunctions.CubicEaseIn);
|
|
145
148
|
|
|
146
149
|
/**
|
|
147
|
-
* @this
|
|
150
|
+
* @this View
|
|
148
151
|
* @param {number} alpha
|
|
152
|
+
* @ignore
|
|
149
153
|
*/
|
|
150
154
|
function bubble_animation_update_function(alpha) {
|
|
151
155
|
this.css({
|
|
@@ -315,6 +319,7 @@ export class VoiceSystem extends AbstractContextSystem {
|
|
|
315
319
|
*
|
|
316
320
|
* @param {string} text
|
|
317
321
|
* @param {View} view
|
|
322
|
+
* @ignore
|
|
318
323
|
* @private
|
|
319
324
|
*/
|
|
320
325
|
__setBubbleSize(text, view) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/systems/AnimationSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/systems/AnimationSystem.js"],"names":[],"mappings":"AAyJA;;;;GAIG;AACH,wCAHW,mBAAmB,aACnB,MAAM,QAehB;;sDAtKM,OAAO;AA6Kd;IACI;;;;OAIG;IACH,mCAMC;IAHG,iDAAqC;IAErC,sBAAgC;IAGpC;;;;;OAKG;IACH,gBAJW,SAAS,gCAkBnB;IAED;;;;;OAKG;IACH,kBAJW,SAAS,gCAanB;CAsJJ;uBAvWsB,cAAc;iBAPpB,iCAAiC;0BAIxB,2BAA2B"}
|