@woosh/meep-engine 2.99.2 → 2.100.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/meep.cjs +556 -18
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +556 -18
- package/package.json +1 -1
- package/src/core/collection/list/List.d.ts.map +1 -1
- package/src/core/collection/list/List.js +3 -1
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +39 -8
- package/src/core/model/node-graph/DataType.d.ts.map +1 -1
- package/src/core/model/node-graph/DataType.js +3 -2
- package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstance.js +11 -12
- package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +5 -2
- package/src/core/model/node-graph/node/Port.d.ts.map +1 -1
- package/src/core/model/node-graph/node/Port.js +5 -0
- package/src/engine/animation/async/prototypeAsyncAnimation.d.ts +2 -0
- package/src/engine/animation/async/prototypeAsyncAnimation.d.ts.map +1 -0
- package/src/engine/animation/async/prototypeAsyncAnimation.js +344 -0
- package/src/engine/asset/AssetManager.d.ts.map +1 -1
- package/src/engine/asset/AssetManager.js +17 -0
- package/src/engine/ecs/Entity.d.ts.map +1 -1
- package/src/engine/ecs/Entity.js +1 -0
- package/src/engine/ecs/terrain/ecs/TerrainSystem.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/TerrainSystem.js +3 -3
- package/src/engine/input/ecs/systems/InputControllerSystem.d.ts.map +1 -1
- package/src/engine/input/ecs/systems/InputControllerSystem.js +4 -8
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts +46 -0
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts.map +1 -0
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.js +85 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"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"}
|
package/src/core/color/Color.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
2
|
import { float2uint8 } from "../binary/float2uint8.js";
|
|
3
|
+
import { uint82float } from "../binary/uint82float.js";
|
|
3
4
|
import Signal from "../events/signal/Signal.js";
|
|
4
5
|
import { clamp01 } from "../math/clamp01.js";
|
|
5
6
|
import { lerp } from "../math/lerp.js";
|
|
@@ -14,14 +15,15 @@ import { linear_to_sRGB } from "./sRGB/linear_to_sRGB.js";
|
|
|
14
15
|
import { sRGB_to_linear } from "./sRGB/sRGB_to_linear.js";
|
|
15
16
|
|
|
16
17
|
/**
|
|
18
|
+
* @extends {Array.<number>}
|
|
17
19
|
* @class
|
|
18
20
|
*/
|
|
19
21
|
export class Color {
|
|
20
22
|
/**
|
|
21
23
|
*
|
|
22
|
-
* @param {number} r
|
|
23
|
-
* @param {number} g
|
|
24
|
-
* @param {number} b
|
|
24
|
+
* @param {number} [r] Red from 0 to 1
|
|
25
|
+
* @param {number} [g] Green from 0 to 1
|
|
26
|
+
* @param {number} [b] Blue from 0 to 1
|
|
25
27
|
* @param {number} [a] value from 0 to 1 Alpha channel (transparency)
|
|
26
28
|
*/
|
|
27
29
|
constructor(r = 0, g = 0, b = 0, a = 1) {
|
|
@@ -141,6 +143,20 @@ export class Color {
|
|
|
141
143
|
this.set(r, g, b, this.a);
|
|
142
144
|
}
|
|
143
145
|
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
* @param {number} r
|
|
149
|
+
* @param {number} g
|
|
150
|
+
* @param {number} b
|
|
151
|
+
*/
|
|
152
|
+
setRGBUint8(r, g, b) {
|
|
153
|
+
this.setRGB(
|
|
154
|
+
uint82float(r),
|
|
155
|
+
uint82float(g),
|
|
156
|
+
uint82float(b),
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
|
|
144
160
|
/**
|
|
145
161
|
* set alpha
|
|
146
162
|
* @param {number} a
|
|
@@ -167,11 +183,28 @@ export class Color {
|
|
|
167
183
|
assert.notNaN(b, 'b');
|
|
168
184
|
assert.notNaN(a, 'a');
|
|
169
185
|
|
|
186
|
+
assert.isFiniteNumber(r, 'r');
|
|
187
|
+
assert.isFiniteNumber(g, 'g');
|
|
188
|
+
assert.isFiniteNumber(b, 'b');
|
|
189
|
+
assert.isFiniteNumber(a, 'a');
|
|
190
|
+
|
|
191
|
+
// remember old values
|
|
170
192
|
const _r = this.r;
|
|
171
193
|
const _g = this.g;
|
|
172
194
|
const _b = this.b;
|
|
173
195
|
const _a = this.a;
|
|
174
196
|
|
|
197
|
+
if (
|
|
198
|
+
_r === r
|
|
199
|
+
&& _g === g
|
|
200
|
+
&& _b === b
|
|
201
|
+
&& _a === a
|
|
202
|
+
) {
|
|
203
|
+
// no change
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// set new values
|
|
175
208
|
this.r = r;
|
|
176
209
|
this.g = g;
|
|
177
210
|
this.b = b;
|
|
@@ -414,7 +447,7 @@ export class Color {
|
|
|
414
447
|
const g = (value >> 8) & 0xFF;
|
|
415
448
|
const b = (value) & 0xFF;
|
|
416
449
|
|
|
417
|
-
this.
|
|
450
|
+
this.setRGBUint8(r, g, b);
|
|
418
451
|
}
|
|
419
452
|
|
|
420
453
|
/**
|
|
@@ -479,8 +512,7 @@ export class Color {
|
|
|
479
512
|
}
|
|
480
513
|
|
|
481
514
|
fromJSON({ r, g, b, a = 1 }) {
|
|
482
|
-
this.
|
|
483
|
-
this.a = a;
|
|
515
|
+
this.set(r, g, b, a);
|
|
484
516
|
}
|
|
485
517
|
|
|
486
518
|
toJSON() {
|
|
@@ -534,8 +566,7 @@ export class Color {
|
|
|
534
566
|
const b = buffer.readFloat32();
|
|
535
567
|
const a = buffer.readFloat32();
|
|
536
568
|
|
|
537
|
-
this.
|
|
538
|
-
this.a = a;
|
|
569
|
+
this.set(r, g, b, a);
|
|
539
570
|
}
|
|
540
571
|
|
|
541
572
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataType.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/DataType.js"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"DataType.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/DataType.js"],"names":[],"mappings":"AAEA;IAgDI;;;;OAIG;IACH,yBAFa,QAAQ,CAQpB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,QAAQ,CAYpB;IA3ED;;;OAGG;IACH,IAFU,MAAM,CAET;IAEP;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV,mBAEC;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAKnB;IAED,eAEC;IAED;;;aAMC;IAmCL;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAP5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {assert} from "../../assert.js";
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
2
|
|
|
3
3
|
export class DataType {
|
|
4
4
|
|
|
@@ -32,7 +32,8 @@ export class DataType {
|
|
|
32
32
|
* @returns {boolean}
|
|
33
33
|
*/
|
|
34
34
|
equals(other) {
|
|
35
|
-
return this.id === other.id
|
|
35
|
+
return this.id === other.id
|
|
36
|
+
&& this.name === other.name;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
toJSON() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstance.js"],"names":[],"mappings":"AAcA;;;;GAIG;AACH;IAEI;;;;OAIG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,6BAAmB;IAEnB;;;OAGG;IACH,WAFU,yBAAyB,EAAE,CAEtB;IAEf;;;OAGG;IACH,gBAAgB;IAEhB;;;OAGG;IACH,qBAAmB;IAEnB;;;OAGG;IACH,aAFU,gBAAgB,CAED;IAEzB;;;;;;OAMG;IACH,wBAFU,MAAM,CAEE;IAElB;;OAEG;IACH;QACI;;;WAGG;mCADO,OAAO,MAAM,WAAO;QAG9B;;;WAGG;iCADO,OAAO,MAAM,MAAI;QAG3B;;;WAGG;mCADO,OAAO,MAAM,MAAI;QAI3B;;;;WAIG;qCADO,yCAAyC,YAAY,CAAC;MAGlE;IAEF;;;;;;OAMG;IACH,yBALW,MAAM,aACN,aAAa,UACb,YAAY,GACV,MAAM,CAsBlB;IAED;;;OAGG;IACH,gDAEC;IAED;;;OAGG;IACH,+CAEC;IAGD;;;OAGG;IACH,mCAEC;IAED;;;;OAIG;IACH,kCAEC;IAED;;;;OAIG;IACH,mBAHW,MAAM,oBAKhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,OAKhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,KAOhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,oBAmChB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;IAED;;;OAGG;IACH,uCAQC;IAED,wBAIC;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"NodeInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstance.js"],"names":[],"mappings":"AAcA;;;;GAIG;AACH;IAEI;;;;OAIG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,6BAAmB;IAEnB;;;OAGG;IACH,WAFU,yBAAyB,EAAE,CAEtB;IAEf;;;OAGG;IACH,gBAAgB;IAEhB;;;OAGG;IACH,qBAAmB;IAEnB;;;OAGG;IACH,aAFU,gBAAgB,CAED;IAEzB;;;;;;OAMG;IACH,wBAFU,MAAM,CAEE;IAElB;;OAEG;IACH;QACI;;;WAGG;mCADO,OAAO,MAAM,WAAO;QAG9B;;;WAGG;iCADO,OAAO,MAAM,MAAI;QAG3B;;;WAGG;mCADO,OAAO,MAAM,MAAI;QAI3B;;;;WAIG;qCADO,yCAAyC,YAAY,CAAC;MAGlE;IAEF;;;;;;OAMG;IACH,yBALW,MAAM,aACN,aAAa,UACb,YAAY,GACV,MAAM,CAsBlB;IAED;;;OAGG;IACH,gDAEC;IAED;;;OAGG;IACH,+CAEC;IAGD;;;OAGG;IACH,mCAEC;IAED;;;;OAIG;IACH,kCAEC;IAED;;;;OAIG;IACH,mBAHW,MAAM,oBAKhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,OAKhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,KAOhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,oBAmChB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;IAED;;;OAGG;IACH,uCAQC;IAED,wBAIC;IAED;;;OAGG;IACH,mDA+BC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,yBAAyB,GAAC,SAAS,CAoB/C;IAED,eAEC;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAQnB;IAED,mBAEC;IAIL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;CAPpC;0CA1VyC,gCAAgC;iBAHzD,kCAAkC;mBAChC,kCAAkC;8BAGvB,oBAAoB"}
|
|
@@ -289,13 +289,7 @@ export class NodeInstance {
|
|
|
289
289
|
//generate endpoints
|
|
290
290
|
this.endpoints = description.getPorts()
|
|
291
291
|
.map((port, port_index) => {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
endpoint.id = port_index;
|
|
295
|
-
endpoint.port = port;
|
|
296
|
-
endpoint.instance = this;
|
|
297
|
-
|
|
298
|
-
return endpoint;
|
|
292
|
+
return NodeInstancePortReference.from(this, port);
|
|
299
293
|
});
|
|
300
294
|
|
|
301
295
|
//clear parameters
|
|
@@ -312,18 +306,23 @@ export class NodeInstance {
|
|
|
312
306
|
|
|
313
307
|
/**
|
|
314
308
|
*
|
|
315
|
-
* @param {number}
|
|
309
|
+
* @param {number} port_id Port ID
|
|
316
310
|
* @returns {NodeInstancePortReference|undefined}
|
|
317
311
|
*/
|
|
318
|
-
getEndpoint(
|
|
319
|
-
assert.isNonNegativeInteger(
|
|
312
|
+
getEndpoint(port_id) {
|
|
313
|
+
assert.isNonNegativeInteger(port_id, 'port');
|
|
320
314
|
|
|
321
315
|
const endpoints = this.endpoints;
|
|
316
|
+
const endpoint_count = endpoints.length;
|
|
322
317
|
|
|
323
|
-
for (
|
|
324
|
-
|
|
318
|
+
for (let i = 0; i < endpoint_count; i++) {
|
|
319
|
+
|
|
320
|
+
const endpoint = endpoints[i];
|
|
321
|
+
|
|
322
|
+
if (endpoint.port.id === port_id) {
|
|
325
323
|
return endpoint;
|
|
326
324
|
}
|
|
325
|
+
|
|
327
326
|
}
|
|
328
327
|
|
|
329
328
|
//not found
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeInstancePortReference.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstancePortReference.js"],"names":[],"mappings":"AASA;;GAEG;AACH;IAyEI;;;;;OAKG;IACH,iDAFa,yBAAyB,
|
|
1
|
+
{"version":3,"file":"NodeInstancePortReference.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstancePortReference.js"],"names":[],"mappings":"AASA;;GAEG;AACH;IAyEI;;;;;OAKG;IACH,iDAFa,yBAAyB,CAkBrC;IA7FD;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,gCAAgB;IAEhB;;;OAGG;IACH,oBAAY;IAEZ;;;;;OAKG;IACH,sBAFU,YAAY,CAEL;IAEjB;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,kCAEC;IAED;;;OAGG;IACH,kBAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,oCAHW,MAAM,GACJ,OAAO,CAenB;IA2BD;;;;OAIG;IACH,8CASC;IAED,eAKC;IAED;;;;OAIG;IACH,cAHW,yBAAyB,GACvB,OAAO,CAMnB;IAED,mBAEC;IAGL;;;OAGG;IACH,sCAFU,OAAO,CAE8C;CAN9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {assert} from "../../../assert.js";
|
|
2
|
-
import {computeHashIntegerArray} from "../../../collection/array/computeHashIntegerArray.js";
|
|
1
|
+
import { assert } from "../../../assert.js";
|
|
2
|
+
import { computeHashIntegerArray } from "../../../collection/array/computeHashIntegerArray.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
@@ -92,12 +92,15 @@ export class NodeInstancePortReference {
|
|
|
92
92
|
static from(instance, port) {
|
|
93
93
|
assert.defined(instance, 'instance');
|
|
94
94
|
assert.notNull(instance, 'instance');
|
|
95
|
+
assert.equal(instance.isNodeInstance, true, 'instance.isNodeInstance !== true');
|
|
95
96
|
|
|
96
97
|
assert.defined(port, 'port');
|
|
97
98
|
assert.notNull(port, 'port');
|
|
99
|
+
assert.equal(port.isPort, true, 'port.isPort !== true');
|
|
98
100
|
|
|
99
101
|
const r = new NodeInstancePortReference();
|
|
100
102
|
|
|
103
|
+
r.id = port.id;
|
|
101
104
|
r.instance = instance;
|
|
102
105
|
r.port = port;
|
|
103
106
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Port.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/Port.js"],"names":[],"mappings":"AAYA;
|
|
1
|
+
{"version":3,"file":"Port.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/Port.js"],"names":[],"mappings":"AAYA;IAwHI;;;;;OAKG;IACH,iDAFa,IAAI,CAQhB;IAnID;;;OAGG;IACH,aAAU;IAEV;;;OAGG;IACH,IAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,WAFU,aAAa,GAAC,MAAM,CAEQ;IAEtC;;;OAGG;IACH,UAFU,QAAQ,CAEF;IAEhB;;;OAGG;IACH,UAFU,MAAM,CAEF;IAEd,eAWC;IAED;;;;OAIG;IACH,cAHW,IAAI,GACF,OAAO,CAenB;IAED,mBAEC;IAED;;;;;MAOC;IAED;;;;;;;OAOG;IACH,4CANW,MAAM,iCAuChB;IAiBL;;;OAGG;IACH,iBAFU,OAAO,CAEI;CANpB;8BA5I6B,oBAAoB;yBADzB,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prototypeAsyncAnimation.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/async/prototypeAsyncAnimation.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { GUI } from "dat.gui";
|
|
2
|
+
import { MeshBasicMaterial, MeshStandardMaterial, OctahedronBufferGeometry } from "three";
|
|
3
|
+
import { BinaryDataType } from "../../../core/binary/type/BinaryDataType.js";
|
|
4
|
+
import { RowFirstTable } from "../../../core/collection/table/RowFirstTable.js";
|
|
5
|
+
import { RowFirstTableSpec } from "../../../core/collection/table/RowFirstTableSpec.js";
|
|
6
|
+
import { Color } from "../../../core/color/Color.js";
|
|
7
|
+
import { inverseLerp } from "../../../core/math/inverseLerp.js";
|
|
8
|
+
import { lerp } from "../../../core/math/lerp.js";
|
|
9
|
+
import { max2 } from "../../../core/math/max2.js";
|
|
10
|
+
import { min2 } from "../../../core/math/min2.js";
|
|
11
|
+
import { randomFloatBetween } from "../../../core/math/random/randomFloatBetween.js";
|
|
12
|
+
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
13
|
+
import Clock from "../../Clock.js";
|
|
14
|
+
import Entity from "../../ecs/Entity.js";
|
|
15
|
+
import { Transform } from "../../ecs/transform/Transform.js";
|
|
16
|
+
import { EngineHarness } from "../../EngineHarness.js";
|
|
17
|
+
import { ShadedGeometry } from "../../graphics/ecs/mesh-v2/ShadedGeometry.js";
|
|
18
|
+
import { ShadedGeometrySystem } from "../../graphics/ecs/mesh-v2/ShadedGeometrySystem.js";
|
|
19
|
+
import Trail2D from "../../graphics/ecs/trail2d/Trail2D.js";
|
|
20
|
+
import Trail2DSystem from "../../graphics/ecs/trail2d/Trail2DSystem.js";
|
|
21
|
+
import {
|
|
22
|
+
RGBA_LUT_HEATMAP_IR
|
|
23
|
+
} from "../../graphics/particles/particular/engine/parameter/sample/RGBA_LUT_HEATMAP_IR.js";
|
|
24
|
+
import { SequenceBehavior } from "../../intelligence/behavior/composite/SequenceBehavior.js";
|
|
25
|
+
import { RepeatBehavior } from "../../intelligence/behavior/decorator/RepeatBehavior.js";
|
|
26
|
+
import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
27
|
+
import { BehaviorSystem } from "../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
28
|
+
import { ActionBehavior } from "../../intelligence/behavior/primitive/ActionBehavior.js";
|
|
29
|
+
import { RandomDelayBehavior } from "../../intelligence/behavior/util/RandomDelayBehavior.js";
|
|
30
|
+
|
|
31
|
+
const harness = new EngineHarness();
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {RowFirstTable} table
|
|
36
|
+
* @param {number} time
|
|
37
|
+
* @return {number}
|
|
38
|
+
*/
|
|
39
|
+
function findSampleIndex(table, time) {
|
|
40
|
+
let minIndex = 0;
|
|
41
|
+
let maxIndex = table.length - 1;
|
|
42
|
+
|
|
43
|
+
while (minIndex <= maxIndex) {
|
|
44
|
+
|
|
45
|
+
const pivotIndex = (minIndex + maxIndex) >> 1;
|
|
46
|
+
|
|
47
|
+
const cmp = time - table.readCellValue(pivotIndex, 0);
|
|
48
|
+
|
|
49
|
+
if (cmp > 0) {
|
|
50
|
+
minIndex = pivotIndex + 1;
|
|
51
|
+
} else if (cmp < 0) {
|
|
52
|
+
maxIndex = pivotIndex - 1;
|
|
53
|
+
} else {
|
|
54
|
+
//set low boundary for next step based on assumption that upper bound is higher than lower bound
|
|
55
|
+
return pivotIndex;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return min2(minIndex, maxIndex);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param {EntityComponentDataset} ecd
|
|
65
|
+
* @param {RowFirstTable} table
|
|
66
|
+
* @param {number} [count]
|
|
67
|
+
*/
|
|
68
|
+
function makeGhostMarkers({
|
|
69
|
+
ecd,
|
|
70
|
+
table,
|
|
71
|
+
count = 5
|
|
72
|
+
}) {
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
const g = new OctahedronBufferGeometry(1, 3);
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @type {Entity[]}
|
|
80
|
+
*/
|
|
81
|
+
const entities = [];
|
|
82
|
+
|
|
83
|
+
for (let i = 0; i < count; i++) {
|
|
84
|
+
|
|
85
|
+
const color = new Color();
|
|
86
|
+
|
|
87
|
+
const sample = [];
|
|
88
|
+
|
|
89
|
+
RGBA_LUT_HEATMAP_IR.sample(i / (count - 1), sample);
|
|
90
|
+
|
|
91
|
+
color.setRGBUint8(...sample);
|
|
92
|
+
|
|
93
|
+
const transform = new Transform();
|
|
94
|
+
|
|
95
|
+
const entity = new Entity();
|
|
96
|
+
|
|
97
|
+
entities.push(entity);
|
|
98
|
+
|
|
99
|
+
entity
|
|
100
|
+
.add(transform)
|
|
101
|
+
.add(ShadedGeometry.from(g, new MeshBasicMaterial({
|
|
102
|
+
wireframe: true,
|
|
103
|
+
color: color.toUint()
|
|
104
|
+
})))
|
|
105
|
+
.build(ecd);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
set time(time) {
|
|
110
|
+
|
|
111
|
+
const ref_index = findSampleIndex(table, time);
|
|
112
|
+
|
|
113
|
+
const start_index = max2(0, ref_index - Math.floor(count / 2));
|
|
114
|
+
const limit_index = min2(table.length - 1, ref_index + Math.ceil(count / 2));
|
|
115
|
+
|
|
116
|
+
for (let i = 0; i < count; i++) {
|
|
117
|
+
|
|
118
|
+
const entity = entities[i];
|
|
119
|
+
|
|
120
|
+
const sample_index = ref_index - Math.floor(count / 2) + i;
|
|
121
|
+
|
|
122
|
+
const out_of_bound_marker = sample_index < start_index || sample_index > limit_index;
|
|
123
|
+
|
|
124
|
+
if (out_of_bound_marker) {
|
|
125
|
+
if (entity.isBuilt) {
|
|
126
|
+
entity.destroy();
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
if (!entity.isBuilt) {
|
|
130
|
+
entity.build(ecd);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (out_of_bound_marker) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const transform = entity.getComponentSafe(Transform);
|
|
139
|
+
|
|
140
|
+
transform.position.set(
|
|
141
|
+
table.readCellValue(sample_index, 1),
|
|
142
|
+
table.readCellValue(sample_index, 2),
|
|
143
|
+
table.readCellValue(sample_index, 3)
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* @param {Engine} engine
|
|
154
|
+
* @return {Promise<void>}
|
|
155
|
+
*/
|
|
156
|
+
async function main(engine) {
|
|
157
|
+
await EngineHarness.buildBasics({
|
|
158
|
+
engine
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const table = new RowFirstTable(
|
|
162
|
+
RowFirstTableSpec.get([
|
|
163
|
+
BinaryDataType.Float64, // time
|
|
164
|
+
BinaryDataType.Float32, // x
|
|
165
|
+
BinaryDataType.Float32, //y
|
|
166
|
+
BinaryDataType.Float32 //z
|
|
167
|
+
])
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
const random = seededRandom(42);
|
|
171
|
+
|
|
172
|
+
table.addRow([
|
|
173
|
+
0, 0, 1, 0
|
|
174
|
+
]);
|
|
175
|
+
|
|
176
|
+
const sample = [];
|
|
177
|
+
|
|
178
|
+
const sim_clock = new Clock();
|
|
179
|
+
sim_clock.start();
|
|
180
|
+
|
|
181
|
+
function addSample() {
|
|
182
|
+
|
|
183
|
+
const time_delta = sim_clock.getDelta();
|
|
184
|
+
|
|
185
|
+
// get last row
|
|
186
|
+
const row_count = table.length;
|
|
187
|
+
|
|
188
|
+
table.getRow(row_count - 1, sample);
|
|
189
|
+
|
|
190
|
+
const speed = 7;
|
|
191
|
+
|
|
192
|
+
const displacement = speed * time_delta;
|
|
193
|
+
|
|
194
|
+
const direction = randomFloatBetween(random, -Math.PI, Math.PI);
|
|
195
|
+
|
|
196
|
+
const displacement_x = displacement * Math.cos(direction);
|
|
197
|
+
const displacement_y = displacement * Math.sin(direction);
|
|
198
|
+
|
|
199
|
+
const new_x = sample[1] + displacement_x;
|
|
200
|
+
const new_z = sample[3] + displacement_y;
|
|
201
|
+
|
|
202
|
+
table.addRow([
|
|
203
|
+
sample[0] + time_delta,
|
|
204
|
+
new_x,
|
|
205
|
+
1,
|
|
206
|
+
new_z,
|
|
207
|
+
|
|
208
|
+
]);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
const ecd = engine.entityManager.dataset;
|
|
213
|
+
|
|
214
|
+
// simulate data arriving from the network
|
|
215
|
+
const sample_delay = RandomDelayBehavior.from(0.5, 1);
|
|
216
|
+
new Entity()
|
|
217
|
+
.add(BehaviorComponent.fromOne(RepeatBehavior.from(
|
|
218
|
+
SequenceBehavior.from([
|
|
219
|
+
sample_delay,
|
|
220
|
+
new ActionBehavior(addSample)
|
|
221
|
+
])
|
|
222
|
+
)))
|
|
223
|
+
.build(ecd);
|
|
224
|
+
|
|
225
|
+
const sim_parameters = {
|
|
226
|
+
playing: true,
|
|
227
|
+
play_time: -1,
|
|
228
|
+
get latest_data_time() {
|
|
229
|
+
return table.readCellValue(table.length - 1, 0);
|
|
230
|
+
},
|
|
231
|
+
get behind_latest() {
|
|
232
|
+
return table.readCellValue(table.length - 1, 0) - this.play_time;
|
|
233
|
+
},
|
|
234
|
+
set behind_latest(v) {
|
|
235
|
+
|
|
236
|
+
const current_delay = table.readCellValue(table.length - 1, 0) - this.play_time;
|
|
237
|
+
|
|
238
|
+
const delta = v - current_delay;
|
|
239
|
+
|
|
240
|
+
this.play_time += delta;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
// simulate agent moving through space
|
|
246
|
+
const subject = new Entity();
|
|
247
|
+
|
|
248
|
+
subject
|
|
249
|
+
.add(Transform.fromJSON({
|
|
250
|
+
position: 0
|
|
251
|
+
}))
|
|
252
|
+
.add(Trail2D.fromJSON({
|
|
253
|
+
textureURL: "data/textures/trail/Circle_04.png",
|
|
254
|
+
width: 0.2
|
|
255
|
+
}))
|
|
256
|
+
.add(ShadedGeometry.from(new OctahedronBufferGeometry(1, 5), new MeshStandardMaterial()))
|
|
257
|
+
.add(BehaviorComponent.fromOne(RepeatBehavior.from(
|
|
258
|
+
new ActionBehavior((delta) => {
|
|
259
|
+
if (sim_parameters.playing) {
|
|
260
|
+
sim_parameters.play_time += delta;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
// seek to the right sample
|
|
265
|
+
const sample_index = max2(0, findSampleIndex(table, sim_parameters.play_time));
|
|
266
|
+
const next_sample_index = min2(table.length - 1, sample_index + 1);
|
|
267
|
+
|
|
268
|
+
const prev = table.readCellValue(sample_index, 0);
|
|
269
|
+
const next = table.readCellValue(next_sample_index, 0);
|
|
270
|
+
|
|
271
|
+
const normalized_offset = inverseLerp(prev, next, sim_parameters.play_time);
|
|
272
|
+
|
|
273
|
+
const transform = subject.getComponentSafe(Transform);
|
|
274
|
+
|
|
275
|
+
const x0 = table.readCellValue(sample_index, 1);
|
|
276
|
+
const x1 = table.readCellValue(next_sample_index, 1);
|
|
277
|
+
|
|
278
|
+
const y0 = table.readCellValue(sample_index, 2);
|
|
279
|
+
const y1 = table.readCellValue(next_sample_index, 2);
|
|
280
|
+
|
|
281
|
+
const z0 = table.readCellValue(sample_index, 3);
|
|
282
|
+
const z1 = table.readCellValue(next_sample_index, 3);
|
|
283
|
+
|
|
284
|
+
transform.position.set(
|
|
285
|
+
lerp(x0, x1, normalized_offset),
|
|
286
|
+
lerp(y0, y1, normalized_offset),
|
|
287
|
+
lerp(z0, z1, normalized_offset),
|
|
288
|
+
);
|
|
289
|
+
})
|
|
290
|
+
)))
|
|
291
|
+
.build(ecd);
|
|
292
|
+
|
|
293
|
+
const markers = makeGhostMarkers({
|
|
294
|
+
ecd, table, count: 5
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
engine.ticker.onTick.add(() => markers.time = sim_parameters.play_time);
|
|
298
|
+
|
|
299
|
+
const gui = new GUI();
|
|
300
|
+
|
|
301
|
+
const gui_samples = gui.addFolder("samples");
|
|
302
|
+
gui_samples.add(sample_delay.limits, 'min').name("min_delay").step(0.01)
|
|
303
|
+
gui_samples.add(sample_delay.limits, 'max').name("max_delay").step(0.01)
|
|
304
|
+
|
|
305
|
+
for (const k in sim_parameters) {
|
|
306
|
+
|
|
307
|
+
const control = gui.add(sim_parameters, k);
|
|
308
|
+
|
|
309
|
+
if (typeof sim_parameters[k] === "number") {
|
|
310
|
+
control.step(0.01);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
let last_value = sim_parameters[k];
|
|
314
|
+
|
|
315
|
+
engine.ticker.onTick.add(() => {
|
|
316
|
+
let should_update = true;
|
|
317
|
+
|
|
318
|
+
const current_value = sim_parameters[k];
|
|
319
|
+
if (last_value === current_value) {
|
|
320
|
+
should_update = false;
|
|
321
|
+
} else {
|
|
322
|
+
last_value = current_value;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
if (should_update) {
|
|
327
|
+
control.updateDisplay();
|
|
328
|
+
}
|
|
329
|
+
})
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
gui.open();
|
|
333
|
+
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
harness.initialize({
|
|
337
|
+
configuration(config, engine) {
|
|
338
|
+
config.addManySystems(
|
|
339
|
+
new BehaviorSystem(engine),
|
|
340
|
+
new ShadedGeometrySystem(engine),
|
|
341
|
+
new Trail2DSystem(engine)
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
}).then(main);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/asset/AssetManager.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH;IAgII;;;;;OAKG;IACH,oCAJW,GAAG,EAYb;IA7ID;;;;OAIG;IACH,eAEG;IAEH;;;OAGG;IACH,aAFU,YAAY,gBAAgB,EAAE,YAAY,CAAC,CAER;IAe7C;;;;;;OAMG;IACH,kBAFU,MAAM,CAEY;IAyB5B;;;;OAIG;IACH,iBAAc;IAEd;;;OAGG;IACH,mBAFU,iBAAiB,CAEiB;IAwE5C,gBAQC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,QAAQ,IAAI,CAAC,CAexB;IAED;;;;;OAKG;IACH,oCAFa,OAAO,CAOnB;IAED;;OAEG;IACH,cAEC;IAED,8BAEC;IAED;;;;;;OAMG;IACH,4DAJW,iBAAiB,GAEf,cAAc,CAY1B;IAED;;;;;;;;;OASG;IACH,qFAsCC;IAED;;;;;OAKG;IACH,aAJW,MAAM,QACN,MAAM,sBAehB;IAsQD;;;;;OAKG;IACH,sBA2BC;IAGD;;;;OAIG;IACH,uBAHW,MAAM,GACL,OAAO,CAIlB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,wBAAY,SAAS,CAMjC;IAaD;;;;OAIG;IACH,+BAHW,MAAM,4CAqBhB;IAED;;;;OAIG;IACH,iCAHW,MAAM,+CAyBhB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,iEAwChB;IAED;;;OAGG;IACH,uBAFW,MAAM,iBAkBhB;IAED;;;;;;OAMG;IACH,yCAFa,aAAS,IAAI,CAYzB;IAED;;;;;OAKG;IACH,eAJW,MAAM,QACN,MAAM,GACJ,OAAO,CAMnB;IAED;;;;OAIG;IACH,2BAHW,MAAM,GACL,mBAAiB,CAa5B;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACL,gBAAgB,GAAC,SAAS,CAQrC;IAED;;;;;OAKG;IACH,mBAJW,MAAM,QACN,MAAM,QACN,MAAM,QAUhB;IAGL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;;CANpC;
|
|
1
|
+
{"version":3,"file":"AssetManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/asset/AssetManager.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH;IAgII;;;;;OAKG;IACH,oCAJW,GAAG,EAYb;IA7ID;;;;OAIG;IACH,eAEG;IAEH;;;OAGG;IACH,aAFU,YAAY,gBAAgB,EAAE,YAAY,CAAC,CAER;IAe7C;;;;;;OAMG;IACH,kBAFU,MAAM,CAEY;IAyB5B;;;;OAIG;IACH,iBAAc;IAEd;;;OAGG;IACH,mBAFU,iBAAiB,CAEiB;IAwE5C,gBAQC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,QAAQ,IAAI,CAAC,CAexB;IAED;;;;;OAKG;IACH,oCAFa,OAAO,CAOnB;IAED;;OAEG;IACH,cAEC;IAED,8BAEC;IAED;;;;;;OAMG;IACH,4DAJW,iBAAiB,GAEf,cAAc,CAY1B;IAED;;;;;;;;;OASG;IACH,qFAsCC;IAED;;;;;OAKG;IACH,aAJW,MAAM,QACN,MAAM,sBAehB;IAsQD;;;;;OAKG;IACH,sBA2BC;IAGD;;;;OAIG;IACH,uBAHW,MAAM,GACL,OAAO,CAIlB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,wBAAY,SAAS,CAMjC;IAaD;;;;OAIG;IACH,+BAHW,MAAM,4CAqBhB;IAED;;;;OAIG;IACH,iCAHW,MAAM,+CAyBhB;IAED;;;;;;OAMG;IACH,6BAJW,MAAM,kCAEJ,QAAQ,OAAO,CAAC,CAU5B;IAED;;;;;OAKG;IACH,0BAJW,MAAM,iEAwChB;IAED;;;OAGG;IACH,uBAFW,MAAM,iBAkBhB;IAED;;;;;;OAMG;IACH,yCAFa,aAAS,IAAI,CAYzB;IAED;;;;;OAKG;IACH,eAJW,MAAM,QACN,MAAM,GACJ,OAAO,CAMnB;IAED;;;;OAIG;IACH,2BAHW,MAAM,GACL,mBAAiB,CAa5B;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACL,gBAAgB,GAAC,SAAS,CAQrC;IAED;;;;;OAKG;IACH,mBAJW,MAAM,QACN,MAAM,QACN,MAAM,QAUhB;IAGL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;;CANpC;4BAx2B2B,0CAA0C;iCAOrC,uBAAuB;6BAM3B,mBAAmB;kCAFd,6BAA6B;kCAD7B,wBAAwB;4BAE9B,0BAA0B"}
|
|
@@ -720,6 +720,23 @@ export class AssetManager {
|
|
|
720
720
|
return true;
|
|
721
721
|
}
|
|
722
722
|
|
|
723
|
+
/**
|
|
724
|
+
* Will register loader only if none exists for this type
|
|
725
|
+
* @template T
|
|
726
|
+
* @param {string} type
|
|
727
|
+
* @param {AssetLoader<T>} loader
|
|
728
|
+
* @returns {Promise<boolean>} true if registered , false otherwise
|
|
729
|
+
*/
|
|
730
|
+
async tryRegisterLoader(type, loader) {
|
|
731
|
+
if (this.hasLoaderForType(type)) {
|
|
732
|
+
return false;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
await this.registerLoader(type, loader);
|
|
736
|
+
|
|
737
|
+
return true;
|
|
738
|
+
}
|
|
739
|
+
|
|
723
740
|
/**
|
|
724
741
|
* @template T
|
|
725
742
|
* @param {string} type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAeA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAeA;;;GAGG;AACH;IAoYI;;;;;OAKG;IACH,+BAJW,MAAM,oCAEJ,MAAM,CAelB;IArZD;;;OAGG;IACH,IAFU,MAAM,CAER;IAER;;;;OAIG;IACH,YAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,2BAAgB;IAQhB;;;OAGG;IACH,gCAAe;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,uBAEC;IAED;;OAEG;IACH,4BAQC;IAED;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,8BAFa,MAAM,CAiBlB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,0CAYC;IAED;;;;;OAKG;IACH,8CAQC;IAED;;;;OAIG;IACH,kCAFa,MAAE,IAAI,CA0BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,qBAShB;IAED;;;OAGG;IACH,wBAFW,MAAM,gBAiBhB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,sCAGJ,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BALW,MAAM,sCAGJ,MAAM,CAyBlB;IAED;;;OAGG;IACH,WAFa,OAAO,CAwBnB;IAED;;;;OAIG;IACH,+CAqDC;IAwBL;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;4BAxa2B,kBAAkB;mBAF3B,oCAAoC"}
|
package/src/engine/ecs/Entity.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/ecs/TerrainSystem.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TerrainSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/ecs/TerrainSystem.js"],"names":[],"mappings":";AA+BA;IA2MI;;;;;OAKG;IACH,kEAHW,OAAO,uBAwCjB;IA7ND;;;;;OAKG;IACH,kEAeC;IA7CD,iCAAyB;IAEzB,mBAAe;IACf,mBAAe;IAEf;;;;OAIG;IACH,qBAAiB;IAEjB;;;OAGG;IACH,aAFU,cAAY,IAAI,CAEP;IAEnB;;;OAGG;IACH,KAFU,GAAG,CAEG;IAoBZ,yBAAwB;IAExB,2BAAgC;IAGpC,kDAMC;IAED,mFAyDC;IAED,2EAIC;IAED;;;;OAIG;IACH,gBAHW,OAAO,qBAqBjB;IAED;;;;OAIG;IACH,kBAHW,OAAO,qBAKjB;IAED,6BAaC;IAED;;;;;OAKG;IACH,gCAwBC;CA+CJ;uBA1QsB,iBAAiB;oBAEpB,cAAc;oBAbd,mCAAmC"}
|
|
@@ -8,6 +8,7 @@ import { noop } from "../../../../core/function/noop.js";
|
|
|
8
8
|
import { read_three_planes_to_array } from "../../../../core/geom/3d/frustum/read_three_planes_to_array.js";
|
|
9
9
|
import { MATRIX_4_IDENTITY } from "../../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
|
|
10
10
|
import { ImageRGBADataLoader } from "../../../asset/loaders/image/ImageRGBADataLoader.js";
|
|
11
|
+
import { TextureAssetLoader } from "../../../asset/loaders/texture/TextureAssetLoader.js";
|
|
11
12
|
import { CameraSystem } from '../../../graphics/ecs/camera/CameraSystem.js';
|
|
12
13
|
import { System } from '../../System.js';
|
|
13
14
|
import { Transform } from "../../transform/Transform.js";
|
|
@@ -137,9 +138,8 @@ class TerrainSystem extends System {
|
|
|
137
138
|
|
|
138
139
|
const am = this.assetManager;
|
|
139
140
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
141
|
+
await am.tryRegisterLoader('image', new ImageRGBADataLoader());
|
|
142
|
+
await am.tryRegisterLoader('texture', new TextureAssetLoader());
|
|
143
143
|
|
|
144
144
|
readyCallback();
|
|
145
145
|
}
|