@woosh/meep-engine 2.120.2 → 2.120.4
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/README.md +1 -1
- package/editor/Editor.d.ts.map +1 -1
- package/editor/SelectionVisualizer.d.ts.map +1 -1
- package/editor/actions/concrete/ComponentAddAction.d.ts.map +1 -1
- package/editor/actions/concrete/EntityCreateAction.d.ts.map +1 -1
- package/editor/actions/concrete/SelectionAddAction.d.ts.map +1 -0
- package/editor/actions/concrete/SelectionClearAction.d.ts.map +1 -0
- package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -0
- package/editor/enableEditor.d.ts.map +1 -1
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.js +2 -1
- package/editor/view/ecs/EntityEditor.js +2 -1
- package/editor/view/makeEntityDecorators.js +5 -5
- package/package.json +1 -1
- package/src/core/binary/BitSet.d.ts +59 -38
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +76 -55
- package/src/core/function/noop.d.ts +4 -1
- package/src/core/function/noop.d.ts.map +1 -1
- package/src/core/function/noop.js +4 -1
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.d.ts +7 -3
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.js +2 -2
- package/src/core/geom/3d/ray/Ray3.d.ts +11 -0
- package/src/core/geom/3d/ray/Ray3.d.ts.map +1 -1
- package/src/core/geom/3d/ray/Ray3.js +25 -0
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +27 -5
- package/src/core/math/gaussian.d.ts +5 -4
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +5 -4
- package/src/core/math/matrix/SquareMatrix.d.ts +55 -32
- package/src/core/math/matrix/SquareMatrix.d.ts.map +1 -1
- package/src/core/math/matrix/SquareMatrix.js +59 -33
- package/src/core/math/spline/spline_hermite3_to_bezier.d.ts +6 -5
- package/src/core/math/spline/spline_hermite3_to_bezier.d.ts.map +1 -1
- package/src/core/math/spline/spline_hermite3_to_bezier.js +15 -11
- package/src/core/model/ModuleRegistry.d.ts.map +1 -1
- package/src/core/model/ModuleRegistry.js +2 -2
- package/src/core/model/stat/Stat.d.ts.map +1 -1
- package/src/core/model/stat/Stat.js +38 -19
- package/src/engine/Clock.d.ts +14 -3
- package/src/engine/Clock.d.ts.map +1 -1
- package/src/engine/Clock.js +14 -3
- package/src/engine/EngineConfiguration.js +1 -1
- package/src/engine/ecs/Entity.d.ts.map +1 -1
- package/src/engine/ecs/Entity.js +42 -2
- package/src/engine/ecs/EntityBuilderUtils.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.d.ts +1 -1
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +25 -4
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityManager.js +6 -12
- package/src/engine/ecs/EntityReference.d.ts +14 -0
- package/src/engine/ecs/EntityReference.d.ts.map +1 -1
- package/src/engine/ecs/EntityReference.js +18 -0
- package/src/engine/ecs/EventType.d.ts +10 -0
- package/src/engine/ecs/EventType.d.ts.map +1 -0
- package/src/engine/ecs/EventType.js +10 -0
- package/src/engine/ecs/System.d.ts.map +1 -1
- package/src/engine/ecs/System.js +1 -12
- package/src/engine/ecs/computeSystemName.d.ts +8 -0
- package/src/engine/ecs/computeSystemName.d.ts.map +1 -0
- package/src/engine/ecs/computeSystemName.js +10 -0
- package/src/engine/ecs/parent/ParentEntitySystem.js +1 -1
- package/src/engine/ecs/terrain/TerrainClouds.d.ts +43 -10
- package/src/engine/ecs/terrain/TerrainClouds.d.ts.map +1 -1
- package/src/engine/ecs/terrain/TerrainClouds.js +38 -2
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.js +6 -0
- package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.js +3 -1
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.js +7 -7
- package/src/engine/input/devices/InputDeviceSwitch.d.ts +4 -0
- package/src/engine/input/devices/InputDeviceSwitch.d.ts.map +1 -1
- package/src/engine/input/devices/InputDeviceSwitch.js +4 -2
- package/src/engine/input/devices/KeyCodes.d.ts.map +1 -1
- package/src/engine/input/devices/KeyCodes.js +1 -0
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +28 -3
- package/src/engine/knowledge/database/StaticKnowledgeDataTable.d.ts.map +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDataTable.js +3 -0
- package/src/engine/ui/notification/NotificationManager.d.ts.map +1 -1
- package/src/engine/ui/notification/NotificationManager.js +2 -1
- package/editor/actions/concrete/ActionUpdateTexture.d.ts +0 -12
- package/editor/actions/concrete/ActionUpdateTexture.d.ts.map +0 -1
- package/editor/actions/concrete/ArrayCopyAction.d.ts +0 -20
- package/editor/actions/concrete/ArrayCopyAction.d.ts.map +0 -1
- package/editor/actions/concrete/ComponentRemoveAction.d.ts +0 -11
- package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +0 -1
- package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts.map +0 -1
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +0 -38
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +0 -23
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +0 -19
- package/editor/actions/concrete/SelectionRemoveAction.d.ts +0 -10
- package/editor/actions/concrete/WriteGridValueAction.d.ts +0 -15
- package/src/engine/ecs/transform/Transform.editor.schema.json +0 -16
|
@@ -7,44 +7,60 @@ import { epsilonEquals } from "../../math/epsilonEquals.js";
|
|
|
7
7
|
import { max2 } from "../../math/max2.js";
|
|
8
8
|
import LinearModifier from "./LinearModifier.js";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Modifiable statistic.
|
|
12
|
+
* Allows non-destructive linear arithmetic.
|
|
13
|
+
* Useful when we wish to be able to reverse part or the whole of the computation
|
|
14
|
+
*
|
|
15
|
+
* Main purpose of the class is to facilitate implementation of RPG-like stats, such as maximum health, or armor.
|
|
16
|
+
* These stats can then be modified by various skills, equipment and effects. Each such modification will be added as a separate {@link LinearModifier} and can be reversed by removing the modifier.
|
|
17
|
+
*/
|
|
10
18
|
class Stat extends Number {
|
|
11
19
|
/**
|
|
12
|
-
*
|
|
20
|
+
* Unique identifier of a stat, such a health, armor etc.
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
id = 0;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List of modifiers.
|
|
27
|
+
* Order has no influence on final computed value
|
|
28
|
+
* @private
|
|
29
|
+
* @readonly
|
|
30
|
+
* @type {List<LinearModifier>}
|
|
31
|
+
*/
|
|
32
|
+
__modifiers = new List();
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {function(number): number}
|
|
37
|
+
*/
|
|
38
|
+
postprocess = Stat.Process.NONE;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {number} [value]
|
|
13
42
|
* @constructor
|
|
14
43
|
*/
|
|
15
|
-
constructor(value) {
|
|
44
|
+
constructor(value=0) {
|
|
16
45
|
super();
|
|
17
46
|
|
|
18
47
|
assert.isNumber(value, "value");
|
|
19
48
|
|
|
20
|
-
/**
|
|
21
|
-
* Unique identifier of a stat, such a health, armor etc.
|
|
22
|
-
* @type {number}
|
|
23
|
-
*/
|
|
24
|
-
this.id = 0;
|
|
25
49
|
|
|
26
50
|
/**
|
|
27
|
-
*
|
|
51
|
+
* Base value that will be affected by modifiers
|
|
28
52
|
* @type {Vector1}
|
|
29
53
|
*/
|
|
30
54
|
this.base = new Vector1(value);
|
|
31
55
|
|
|
32
56
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
35
|
-
* @type {List<LinearModifier>}
|
|
57
|
+
* Final computed value. Do not modify this directly
|
|
58
|
+
* @type {Vector1}
|
|
36
59
|
*/
|
|
37
|
-
this.__modifiers = new List();
|
|
38
|
-
|
|
39
60
|
this.value = new Vector1(value);
|
|
40
61
|
|
|
41
62
|
this.base.onChanged.add(this.updateValue, this);
|
|
42
63
|
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @type {function(number): number}
|
|
46
|
-
*/
|
|
47
|
-
this.postprocess = Stat.Process.NONE;
|
|
48
64
|
}
|
|
49
65
|
|
|
50
66
|
/**
|
|
@@ -287,7 +303,7 @@ Stat.Process = {
|
|
|
287
303
|
return v;
|
|
288
304
|
},
|
|
289
305
|
/**
|
|
290
|
-
* Clamp lowest value forcing the result to always be >= value
|
|
306
|
+
* Clamp the lowest value forcing the result to always be >= value
|
|
291
307
|
* @param {number} value
|
|
292
308
|
* @returns {function(number): number}
|
|
293
309
|
*/
|
|
@@ -296,6 +312,9 @@ Stat.Process = {
|
|
|
296
312
|
return max2(value, v);
|
|
297
313
|
}
|
|
298
314
|
},
|
|
315
|
+
/**
|
|
316
|
+
* Allows us to chain multiple effects
|
|
317
|
+
*/
|
|
299
318
|
chain: chain
|
|
300
319
|
};
|
|
301
320
|
|
package/src/engine/Clock.d.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
export default Clock;
|
|
2
|
+
/**
|
|
3
|
+
* Construct for keeping track of time
|
|
4
|
+
*/
|
|
2
5
|
declare class Clock {
|
|
3
6
|
/**
|
|
4
|
-
*
|
|
7
|
+
* In seconds
|
|
5
8
|
* @type {number}
|
|
6
9
|
* @private
|
|
7
10
|
*/
|
|
8
11
|
private __lastMeasurement;
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* In seconds
|
|
11
14
|
* @type {number}
|
|
12
15
|
*/
|
|
13
16
|
elapsedTime: number;
|
|
17
|
+
/**
|
|
18
|
+
* Timestamp when {@link getDelta} was last called
|
|
19
|
+
* In seconds
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
14
22
|
timeAtDelta: number;
|
|
15
23
|
/**
|
|
16
24
|
*
|
|
@@ -20,6 +28,8 @@ declare class Clock {
|
|
|
20
28
|
private __isRunning;
|
|
21
29
|
/**
|
|
22
30
|
* how fast clock ticks in relation to real time
|
|
31
|
+
* Allows us to slow down or speed up flow of time via modifiers, see {@link Stat} for details
|
|
32
|
+
* Default speed is x1, i.e. - unmodified
|
|
23
33
|
* @type {Stat}
|
|
24
34
|
*/
|
|
25
35
|
speed: Stat;
|
|
@@ -47,7 +57,8 @@ declare class Clock {
|
|
|
47
57
|
*/
|
|
48
58
|
updateElapsedTime(): number;
|
|
49
59
|
/**
|
|
50
|
-
*
|
|
60
|
+
* Time elapsed so far, since the clock was started
|
|
61
|
+
* Only counts time while running
|
|
51
62
|
* @return {number}
|
|
52
63
|
*/
|
|
53
64
|
getElapsedTime(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/engine/Clock.js"],"names":[],"mappings":";AAcA;IAEI;;;;OAIG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB,
|
|
1
|
+
{"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/engine/Clock.js"],"names":[],"mappings":";AAcA;;GAEG;AACH;IAEI;;;;OAIG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,oBAAoB;IAGpB;;;;;OAKG;IACH,OAFU,IAAI,CAEM;IAMpB;;;OAGG;IACH,kBAFW,MAAM,EAIhB;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IAED,cAIC;IAED,aAEC;IAED,cAIC;IAED;;;OAGG;IACH,YAFa,MAAM,CAOlB;IAED;;;OAGG;IACH,qBAFa,MAAM,CAOlB;IAED;;;;OAIG;IACH,kBAFY,MAAM,CAIjB;IAED,cAGC;CACJ;iBA9HgB,4BAA4B"}
|
package/src/engine/Clock.js
CHANGED
|
@@ -12,21 +12,29 @@ function updateElapsedTime(clock) {
|
|
|
12
12
|
clock.elapsedTime += delta;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Construct for keeping track of time
|
|
17
|
+
*/
|
|
15
18
|
class Clock {
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
21
|
+
* In seconds
|
|
19
22
|
* @type {number}
|
|
20
23
|
* @private
|
|
21
24
|
*/
|
|
22
25
|
__lastMeasurement = 0;
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
28
|
+
* In seconds
|
|
26
29
|
* @type {number}
|
|
27
30
|
*/
|
|
28
31
|
elapsedTime = 0;
|
|
29
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Timestamp when {@link getDelta} was last called
|
|
35
|
+
* In seconds
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
30
38
|
timeAtDelta = 0;
|
|
31
39
|
|
|
32
40
|
/**
|
|
@@ -39,6 +47,8 @@ class Clock {
|
|
|
39
47
|
|
|
40
48
|
/**
|
|
41
49
|
* how fast clock ticks in relation to real time
|
|
50
|
+
* Allows us to slow down or speed up flow of time via modifiers, see {@link Stat} for details
|
|
51
|
+
* Default speed is x1, i.e. - unmodified
|
|
42
52
|
* @type {Stat}
|
|
43
53
|
*/
|
|
44
54
|
speed = new Stat(1);
|
|
@@ -102,7 +112,8 @@ class Clock {
|
|
|
102
112
|
}
|
|
103
113
|
|
|
104
114
|
/**
|
|
105
|
-
*
|
|
115
|
+
* Time elapsed so far, since the clock was started
|
|
116
|
+
* Only counts time while running
|
|
106
117
|
* @return {number}
|
|
107
118
|
*/
|
|
108
119
|
getElapsedTime() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAgBA
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH;IAgaI;;;;;OAKG;IACH,+BAJW,MAAM,WACN,sBAAsB,GACpB,MAAM,CAgBlB;IAlbD;;;OAGG;IACH,oBAFU,eAAe,CAES;IAWlC;;;OAGG;IACH,UAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,UAFa,MAAM,CAIlB;IAmBD;;;OAGG;IACH,kBAFW,MAAM,EAIhB;IAfD;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IAWD;;;;OAIG;IACH,2BAAgB;IAQhB;;;OAGG;IACH,SAFU,sBAAsB,CAEjB;IAEf;;;OAGG;IACH,OAFU,WAAW,GAAC,MAAM,CAEN;IAEtB;;;OAGG;IACH,gBAAgB;IAEhB;;OAEG;IACH;;MAEE;IAUF;;;OAGG;IACH,eAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,WAAW,GAChB,OAAO,CAMnB;IAED;;;OAGG;IACH,gBAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;OAEG;IACH,4BAQC;IAED;;;OAGG;IACH,aAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,IAJa,CAAC,qBACH,CAAC,GACC,MAAM,CAiBlB;IAED;;;;OAIG;IACH,aAJa,CAAC,SACH,CAAC,GACC,OAAO,CAInB;IAED;;;;OAIG;IACH,aAJa,CAAC,SACH,KAAK,CAAC,CAAC,CAAC,GACN,CAAC,GAAC,IAAI,CAclB;IAED;;;;;OAKG;IACH,iBAJa,CAAC,SACH,KAAK,CAAC,CAAC,CAAC,GACN,CAAC,CAUb;IAED;;;;OAIG;IACH,kCAFa,GAAC,GAAC,IAAI,CA0BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,UACN,GAAC,QAQX;IAED;;;OAGG;IACH,wBAFW,MAAM,gBAiBhB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,gCAEN,GAAC,GACC,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BALW,MAAM,gCAEN,GAAC,GACC,MAAM,CAyBlB;IAED;;;OAGG;IACH,WAFa,OAAO,CAwBnB;IAED;;;;OAIG;IACH,eAFW,sBAAsB,GADpB,MAAM,CAyDlB;IAyBL;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;gCA7e+B,sBAAsB;4BAD1B,kBAAkB;mBAF3B,oCAAoC"}
|
package/src/engine/ecs/Entity.js
CHANGED
|
@@ -2,8 +2,8 @@ import { assert } from "../../core/assert.js";
|
|
|
2
2
|
import Signal from "../../core/events/signal/Signal.js";
|
|
3
3
|
import { isDefined } from "../../core/process/matcher/isDefined.js";
|
|
4
4
|
import { EntityFlags } from "./EntityFlags.js";
|
|
5
|
-
import { EventType } from "./EntityManager.js";
|
|
6
5
|
import { EntityReference } from "./EntityReference.js";
|
|
6
|
+
import { EventType } from "./EventType.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Set of default flags
|
|
@@ -16,7 +16,47 @@ const DEFAULT_FLAGS =
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Representation of an entity, helps build entities and keep track of them without having to access {@link EntityComponentDataset} directly
|
|
19
|
-
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Create a new entity (initially has no components).
|
|
23
|
+
* const entity = new Entity();
|
|
24
|
+
*
|
|
25
|
+
* // Define some components (simple data containers).
|
|
26
|
+
* class PositionComponent {
|
|
27
|
+
* constructor(x, y) {
|
|
28
|
+
* this.x = x;
|
|
29
|
+
* this.y = y;
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* class VelocityComponent {
|
|
34
|
+
* constructor(x, y) {
|
|
35
|
+
* this.x = x;
|
|
36
|
+
* this.y = y;
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* // Add components to the entity.
|
|
41
|
+
* entity.add(new PositionComponent(10, 20));
|
|
42
|
+
* entity.add(new VelocityComponent(1, 2));
|
|
43
|
+
|
|
44
|
+
*
|
|
45
|
+
* // Get a component (would return null if the entity doesn't have it).
|
|
46
|
+
* const position = entity.getComponent(PositionComponent); // { x:10, y:20 }
|
|
47
|
+
*
|
|
48
|
+
* // Remove a component.
|
|
49
|
+
* entity.removeComponent(VelocityComponent);
|
|
50
|
+
*
|
|
51
|
+
* // To actually use the entity in a game, you need to build it using an EntityComponentDataset.
|
|
52
|
+
* const dataset = new EntityComponentDataset(); // You would typically have one already
|
|
53
|
+
*
|
|
54
|
+
* entity.build(dataset);
|
|
55
|
+
* // Now the entity and its components are managed by the ECS.
|
|
56
|
+
*
|
|
57
|
+
* // later, you can destroy the entity:
|
|
58
|
+
* entity.destroy();
|
|
59
|
+
*
|
|
20
60
|
*/
|
|
21
61
|
class Entity {
|
|
22
62
|
|
|
@@ -23,7 +23,7 @@ export class EntityComponentDataset {
|
|
|
23
23
|
|
|
24
24
|
public createEntitySpecific(entityId: number): void
|
|
25
25
|
|
|
26
|
-
public removeEntity(entityIndex: number):
|
|
26
|
+
public removeEntity(entityIndex: number): boolean
|
|
27
27
|
|
|
28
28
|
public removeEntities(entityIndices: number[]): void
|
|
29
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityComponentDataset.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityComponentDataset.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityComponentDataset.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityComponentDataset.js"],"names":[],"mappings":"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"}
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
import Signal from "../../core/events/signal/Signal.js";
|
|
10
10
|
import { SignalHandler } from "../../core/events/signal/SignalHandler.js";
|
|
11
11
|
import { max3 } from "../../core/math/max3.js";
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
import { EventType } from "./EventType.js";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
@@ -110,6 +111,18 @@ const scratch_array_1 = [];
|
|
|
110
111
|
* Entities are just integer IDs and components are stored in a virtual table, where each component type has a separate column and each entity is a row in that table
|
|
111
112
|
* It is valid for entities to have no components or to have every possible component
|
|
112
113
|
* Generally the entity IDs are compacted, meaning that when an entity is removed - it's ID will be later reused
|
|
114
|
+
* Typically you would use {@link Entity} helper class instead of working directly with the dataset as it offers a higher-level API
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* const ecd = new EntityComponentDataset();
|
|
118
|
+
* // create an entity
|
|
119
|
+
* const entityId = ecd.createEntity();
|
|
120
|
+
*
|
|
121
|
+
* // add a component to your entity
|
|
122
|
+
* ecd.addComponentToEntity(entityId, myComponentInstance);
|
|
123
|
+
*
|
|
124
|
+
* // destroy the entity
|
|
125
|
+
* ecd.removeEntity(entityId);
|
|
113
126
|
*/
|
|
114
127
|
export class EntityComponentDataset {
|
|
115
128
|
|
|
@@ -769,6 +782,8 @@ export class EntityComponentDataset {
|
|
|
769
782
|
* @returns {number}
|
|
770
783
|
*/
|
|
771
784
|
getEntityGeneration(entity_id) {
|
|
785
|
+
assert.isNonNegativeInteger(entity_id, 'entity_id');
|
|
786
|
+
|
|
772
787
|
return this.entityGeneration[entity_id];
|
|
773
788
|
}
|
|
774
789
|
|
|
@@ -843,9 +858,9 @@ export class EntityComponentDataset {
|
|
|
843
858
|
}
|
|
844
859
|
|
|
845
860
|
/**
|
|
846
|
-
*
|
|
861
|
+
* Remove entity from the dataset, effectively destroying it from the world
|
|
847
862
|
* @param {number} entity_id
|
|
848
|
-
* @returns {boolean}
|
|
863
|
+
* @returns {boolean} true if entity was removed, false if it doesn't exist
|
|
849
864
|
*/
|
|
850
865
|
removeEntity(entity_id) {
|
|
851
866
|
if (!this.entityExists(entity_id)) {
|
|
@@ -1166,7 +1181,13 @@ export class EntityComponentDataset {
|
|
|
1166
1181
|
|
|
1167
1182
|
/**
|
|
1168
1183
|
* Performs traversal on a subset of entities which have specified components.
|
|
1169
|
-
* @example
|
|
1184
|
+
* @example
|
|
1185
|
+
* ecd.traverseEntities(
|
|
1186
|
+
* [Transform, Renderable, Tag], // Component classes to match
|
|
1187
|
+
* (transform, renderable, tag, entity ) => { // actual component instances along with entity ID
|
|
1188
|
+
* // do something
|
|
1189
|
+
* }
|
|
1190
|
+
* );
|
|
1170
1191
|
* @param {Array} classes
|
|
1171
1192
|
* @param {function(...args):boolean} visitor Visitor can return optional "false" to terminate traversal earlier
|
|
1172
1193
|
* @param {object} [thisArg] specifies context object on which callbacks are to be called, optional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EntityManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityManager.js"],"names":[],"mappings":"iCAeU,MAAM;;;;;;;;;AAWhB;;;GAGG;AACH;IAEI;;;OAGG;IACH,kBAFU,iCAAQ,CAEL;IAEb;;;;OAIG;IACH,uCAA2B;IAE3B;;;;OAIG;IACH,iCAAqB;IAErB;;OAEG;IACH;;;QAGI;;WAEG;qBADO,MAAM,iCAAQ;;MAI1B;IAEF;;;OAGG;IACH,OAFU,kBAAkB,CAEO;IAEnC;;;;;;OAMG;IACH,gDAA2C;IAE3C;;;;OAIG;IACH,qBAFU,MAAM,CAEY;IAE5B;;;;;OAKG;IACH,wCAFU,MAAM,CAE4B;IAE5C;;;OAGG;IACH,SAFU,sBAAsB,CAEjB;IAEf;;;;;OAKG;IACH,uCAAsC;IAEtC;;;OAGG;IACH,6BA8EC;IAED,sBAcC;IAED;;;OAGG;IACH,uBAFa,KAAK,EAAE,CAuBnB;IAED;;;;;OAKG;IACH,uBAJW,sBAAsB,QA0BhC;IAED;;;;OAIG;IACH,UAJa,CAAC,eACH,KAAK,CAAC,CAAC,CAAC,GACN,OAAO,CAInB;IAED;;;;OAIG;IACH,UAJa,CAAC,eACH,KAAK,CAAC,CAAC,CAAC,GACN,CAAC,GAAC,IAAI,CAgBlB;IAED;;;;;OAKG;IACH,wBAJa,CAAC,aACH,MAAM,GACJ,IAAI,GAAC,KAAK,CAAC,CAAC,CAAC,CAezB;IAGD;;;OAGG;IACH,oBAFW,MAAM,QAkEhB;IAED;;;;;OAKG;IACH,iEA0EC;IAED;;;;OAIG;IACH,uDAFa,OAAO,CAAC,OAAO,CAAC,CAyC5B;IAED;;;;;OAKG;IACH,mBA6BC;IAED;;;;;OAKG;IACH,oBAwCC;IAED;;;;OAIG;IACH,gEAwEC;IAED;;;;OAIG;IACH,2BAHW,KAAK,GACH,OAAO,iCAAS,CA0B5B;IAED;;;;;OAKG;IACH,kCAJW,KAAK,SACL,WAAW,GACT,OAAO,iCAAS,CAsB5B;IAED;;;;OAIG;IACH,iEAsEC;CACJ;uBAtyBmC,aAAa;mBAP9B,oCAAoC"}
|
|
@@ -5,22 +5,12 @@ import { IllegalStateException } from "../../core/fsm/exceptions/IllegalStateExc
|
|
|
5
5
|
|
|
6
6
|
import { noop } from "../../core/function/noop.js";
|
|
7
7
|
import { ResourceAccessKind } from "../../core/model/ResourceAccessKind.js";
|
|
8
|
+
import { computeSystemName } from "./computeSystemName.js";
|
|
8
9
|
import { EntityObserver } from "./EntityObserver.js";
|
|
9
|
-
import {
|
|
10
|
+
import { System, SystemState } from "./System.js";
|
|
10
11
|
import { computeSystemComponentDependencyGraph } from "./system/computeSystemComponentDependencyGraph.js";
|
|
11
12
|
import { validateSystem } from "./validateSystem.js";
|
|
12
13
|
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @enum {string}
|
|
16
|
-
* @readonly
|
|
17
|
-
*/
|
|
18
|
-
export const EventType = {
|
|
19
|
-
EntityRemoved: "entityRemoved",
|
|
20
|
-
ComponentAdded: "componentAdded",
|
|
21
|
-
ComponentRemoved: "componentRemoved"
|
|
22
|
-
};
|
|
23
|
-
|
|
24
14
|
/**
|
|
25
15
|
* @readonly
|
|
26
16
|
* @enum {number}
|
|
@@ -753,6 +743,10 @@ export class EntityManager {
|
|
|
753
743
|
* @param {function} errorCallback
|
|
754
744
|
*/
|
|
755
745
|
shutdown(readyCallback, errorCallback) {
|
|
746
|
+
if(this.state !== EntityManagerState.Running){
|
|
747
|
+
throw new IllegalStateException(`System is wrong state, expected '${EntityManagerState.Running}'`);
|
|
748
|
+
}
|
|
749
|
+
|
|
756
750
|
this.state = EntityManagerState.Stopping;
|
|
757
751
|
|
|
758
752
|
if (this.dataset !== null) {
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Uniquely identifies an entity by both its ID and generation.
|
|
3
3
|
* Lets us distinguish between two entities with the same ID that were created at different times
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // 1. Get your EntityComponentDataset to where you manager entities.
|
|
7
|
+
* const ecd = ... ; //EntityComponentDataset
|
|
8
|
+
*
|
|
9
|
+
* // 2. Create an entity (we'll get an ID). Or use an existing one.
|
|
10
|
+
* const entityId = ecd.createEntity(); // Let's say this returns ID 1, generation 0
|
|
11
|
+
*
|
|
12
|
+
* // 3. Create an EntityReference and bind it to the entity.
|
|
13
|
+
* const entityRef = EntityReference.bind(ecd, entityId);
|
|
14
|
+
*
|
|
15
|
+
* // 4. After you no longer need the entity - destroy the entity via reference.
|
|
16
|
+
* entityRef.destroy(ecd);
|
|
17
|
+
*
|
|
4
18
|
*/
|
|
5
19
|
export class EntityReference {
|
|
6
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityReference.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityReference.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"EntityReference.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EntityReference.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH;IAqHI;;;;;OAKG;IACH,gBAJW,MAAM,cACN,MAAM,GACL,eAAe,CAQ1B;IAED;;;;;OAKG;IACH,iBAJW,sBAAsB,MACtB,MAAM,GACJ,eAAe,CAQ3B;IA7ID;;;;OAIG;IACH,IAFU,MAAM,CAET;IAEP;;;;OAIG;IACH,YAFU,MAAM,CAED;IAEf;;;OAGG;IACH,YAFW,eAAe,QAKzB;IAED;;;OAGG;IACH,SAFa,eAAe,CAQ3B;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACd,OAAO,CAMlB;IAED;;;;OAIG;IACH,YAHW,sBAAsB,GACpB,OAAO,CAYnB;IAED;;;;;OAKG;IACH,aAHW,sBAAsB,GACpB,OAAO,CASnB;IAED;;;;OAIG;IACH,UAHW,sBAAsB,UACtB,MAAM,QAShB;IAED;;;;OAIG;IACH,SAHW,MAAM,cACN,MAAM,QAUhB;IA+BL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C;;cAWS,eAAe"}
|
|
@@ -3,6 +3,20 @@ import { assert } from "../../core/assert.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Uniquely identifies an entity by both its ID and generation.
|
|
5
5
|
* Lets us distinguish between two entities with the same ID that were created at different times
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // 1. Get your EntityComponentDataset to where you manager entities.
|
|
9
|
+
* const ecd = ... ; //EntityComponentDataset
|
|
10
|
+
*
|
|
11
|
+
* // 2. Create an entity (we'll get an ID). Or use an existing one.
|
|
12
|
+
* const entityId = ecd.createEntity(); // Let's say this returns ID 1, generation 0
|
|
13
|
+
*
|
|
14
|
+
* // 3. Create an EntityReference and bind it to the entity.
|
|
15
|
+
* const entityRef = EntityReference.bind(ecd, entityId);
|
|
16
|
+
*
|
|
17
|
+
* // 4. After you no longer need the entity - destroy the entity via reference.
|
|
18
|
+
* entityRef.destroy(ecd);
|
|
19
|
+
*
|
|
6
20
|
*/
|
|
7
21
|
export class EntityReference {
|
|
8
22
|
|
|
@@ -66,6 +80,10 @@ export class EntityReference {
|
|
|
66
80
|
* @returns {boolean}
|
|
67
81
|
*/
|
|
68
82
|
verify(ecd) {
|
|
83
|
+
if (this.id < 0) {
|
|
84
|
+
// special case
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
69
87
|
|
|
70
88
|
return ecd.entityExists(this.id)
|
|
71
89
|
&& this.generation === ecd.getEntityGeneration(this.id)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventType.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/EventType.js"],"names":[],"mappings":";;;wBAEU,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"System.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/System.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"System.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/System.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,oBAFa,CAAC;IAIV;;;OAGG;IACH,yBAFU,aAAa,CAEF;IAErB;;;OAGG;IACH,gBAFU,aAAa,CAAE,WAAW,CAAC,CAEU;IAE/C;;;OAGG;IACH,oBAAkB;IAElB;;;;;;;;OAQG;IACH,iBAFU,2BAA2B,EAAE,CAElB;IAGrB;;OAEG;IACH,mCAcC;IAED;;;;OAIG;IACH,sBAJa,CAAC,SACH,CAAC,GACA,MAAM,CA8BjB;IAED,0EAGC;IAED,2EAEC;IAED,wCAEC;IAED,0CAEC;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;IAEzB;;;;OAIG;IACH,yBAA4B;IAG5B;;;OAGG;IACH,oBAAuB;CApBtB;;;;0BA2CS,MAAM;;;;;;;;0BAzJU,mCAAmC;qBADxC,6BAA6B"}
|
package/src/engine/ecs/System.js
CHANGED
|
@@ -8,7 +8,7 @@ import { ResourceAccessKind } from "../../core/model/ResourceAccessKind.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @template C
|
|
10
10
|
*/
|
|
11
|
-
class System {
|
|
11
|
+
export class System {
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @protected
|
|
@@ -170,14 +170,3 @@ export const SystemState = {
|
|
|
170
170
|
*/
|
|
171
171
|
System.State = SystemState;
|
|
172
172
|
|
|
173
|
-
/**
|
|
174
|
-
*
|
|
175
|
-
* @param {System} system
|
|
176
|
-
* @returns {string}
|
|
177
|
-
*/
|
|
178
|
-
function computeSystemName(system) {
|
|
179
|
-
|
|
180
|
-
return system.constructor.name;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export { System, computeSystemName };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeSystemName.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/computeSystemName.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,0CAHW,MAAM,GACJ,MAAM,CAKlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventType } from "../
|
|
1
|
+
import { EventType } from "../EventType.js";
|
|
2
2
|
import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
|
|
3
3
|
import { SystemEntityContext } from "../system/SystemEntityContext.js";
|
|
4
4
|
import { ParentEntity } from "./ParentEntity.js";
|
|
@@ -27,21 +27,54 @@ declare class Clouds {
|
|
|
27
27
|
* @returns {boolean}
|
|
28
28
|
*/
|
|
29
29
|
get enabled(): boolean;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param {number} x
|
|
33
|
+
* @param {number} y
|
|
34
|
+
*/
|
|
35
|
+
setSpeed(x: number, y: number): void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param {THREE.Material} mat
|
|
39
|
+
*/
|
|
40
|
+
writeOneCloudSpeed(mat: THREE.Material): void;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param {THREE.Material} mat
|
|
44
|
+
*/
|
|
45
|
+
writeOneEnabled(mat: THREE.Material): void;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @param {THREE.Material} mat
|
|
49
|
+
*/
|
|
50
|
+
writeOneTime(mat: THREE.Material): void;
|
|
34
51
|
writeAllTime(): void;
|
|
35
|
-
update(timeDelta: any): void;
|
|
36
|
-
writeOneCloudTextures(mat: any): void;
|
|
37
|
-
writeOneCloudUniforms(mat: any): void;
|
|
38
52
|
/**
|
|
39
53
|
*
|
|
40
|
-
* @param {
|
|
54
|
+
* @param {number} timeDelta
|
|
55
|
+
*/
|
|
56
|
+
update(timeDelta: number): void;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param {THREE.Material} mat
|
|
60
|
+
*/
|
|
61
|
+
writeOneCloudTextures(mat: THREE.Material): void;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param {THREE.Material} mat
|
|
65
|
+
*/
|
|
66
|
+
writeOneCloudUniforms(mat: THREE.Material): void;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param {THREE.Material} material
|
|
41
70
|
* @returns {boolean}
|
|
42
71
|
*/
|
|
43
|
-
removeMaterial(material: Material): boolean;
|
|
44
|
-
|
|
72
|
+
removeMaterial(material: THREE.Material): boolean;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param {THREE.Material} material
|
|
76
|
+
*/
|
|
77
|
+
addMaterial(material: THREE.Material): void;
|
|
45
78
|
}
|
|
46
79
|
import Vector2 from '../../../core/geom/Vector2.js';
|
|
47
80
|
//# sourceMappingURL=TerrainClouds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainClouds.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/terrain/TerrainClouds.js"],"names":[],"mappings":";AA6BA;IACI;;;;OAIG;IACH,kBAAkB;IAClB;;;;OAIG;IACH,kBAAe;IACf,aAAS;IAGT,kBAAyB;IACzB,kBAAyB;IACzB,kBAAyB;IAGzB,oBAAmB;IAMnB;;;OAGG;IACH,iBAFW,OAAO,EASjB;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED
|
|
1
|
+
{"version":3,"file":"TerrainClouds.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/terrain/TerrainClouds.js"],"names":[],"mappings":";AA6BA;IACI;;;;OAIG;IACH,kBAAkB;IAClB;;;;OAIG;IACH,kBAAe;IACf,aAAS;IAGT,kBAAyB;IACzB,kBAAyB;IACzB,kBAAyB;IAGzB,oBAAmB;IAMnB;;;OAGG;IACH,iBAFW,OAAO,EASjB;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,YAHW,MAAM,KACN,MAAM,QAQhB;IAED;;;OAGG;IACH,wBAFW,KAAK,CAAC,QAAQ,QAQxB;IAED;;;OAGG;IACH,qBAFW,KAAK,CAAC,QAAQ,QAKxB;IAED;;;OAGG;IACH,kBAFW,KAAK,CAAC,QAAQ,QAKxB;IAGD,qBAQC;IAED;;;OAGG;IACH,kBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,2BAFW,KAAK,CAAC,QAAQ,QAOxB;IAED;;;OAGG;IACH,2BAFW,KAAK,CAAC,QAAQ,QAaxB;IAED;;;;OAIG;IACH,yBAHW,KAAK,CAAC,QAAQ,GACZ,OAAO,CAWnB;IAED;;;OAGG;IACH,sBAFW,KAAK,CAAC,QAAQ,QAgBxB;CACJ;oBA1MmB,+BAA+B"}
|