@woosh/meep-engine 2.120.1 → 2.120.3
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/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/2d/circle/Circle.d.ts +7 -5
- package/src/core/geom/2d/circle/Circle.d.ts.map +1 -1
- package/src/core/geom/2d/circle/Circle.js +7 -5
- package/src/core/geom/2d/circle/circle_area.d.ts +7 -0
- package/src/core/geom/2d/circle/circle_area.d.ts.map +1 -0
- package/src/core/geom/2d/circle/circle_area.js +8 -0
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +57 -23
- 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/engine/EngineConfiguration.js +1 -1
- package/src/engine/ecs/Entity.d.ts.map +1 -1
- package/src/engine/ecs/Entity.js +44 -4
- 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 +56 -17
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityManager.js +16 -13
- package/src/engine/ecs/EntityObserver.d.ts.map +1 -1
- package/src/engine/ecs/EntityObserver.js +2 -10
- package/src/engine/ecs/EntityReference.d.ts +24 -2
- package/src/engine/ecs/EntityReference.d.ts.map +1 -1
- package/src/engine/ecs/EntityReference.js +42 -6
- 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/graphics/texture/sampler/Sampler2D.d.ts +349 -50
- 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/intelligence/behavior/ecs/DieBehavior.d.ts +3 -0
- package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/DieBehavior.js +4 -0
- package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +17 -0
- package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts.map +1 -0
- package/src/engine/intelligence/behavior/ecs/KillBehavior.js +47 -0
- 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/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts +7 -6
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +51 -43
- package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +0 -48
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts.map +0 -1
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts.map +0 -1
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +0 -1
- package/editor/actions/concrete/SelectionAddAction.d.ts.map +0 -1
- package/editor/actions/concrete/SelectionClearAction.d.ts.map +0 -1
- package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +0 -1
- package/editor/actions/concrete/TransformModifyAction.d.ts.map +0 -1
- package/editor/actions/concrete/WriteGridValueAction.d.ts.map +0 -1
- package/src/engine/ecs/read_entity_reference.d.ts +0 -9
- package/src/engine/ecs/read_entity_reference.d.ts.map +0 -1
- package/src/engine/ecs/read_entity_reference.js +0 -15
- package/src/engine/ecs/transform/Transform.editor.schema.json +0 -16
|
@@ -1,50 +1,349 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Data Texture class, providing an abstraction around 2d numerical arrays, mostly for sampling purposes
|
|
3
|
+
* Inspired by OpenGL's glsl sampler2d API
|
|
4
|
+
* @class
|
|
5
|
+
*/
|
|
6
|
+
export class Sampler2D {
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {int} itemSize
|
|
10
|
+
* @param {int} width
|
|
11
|
+
* @param {int} height
|
|
12
|
+
* @return {Sampler2D}
|
|
13
|
+
*/
|
|
14
|
+
static uint8clamped(itemSize: int, width: int, height: int): Sampler2D;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {int} itemSize
|
|
18
|
+
* @param {int} width
|
|
19
|
+
* @param {int} height
|
|
20
|
+
* @return {Sampler2D}
|
|
21
|
+
*/
|
|
22
|
+
static uint8(itemSize: int, width: int, height: int): Sampler2D;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param {int} itemSize
|
|
26
|
+
* @param {int} width
|
|
27
|
+
* @param {int} height
|
|
28
|
+
* @return {Sampler2D}
|
|
29
|
+
*/
|
|
30
|
+
static uint16(itemSize: int, width: int, height: int): Sampler2D;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {int} itemSize
|
|
34
|
+
* @param {int} width
|
|
35
|
+
* @param {int} height
|
|
36
|
+
* @return {Sampler2D}
|
|
37
|
+
*/
|
|
38
|
+
static uint32(itemSize: int, width: int, height: int): Sampler2D;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param {int} itemSize
|
|
42
|
+
* @param {int} width
|
|
43
|
+
* @param {int} height
|
|
44
|
+
* @return {Sampler2D}
|
|
45
|
+
*/
|
|
46
|
+
static int8(itemSize: int, width: int, height: int): Sampler2D;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param {int} itemSize
|
|
50
|
+
* @param {int} width
|
|
51
|
+
* @param {int} height
|
|
52
|
+
* @return {Sampler2D}
|
|
53
|
+
*/
|
|
54
|
+
static int16(itemSize: int, width: int, height: int): Sampler2D;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @param {int} itemSize
|
|
58
|
+
* @param {int} width
|
|
59
|
+
* @param {int} height
|
|
60
|
+
* @return {Sampler2D}
|
|
61
|
+
*/
|
|
62
|
+
static int32(itemSize: int, width: int, height: int): Sampler2D;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param {int} itemSize
|
|
66
|
+
* @param {int} width
|
|
67
|
+
* @param {int} height
|
|
68
|
+
* @return {Sampler2D}
|
|
69
|
+
*/
|
|
70
|
+
static float32(itemSize: int, width: int, height: int): Sampler2D;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param {int} itemSize
|
|
74
|
+
* @param {int} width
|
|
75
|
+
* @param {int} height
|
|
76
|
+
* @return {Sampler2D}
|
|
77
|
+
*/
|
|
78
|
+
static float64(itemSize: int, width: int, height: int): Sampler2D;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param {ArrayLike<number>|number[]|Uint8ClampedArray|Uint8Array|Uint16Array|Uint32Array|Int8Array|Int16Array|Int32Array|Float32Array|Float64Array} data
|
|
82
|
+
* @param {number} [itemSize]
|
|
83
|
+
* @param {number} [width]
|
|
84
|
+
* @param {number} [height]
|
|
85
|
+
* @constructor
|
|
86
|
+
*/
|
|
87
|
+
constructor(data?: ArrayLike<number> | number[] | Uint8ClampedArray | Uint8Array | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array, itemSize?: number, width?: number, height?: number);
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @type {number}
|
|
91
|
+
*/
|
|
92
|
+
width: number;
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @type {number}
|
|
96
|
+
*/
|
|
97
|
+
height: number;
|
|
98
|
+
/**
|
|
99
|
+
* Number of channels
|
|
100
|
+
* @type {number}
|
|
101
|
+
*/
|
|
102
|
+
itemSize: number;
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @type {number[]|Uint8ClampedArray|Uint8Array|Uint16Array|Uint32Array|Int8Array|Int16Array|Int32Array|Float32Array|Float64Array}
|
|
106
|
+
*/
|
|
107
|
+
data: number[] | Uint8ClampedArray | Uint8Array | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
|
|
108
|
+
/**
|
|
109
|
+
* Used to tracking changes
|
|
110
|
+
* @type {number}
|
|
111
|
+
*/
|
|
112
|
+
version: number;
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @param {number} u
|
|
116
|
+
* @param {number} v
|
|
117
|
+
* @param {number[]} result
|
|
118
|
+
*/
|
|
119
|
+
sampleCatmullRomUV(u: number, v: number, result: number[]): void;
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* @param {number} u
|
|
123
|
+
* @param {number} v
|
|
124
|
+
* @param {number} channel
|
|
125
|
+
* @returns {number}
|
|
126
|
+
*/
|
|
127
|
+
sampleChannelCatmullRomUV(u: number, v: number, channel: number): number;
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* @see https://gist.github.com/TheRealMJP/c83b8c0f46b63f3a88a5986f4fa982b1
|
|
131
|
+
* @param {number} x
|
|
132
|
+
* @param {number} y
|
|
133
|
+
* @param {number} channel
|
|
134
|
+
* @returns {number}
|
|
135
|
+
*/
|
|
136
|
+
sampleChannelCatmullRom(x: number, y: number, channel: number): number;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @param {number} u
|
|
140
|
+
* @param {number} v
|
|
141
|
+
* @param {number[]} result
|
|
142
|
+
*/
|
|
143
|
+
sampleBicubicUV(u: number, v: number, result: number[]): void;
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* @param {number} x
|
|
147
|
+
* @param {number} y
|
|
148
|
+
* @param {number[]|Float32Array|Float64Array} result
|
|
149
|
+
* @param {number} result_offset
|
|
150
|
+
*/
|
|
151
|
+
sampleBicubic(x: number, y: number, result: number[] | Float32Array | Float64Array, result_offset: number): void;
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
* @param {number} u
|
|
155
|
+
* @param {number} v
|
|
156
|
+
* @param {number} channel
|
|
157
|
+
* @returns {number}
|
|
158
|
+
*/
|
|
159
|
+
sampleChannelBicubicUV(u: number, v: number, channel: number): number;
|
|
160
|
+
/**
|
|
161
|
+
*
|
|
162
|
+
* Bicubic-filtered sampling, note values can be negative due to the nature of the cubic curve
|
|
163
|
+
* @param {number} x
|
|
164
|
+
* @param {number} y
|
|
165
|
+
* @param {number} channel
|
|
166
|
+
* @returns {number}
|
|
167
|
+
*/
|
|
168
|
+
sampleChannelBicubic(x: number, y: number, channel: number): number;
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
* @param {number} u
|
|
172
|
+
* @param {number} v
|
|
173
|
+
* @param {number[]|Float32Array} result
|
|
174
|
+
* @param {number} result_offset
|
|
175
|
+
*/
|
|
176
|
+
sampleBilinearUV(u: number, v: number, result: number[] | Float32Array, result_offset?: number): void;
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* @param {number} x
|
|
180
|
+
* @param {number} y
|
|
181
|
+
* @param {number[]|Float32Array|Float64Array} result
|
|
182
|
+
* @param {number} result_offset
|
|
183
|
+
*/
|
|
184
|
+
sampleBilinear(x: number, y: number, result: number[] | Float32Array | Float64Array, result_offset?: number): void;
|
|
185
|
+
/**
|
|
186
|
+
*
|
|
187
|
+
* @param {number} u
|
|
188
|
+
* @param {number} v
|
|
189
|
+
* @param {number} channel
|
|
190
|
+
* @return {number}
|
|
191
|
+
*/
|
|
192
|
+
sampleChannelBilinearUV(u: number, v: number, channel: number): number;
|
|
193
|
+
/**
|
|
194
|
+
*
|
|
195
|
+
* @param {number} x
|
|
196
|
+
* @param {number} y
|
|
197
|
+
* @param {number} channel
|
|
198
|
+
* @returns {number}
|
|
199
|
+
*/
|
|
200
|
+
sampleChannelBilinear(x: number, y: number, channel: number): number;
|
|
201
|
+
/**
|
|
202
|
+
*
|
|
203
|
+
* @param {number} u
|
|
204
|
+
* @param {number} v
|
|
205
|
+
* @param {number[]|ArrayLike<number>} result
|
|
206
|
+
*/
|
|
207
|
+
sampleNearestUV(u: number, v: number, result: number[] | ArrayLike<number>): void;
|
|
208
|
+
/**
|
|
209
|
+
*
|
|
210
|
+
* @param {number} x
|
|
211
|
+
* @param {number} y
|
|
212
|
+
* @param {number} channel
|
|
213
|
+
* @returns {number}
|
|
214
|
+
*/
|
|
215
|
+
readChannel(x: number, y: number, channel: number): number;
|
|
216
|
+
/**
|
|
217
|
+
*
|
|
218
|
+
* @param {number} x
|
|
219
|
+
* @param {number} y
|
|
220
|
+
* @param {number[]} result
|
|
221
|
+
*/
|
|
222
|
+
read(x: number, y: number, result: number[]): void;
|
|
223
|
+
/**
|
|
224
|
+
*
|
|
225
|
+
* @param {number} x
|
|
226
|
+
* @param {number} y
|
|
227
|
+
* @param {number[]|ArrayLike<number>} texel
|
|
228
|
+
*/
|
|
229
|
+
write(x: number, y: number, texel: number[] | ArrayLike<number>): void;
|
|
230
|
+
/**
|
|
231
|
+
*
|
|
232
|
+
* @param {number} x
|
|
233
|
+
* @param {number} y
|
|
234
|
+
* @returns {number}
|
|
235
|
+
*/
|
|
236
|
+
point2index(x: number, y: number): number;
|
|
237
|
+
/**
|
|
238
|
+
*
|
|
239
|
+
* @param {number} index
|
|
240
|
+
* @param {Vector2} result
|
|
241
|
+
*/
|
|
242
|
+
index2point(index: number, result: Vector2): void;
|
|
243
|
+
/**
|
|
244
|
+
* Copy a patch from another sampler
|
|
245
|
+
* @param {Sampler2D} source where to copy from
|
|
246
|
+
* @param {Number} sourceX where to start reading from, X coordinate
|
|
247
|
+
* @param {Number} sourceY where to start reading from, X coordinate
|
|
248
|
+
* @param {Number} destinationX where to start writing to, X coordinate
|
|
249
|
+
* @param {Number} destinationY where to start writing to, X coordinate
|
|
250
|
+
* @param {Number} width size of the patch that is to be copied
|
|
251
|
+
* @param {Number} height size of the patch that is to be copied
|
|
252
|
+
*/
|
|
253
|
+
copy(source: Sampler2D, sourceX: number, sourceY: number, destinationX: number, destinationY: number, width: number, height: number): void;
|
|
254
|
+
/**
|
|
255
|
+
* Fill data values with zeros for a given area
|
|
256
|
+
* Specialized version of `fill` method, optimized for speed
|
|
257
|
+
* @param {Number} x
|
|
258
|
+
* @param {Number} y
|
|
259
|
+
* @param {Number} width
|
|
260
|
+
* @param {Number} height
|
|
261
|
+
*/
|
|
262
|
+
zeroFill(x: number, y: number, width: number, height: number): void;
|
|
263
|
+
/**
|
|
264
|
+
*
|
|
265
|
+
* @param {number} channel_index
|
|
266
|
+
* @param {number} value
|
|
267
|
+
*/
|
|
268
|
+
channelFill(channel_index: number, value: number): void;
|
|
269
|
+
/**
|
|
270
|
+
*
|
|
271
|
+
* @param {number} x
|
|
272
|
+
* @param {number} y
|
|
273
|
+
* @param {number} width
|
|
274
|
+
* @param {number} height
|
|
275
|
+
* @param {Array.<number>} value
|
|
276
|
+
*/
|
|
277
|
+
fill(x: number, y: number, width: number, height: number, value: Array<number>): void;
|
|
278
|
+
/**
|
|
279
|
+
* Set channel value of a specific texel
|
|
280
|
+
* @param {number} x
|
|
281
|
+
* @param {number} y
|
|
282
|
+
* @param {number} channel
|
|
283
|
+
* @param {number} value
|
|
284
|
+
*/
|
|
285
|
+
writeChannel(x: number, y: number, channel: number, value: number): void;
|
|
286
|
+
/**
|
|
287
|
+
* Traverses area inside a circle
|
|
288
|
+
* NOTE: Based on palm3d answer on stack overflow: https://stackoverflow.com/questions/1201200/fast-algorithm-for-drawing-filled-circles
|
|
289
|
+
* @param {number} centerX
|
|
290
|
+
* @param {number} centerY
|
|
291
|
+
* @param {number} radius
|
|
292
|
+
* @param {function(x:number,y:number, sampler:Sampler2D)} visitor
|
|
293
|
+
*/
|
|
294
|
+
traverseCircle(centerX: number, centerY: number, radius: number, visitor: any): void;
|
|
295
|
+
/**
|
|
296
|
+
*
|
|
297
|
+
* @param {number} x
|
|
298
|
+
* @param {number} y
|
|
299
|
+
* @param {boolean} [preserveData=true]
|
|
300
|
+
*/
|
|
301
|
+
resize(x: number, y: number, preserveData?: boolean): void;
|
|
302
|
+
/**
|
|
303
|
+
* Estimate memory requirement of the object
|
|
304
|
+
* @return {number}
|
|
305
|
+
*/
|
|
306
|
+
computeByteSize(): number;
|
|
307
|
+
/**
|
|
308
|
+
*
|
|
309
|
+
* @param {Sampler2D} other
|
|
310
|
+
* @return {boolean}
|
|
311
|
+
*/
|
|
312
|
+
equals(other: Sampler2D): boolean;
|
|
313
|
+
/**
|
|
314
|
+
*
|
|
315
|
+
* @return {number}
|
|
316
|
+
*/
|
|
317
|
+
hash(): number;
|
|
318
|
+
/**
|
|
319
|
+
* @returns {Sampler2D}
|
|
320
|
+
*/
|
|
321
|
+
clone(): Sampler2D;
|
|
322
|
+
toJSON(): {
|
|
323
|
+
height: number;
|
|
324
|
+
width: number;
|
|
325
|
+
itemSize: number;
|
|
326
|
+
type: import("../../../../core/binary/type/BinaryDataType.js").BinaryDataType;
|
|
327
|
+
data: string;
|
|
328
|
+
};
|
|
329
|
+
fromJSON({ height, width, itemSize, type, data }: {
|
|
330
|
+
height: any;
|
|
331
|
+
width: any;
|
|
332
|
+
itemSize: any;
|
|
333
|
+
type: any;
|
|
334
|
+
data: any;
|
|
335
|
+
}): void;
|
|
336
|
+
/**
|
|
337
|
+
* @deprecated use {@link write} instead
|
|
338
|
+
*/
|
|
339
|
+
set: (x: number, y: number, texel: number[] | ArrayLike<number>) => void;
|
|
340
|
+
/**
|
|
341
|
+
* @readonly
|
|
342
|
+
* @type {boolean}
|
|
343
|
+
*/
|
|
344
|
+
readonly isSampler2D: boolean;
|
|
345
|
+
}
|
|
346
|
+
export namespace Sampler2D {
|
|
347
|
+
let typeName: string;
|
|
348
|
+
}
|
|
349
|
+
//# sourceMappingURL=Sampler2D.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputDeviceSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/InputDeviceSwitch.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAEI;;;;OAIG;IACH,eAFU,
|
|
1
|
+
{"version":3,"file":"InputDeviceSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/InputDeviceSwitch.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAEI;;;;OAIG;IACH,eAFU,MAAQ,CAEC;IAEnB;;;;OAIG;IACH,aAFU,MAAQ,CAED;IAEjB;;;OAGG;IACH,SAFU,OAAO,CAEF;IAEf;;;OAGG;IACH,aAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,cAOC;IAED;;;;OAIG;IACH,gBAOC;CACJ;mBA9DkB,uCAAuC"}
|
|
@@ -8,14 +8,14 @@ export class InputDeviceSwitch {
|
|
|
8
8
|
/**
|
|
9
9
|
* Switch press
|
|
10
10
|
* @readonly
|
|
11
|
-
* @type {Signal}
|
|
11
|
+
* @type {Signal<>}
|
|
12
12
|
*/
|
|
13
13
|
down = new Signal()
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Switch release
|
|
17
17
|
* @readonly
|
|
18
|
-
* @type {Signal}
|
|
18
|
+
* @type {Signal<>}
|
|
19
19
|
*/
|
|
20
20
|
up = new Signal()
|
|
21
21
|
|
|
@@ -36,6 +36,7 @@ export class InputDeviceSwitch {
|
|
|
36
36
|
/**
|
|
37
37
|
* Execute press, will trigger {@link down} signal if previous state was up
|
|
38
38
|
* Idempotent
|
|
39
|
+
* NOTE: make sure you understand the implications of using this
|
|
39
40
|
*/
|
|
40
41
|
press() {
|
|
41
42
|
if (this.is_down) {
|
|
@@ -49,6 +50,7 @@ export class InputDeviceSwitch {
|
|
|
49
50
|
/**
|
|
50
51
|
* Execute release, will trigger {@link up} signal if previous state was down
|
|
51
52
|
* Idempotent
|
|
53
|
+
* NOTE: make sure you understand the implications of using this
|
|
52
54
|
*/
|
|
53
55
|
release() {
|
|
54
56
|
if (!this.is_down) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyCodes.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyCodes.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyCodes.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyCodes.js"],"names":[],"mappings":";;;uBAGU,MAAM;AAHhB;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqGE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyboardDevice.js"],"names":[],"mappings":";AAYA;
|
|
1
|
+
{"version":3,"file":"KeyboardDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyboardDevice.js"],"names":[],"mappings":";AAYA;;;GAGG;AACH;IA4BI;;;OAGG;IACH,wBAHW,WAAW,GAAC,OAAO,EAgC7B;IA3DD;;OAEG;IACH;QACI;;;WAGG;cADO,MAAM,CAAC,aAAa,CAAC;QAG/B;;;WAGG;YADO,MAAM,CAAC,aAAa,CAAC;MAGjC;IAEF;;;;;;;OAOG;IACH,mBAAU;IAkBN;;;OAGG;IACH,YAFU,WAAW,CAEO;IAkFhC;;;OAGG;IACH,SAFa,IAAI,CAKhB;IAED;;;OAGG;IACH,QAFa,IAAI,CAKhB;;CAEJ;mBApKkB,uCAAuC"}
|
|
@@ -10,25 +10,41 @@ import { KeyCodes } from './KeyCodes.js';
|
|
|
10
10
|
*/
|
|
11
11
|
const codeToKeyNameMap = [];
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Provides keyboard input.
|
|
15
|
+
* Listens for key events on a DOM element and provides signals and state for key presses.
|
|
16
|
+
*/
|
|
13
17
|
class KeyboardDevice {
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
20
|
* @readonly
|
|
17
21
|
*/
|
|
18
22
|
on = {
|
|
23
|
+
/**
|
|
24
|
+
* Fires when any key is pressed
|
|
25
|
+
* @type {Signal<KeyboardEvent>}
|
|
26
|
+
*/
|
|
19
27
|
down: new Signal(),
|
|
28
|
+
/**
|
|
29
|
+
* Fires when any key is released
|
|
30
|
+
* @type {Signal<KeyboardEvent>}
|
|
31
|
+
*/
|
|
20
32
|
up: new Signal()
|
|
21
33
|
};
|
|
22
34
|
|
|
23
35
|
/**
|
|
36
|
+
* See {@link KeyCodes} for valid IDs
|
|
24
37
|
* @readonly
|
|
25
38
|
* @type {Object<InputDeviceSwitch>}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const is_enter_pressed = keyboard.keys[KeyCodes.enter].is_down;
|
|
26
42
|
*/
|
|
27
43
|
keys = {};
|
|
28
44
|
|
|
29
45
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @
|
|
46
|
+
* @param {EventTarget|Element} domElement The DOM element to listen for keyboard events on. This element *must* be focusable (e.g., have a `tabindex` attribute).
|
|
47
|
+
* @throws {TypeError} If the provided `domElement` is not focusable and doesn't have a `tabindex` attribute.
|
|
32
48
|
*/
|
|
33
49
|
constructor(domElement) {
|
|
34
50
|
|
|
@@ -43,7 +59,7 @@ class KeyboardDevice {
|
|
|
43
59
|
}
|
|
44
60
|
|
|
45
61
|
/**
|
|
46
|
-
*
|
|
62
|
+
* The DOM element being listened to.
|
|
47
63
|
* @type {EventTarget}
|
|
48
64
|
*/
|
|
49
65
|
this.domElement = domElement;
|
|
@@ -128,15 +144,24 @@ class KeyboardDevice {
|
|
|
128
144
|
|
|
129
145
|
}
|
|
130
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Starts listening for keyboard events on the associated DOM element.
|
|
149
|
+
* @returns {void}
|
|
150
|
+
*/
|
|
131
151
|
start() {
|
|
132
152
|
this.domElement.addEventListener(KeyboardEvents.KeyDown, this.#handlerKeyDown);
|
|
133
153
|
this.domElement.addEventListener(KeyboardEvents.KeyUp, this.#handlerKeyUp);
|
|
134
154
|
}
|
|
135
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Stops listening for keyboard events.
|
|
158
|
+
* @returns {void}
|
|
159
|
+
*/
|
|
136
160
|
stop() {
|
|
137
161
|
this.domElement.removeEventListener(KeyboardEvents.KeyDown, this.#handlerKeyDown);
|
|
138
162
|
this.domElement.removeEventListener(KeyboardEvents.KeyUp, this.#handlerKeyUp);
|
|
139
163
|
}
|
|
164
|
+
|
|
140
165
|
}
|
|
141
166
|
|
|
142
167
|
export default KeyboardDevice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DieBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/DieBehavior.js"],"names":[],"mappings":"AAGA;IAGI,6BAEC;IAED,qCASC;CACJ;+
|
|
1
|
+
{"version":3,"file":"DieBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/DieBehavior.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAGI,6BAEC;IAED,qCASC;CACJ;+BAtB8B,qBAAqB;+BADrB,sBAAsB"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BehaviorStatus } from "../BehaviorStatus.js";
|
|
2
2
|
import { EntityBehavior } from "./EntityBehavior.js";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Makes the entity destroy itself
|
|
6
|
+
*/
|
|
4
7
|
export class DieBehavior extends EntityBehavior {
|
|
5
8
|
|
|
6
9
|
|
|
@@ -19,3 +22,4 @@ export class DieBehavior extends EntityBehavior {
|
|
|
19
22
|
|
|
20
23
|
}
|
|
21
24
|
}
|
|
25
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Causes another entity to be destroyed
|
|
3
|
+
* Will produce a {@link BehaviorStatus.Failed} if entity could not be destroyed, either because it doesn't exist or the reference is stale
|
|
4
|
+
*/
|
|
5
|
+
export class KillBehavior extends EntityBehavior {
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {EntityReference} ref
|
|
9
|
+
* @returns {KillBehavior}
|
|
10
|
+
*/
|
|
11
|
+
static create(ref: EntityReference): KillBehavior;
|
|
12
|
+
tick(timeDelta: any): BehaviorStatus.Succeeded | BehaviorStatus.Failed;
|
|
13
|
+
#private;
|
|
14
|
+
}
|
|
15
|
+
import { EntityBehavior } from "./EntityBehavior.js";
|
|
16
|
+
import { BehaviorStatus } from "../BehaviorStatus.js";
|
|
17
|
+
//# sourceMappingURL=KillBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KillBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/KillBehavior.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;IAOI;;;;OAIG;IACH,mBAHW,eAAe,GACb,YAAY,CAYxB;IAED,uEAaC;;CACJ;+BA5C8B,qBAAqB;+BADrB,sBAAsB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { BehaviorStatus } from "../BehaviorStatus.js";
|
|
3
|
+
import { EntityBehavior } from "./EntityBehavior.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Causes another entity to be destroyed
|
|
7
|
+
* Will produce a {@link BehaviorStatus.Failed} if entity could not be destroyed, either because it doesn't exist or the reference is stale
|
|
8
|
+
*/
|
|
9
|
+
export class KillBehavior extends EntityBehavior {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @type {EntityReference}
|
|
13
|
+
*/
|
|
14
|
+
#ref;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param {EntityReference} ref
|
|
19
|
+
* @returns {KillBehavior}
|
|
20
|
+
*/
|
|
21
|
+
static create(ref) {
|
|
22
|
+
assert.defined(ref, 'ref');
|
|
23
|
+
assert.isObject(ref, 'ref');
|
|
24
|
+
assert.equal(ref.isEntityReference, true, 'ref.isEntityReference !== true');
|
|
25
|
+
|
|
26
|
+
const r = new KillBehavior();
|
|
27
|
+
|
|
28
|
+
r.#ref = ref;
|
|
29
|
+
|
|
30
|
+
return r;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
tick(timeDelta) {
|
|
34
|
+
|
|
35
|
+
const ecd = this.ecd;
|
|
36
|
+
|
|
37
|
+
if (this.#ref.destroy(ecd)) {
|
|
38
|
+
|
|
39
|
+
return BehaviorStatus.Succeeded;
|
|
40
|
+
|
|
41
|
+
} else {
|
|
42
|
+
// couldn't find
|
|
43
|
+
return BehaviorStatus.Failed;
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticKnowledgeDataTable.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDataTable.js"],"names":[],"mappings":"AAkCA;;;GAGG;AACH,sCAFa,CAAC;IAIV;;;OAGG;IACH,cAAc;IAEd;;;;OAIG;IACH,kBAHU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAGV;IAEnB;;;;OAIG;IACH,mBAHU,CAAC,EAAE,CAGA;IAEb;;;;OAIG;IACH,2BAHU,OAAO,CAGO;IAExB;;;;OAIG;IACH,+BAHU,MAAM,CAGgB;IAEhC,cAQC;IAED,gBAQC;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACL,OAAO,CAIlB;IAGD;;;;OAIG;IACH,QAHW,MAAM,GACJ,CAAC,GAAC,IAAI,CAalB;IAED;;;;;OAKG;IACH,gBAHW,CAAC,EAAE,OADH,QAAQ,QAkBlB;IAGD;;;;OAIG;IACH,kBAHW,CAAS,IAAC,EAAD,CAAC,QAAC,YACX,GAAC,QAYX;IAED;;;;;OAKG;IACH,UAJW,CAAS,IAAC,EAAD,CAAC,KAAE,OAAO,YACnB,GAAC,GACA,CAAC,EAAE,CAkBd;IAED;;;OAGG;IACH,WAFY,CAAC,EAAE,CAId;IAED;;;;OAIG;IACH,UAHW,CAAC,GACC,OAAO,CAenB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,CAAC,GAAC;QAAC,EAAE,EAAC,MAAM,CAAA;KAAC,CAIzB;IAED;;;;;OAKG;IACH,4BAHW,kBAAkB,
|
|
1
|
+
{"version":3,"file":"StaticKnowledgeDataTable.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDataTable.js"],"names":[],"mappings":"AAkCA;;;GAGG;AACH,sCAFa,CAAC;IAIV;;;OAGG;IACH,cAAc;IAEd;;;;OAIG;IACH,kBAHU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAGV;IAEnB;;;;OAIG;IACH,mBAHU,CAAC,EAAE,CAGA;IAEb;;;;OAIG;IACH,2BAHU,OAAO,CAGO;IAExB;;;;OAIG;IACH,+BAHU,MAAM,CAGgB;IAEhC,cAQC;IAED,gBAQC;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACL,OAAO,CAIlB;IAGD;;;;OAIG;IACH,QAHW,MAAM,GACJ,CAAC,GAAC,IAAI,CAalB;IAED;;;;;OAKG;IACH,gBAHW,CAAC,EAAE,OADH,QAAQ,QAkBlB;IAGD;;;;OAIG;IACH,kBAHW,CAAS,IAAC,EAAD,CAAC,QAAC,YACX,GAAC,QAYX;IAED;;;;;OAKG;IACH,UAJW,CAAS,IAAC,EAAD,CAAC,KAAE,OAAO,YACnB,GAAC,GACA,CAAC,EAAE,CAkBd;IAED;;;OAGG;IACH,WAFY,CAAC,EAAE,CAId;IAED;;;;OAIG;IACH,UAHW,CAAC,GACC,OAAO,CAenB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,CAAC,GAAC;QAAC,EAAE,EAAC,MAAM,CAAA;KAAC,CAIzB;IAED;;;;;OAKG;IACH,4BAHW,kBAAkB,gBA0F5B;IAED;;;;;;;OAOG;IACH,iBANW,CAAC,QACD,MAAM,YACN,uBAAuB,gBACvB,YAAY,gBAKtB;IAED;;;;;;OAMG;IACH,eALW,uBAAuB,gBACvB,YAAY,YACZ,kBAAkB,gBA0E5B;IAED;;;;;;OAMG;IACH,8CAJW,uBAAuB,uBAErB,OAAO,CAInB;IAED;;;;;OAKG;IACH,mBALW,uBAAuB,gCAGrB,IAAI,CA0DhB;IAIL;;;OAGG;IACH,qCAFU,OAAO,CAE4C;CAP5D;qBA3eoB,gCAAgC;iBACpC,oCAAoC"}
|
|
@@ -247,6 +247,8 @@ export class StaticKnowledgeDataTable {
|
|
|
247
247
|
|
|
248
248
|
if (typeof id !== "string") {
|
|
249
249
|
|
|
250
|
+
// TODO consider coercing to string for integer numbers
|
|
251
|
+
|
|
250
252
|
if (this.__automatic_ids) {
|
|
251
253
|
id = generate_id(this);
|
|
252
254
|
} else {
|
|
@@ -262,6 +264,7 @@ export class StaticKnowledgeDataTable {
|
|
|
262
264
|
console.warn(`${DATABASE_SERIALIZATION_IGNORE_PROPERTY} flag is present on ${this.__element_type_name} '${id}'. ${DATABASE_SERIALIZATION_IGNORE_PROPERTY} must be a boolean (true/false), instead was '${typeof flag_ignore}'(=${flag_ignore})`);
|
|
263
265
|
} else if (flag_ignore) {
|
|
264
266
|
console.warn(`[${this.__element_type_name}:${id}] ${DATABASE_SERIALIZATION_IGNORE_PROPERTY} flag is set to true, skipping`);
|
|
267
|
+
return;
|
|
265
268
|
} else {
|
|
266
269
|
console.warn(`[${this.__element_type_name}:${id}] ${DATABASE_SERIALIZATION_IGNORE_PROPERTY} flag is set to false and has no effect, please remove this field from JSON`);
|
|
267
270
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationManager.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ui/notification/NotificationManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationManager.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ui/notification/NotificationManager.js"],"names":[],"mappings":"AAqDA;IAEQ;;;OAGG;IACH,UAFU,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAEb;IAEzB;;;OAGG;IACH,UAFU,IAAI,CAAC,UAAU,CAAC,CAEA;IAE1B;;;;OAIG;IACH,oBAA4B;IAE5B;;;OAGG;IACH,KAFU,sBAAsB,GAAC,IAAI,CAEtB;IAGnB;;;OAGG;IACH,uBAFW,MAAM,QAchB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,eAAe,GAAC,SAAS,CAIrC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,UAAU,EAAE,CAMxB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,+CAmBhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,eACN,WAAW,2BAsFrB;IAED;;;;OAIG;IACH,8BAHW,YAAY,WACZ,MAAM,QAahB;IAED;;;OAGG;IACH,gBAFW,MAAM,QAchB;CACJ;4BApQ2B,iCAAiC;iBAP5C,uCAAuC;AAUxD;IACI;;;;;OAKG;IACH,kDAJW,eAAe,EAsBzB;IAZG,qBAA0C;IAE1C,uBAAuC;IAEvC,SAAc;IACd,iBAA8B;IAE9B;;;OAGG;IACH,WAFU,MAAM,CAEE;IAGtB;;;OAGG;IACH,kBAFW,MAAM,QAMhB;IAED,mBAEC;CACJ"}
|