@woosh/meep-engine 2.119.80 → 2.119.82
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/bundle-worker-image-decoder.js +1 -1
- package/editor/Editor.d.ts.map +1 -1
- package/editor/SelectionVisualizer.d.ts +0 -6
- package/editor/SelectionVisualizer.d.ts.map +1 -1
- package/editor/actions/concrete/ComponentAddAction.d.ts +0 -3
- package/editor/actions/concrete/ComponentAddAction.d.ts.map +1 -1
- package/editor/actions/concrete/ComponentRemoveAction.d.ts +0 -4
- package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +1 -1
- package/editor/actions/concrete/EntityCreateAction.d.ts +0 -3
- package/editor/actions/concrete/EntityCreateAction.d.ts.map +1 -1
- package/editor/actions/concrete/EntityRemoveAction.d.ts.map +1 -1
- package/editor/actions/concrete/SelectionAddAction.d.ts.map +1 -1
- package/editor/actions/concrete/SelectionClearAction.d.ts +0 -3
- package/editor/actions/concrete/SelectionClearAction.d.ts.map +1 -1
- package/editor/actions/concrete/SelectionRemoveAction.d.ts +0 -3
- package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +1 -1
- package/editor/ecs/EditorEntity.d.ts +0 -7
- package/editor/ecs/EditorEntity.d.ts.map +1 -1
- package/editor/ecs/component/createObjectEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ImagePathEditor.d.ts +7 -0
- package/editor/ecs/component/editors/ImagePathEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/LargeStringEditor.d.ts +16 -0
- package/editor/ecs/component/editors/LargeStringEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/Sampler2DEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/common/EnumEditor.d.ts +8 -0
- package/editor/ecs/component/editors/common/EnumEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/GridObstacleEditor.d.ts +7 -0
- package/editor/ecs/component/editors/ecs/GridObstacleEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/MinimapMarkerEditor.d.ts +14 -0
- package/editor/ecs/component/editors/ecs/MinimapMarkerEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts +67 -0
- package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts +12 -0
- package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.d.ts +52 -0
- package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts +48 -0
- package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.d.ts +16 -0
- package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/Trail2DEditor.d.ts +30 -0
- package/editor/ecs/component/editors/ecs/Trail2DEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/TransformEditor.d.ts +20 -0
- package/editor/ecs/component/editors/ecs/TransformEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/terrain/SplatMappingEditor.d.ts +19 -0
- package/editor/ecs/component/editors/ecs/terrain/SplatMappingEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainEditor.d.ts +39 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainLayerEditor.d.ts +16 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainLayerEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainLayersEditor.d.ts +19 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainLayersEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainOverlayEditor.d.ts +18 -0
- package/editor/ecs/component/editors/ecs/terrain/TerrainOverlayEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/three/BufferGeometryEditor.d.ts +7 -0
- package/editor/ecs/component/editors/three/BufferGeometryEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/three/MaterialEditor.d.ts +7 -0
- package/editor/ecs/component/editors/three/MaterialEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/three/MeshEditor.d.ts +7 -0
- package/editor/ecs/component/editors/three/MeshEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/three/TextureEditor.d.ts +7 -0
- package/editor/ecs/component/editors/three/TextureEditor.d.ts.map +1 -0
- package/editor/process/DisableGameUIProcess.d.ts +8 -0
- package/editor/process/DisableGameUIProcess.d.ts.map +1 -0
- package/editor/process/ObstacleGridDisplayProcess.d.ts +13 -0
- package/editor/process/ObstacleGridDisplayProcess.d.ts.map +1 -0
- package/editor/process/SymbolicDisplayProcess.d.ts +19 -0
- package/editor/process/SymbolicDisplayProcess.d.ts.map +1 -0
- package/editor/process/symbolic/ComponentSymbolicDisplay.d.ts +11 -0
- package/editor/process/symbolic/ComponentSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/SymbolicDisplayInternalAPI.d.ts +65 -0
- package/editor/process/symbolic/SymbolicDisplayInternalAPI.d.ts.map +1 -0
- package/editor/process/symbolic/buildThreeJSHelperEntity.d.ts +9 -0
- package/editor/process/symbolic/buildThreeJSHelperEntity.d.ts.map +1 -0
- package/editor/process/symbolic/make3DSymbolicDisplay.d.ts +10 -0
- package/editor/process/symbolic/make3DSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/makeCameraSymbolicDisplay.d.ts +7 -0
- package/editor/process/symbolic/makeCameraSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts +6 -0
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/makeLightSymbolicDisplay.d.ts +7 -0
- package/editor/process/symbolic/makeLightSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/makeParticleEmitterSymbolicDisplay.d.ts +6 -0
- package/editor/process/symbolic/makeParticleEmitterSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/makePathSymbolicDisplay.d.ts +7 -0
- package/editor/process/symbolic/makePathSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/makePositionedIconDisplaySymbol.d.ts +9 -0
- package/editor/process/symbolic/makePositionedIconDisplaySymbol.d.ts.map +1 -0
- package/editor/process/symbolic/makeSocketsSymbolicDisplay.d.ts +7 -0
- package/editor/process/symbolic/makeSocketsSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/makeSoundEmitterSymbolicDisplay.d.ts +6 -0
- package/editor/process/symbolic/makeSoundEmitterSymbolicDisplay.d.ts.map +1 -0
- package/editor/process/symbolic/synchronizeTransform.d.ts +12 -0
- package/editor/process/symbolic/synchronizeTransform.d.ts.map +1 -0
- package/editor/tools/GridPaintTool.d.ts.map +1 -1
- package/editor/tools/SelectionTool.d.ts +27 -0
- package/editor/tools/SelectionTool.d.ts.map +1 -1
- package/editor/tools/TopDownCameraControlTool.d.ts.map +1 -1
- package/editor/tools/engine/Tool.d.ts +1 -1
- package/editor/tools/engine/Tool.d.ts.map +1 -1
- package/editor/tools/engine/ToolEngine.d.ts +1 -8
- package/editor/tools/engine/ToolEngine.d.ts.map +1 -1
- package/editor/tools/paint/TerrainHeightPaintTool.d.ts.map +1 -1
- package/editor/tools/paint/TerrainPaintTool.d.ts.map +1 -1
- package/editor/tools/paint/TerrainTexturePaintTool.d.ts.map +1 -1
- package/editor/view/EditorView.d.ts.map +1 -1
- package/editor/view/ecs/ComponentControlFactory.d.ts +0 -5
- package/editor/view/ecs/ComponentControlFactory.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.d.ts +2 -3
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
- package/editor/view/ecs/EntityList.d.ts.map +1 -1
- package/editor/view/ecs/components/GridObstacleController.d.ts +14 -0
- package/editor/view/ecs/components/GridObstacleController.d.ts.map +1 -0
- package/editor/view/tools/ToolView.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts +19 -0
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +31 -0
- package/src/core/binary/half_to_float_uint16.d.ts +9 -0
- package/src/core/binary/half_to_float_uint16.d.ts.map +1 -0
- package/src/core/binary/half_to_float_uint16.js +50 -0
- package/src/core/events/signal/Signal.d.ts.map +1 -1
- package/src/core/events/signal/Signal.js +99 -105
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +17 -0
- package/src/core/localization/Localization.d.ts.map +1 -1
- package/src/core/localization/Localization.js +3 -1
- package/src/engine/ecs/Entity.d.ts.map +1 -1
- package/src/engine/ecs/Entity.js +45 -15
- package/src/engine/ecs/EntityReference.d.ts +33 -0
- package/src/engine/ecs/EntityReference.d.ts.map +1 -1
- package/src/engine/ecs/EntityReference.js +59 -4
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.js +14 -8
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundTrack.js +8 -4
- package/src/view/minimap/gl/MinimapTerrainGL.d.ts.map +1 -1
- package/src/view/minimap/gl/MinimapTerrainGL.js +8 -4
|
@@ -314,23 +314,24 @@ export class Signal {
|
|
|
314
314
|
|
|
315
315
|
do {
|
|
316
316
|
|
|
317
|
-
if (_h.generation >= this.generation) {
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
317
|
const next = _h.next;
|
|
322
318
|
|
|
323
|
-
if
|
|
324
|
-
//handler
|
|
325
|
-
|
|
326
|
-
|
|
319
|
+
if(_h.generation < this.generation) {
|
|
320
|
+
// only process if handler was attached before this dispatch
|
|
321
|
+
|
|
322
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
323
|
+
//handler should be cut
|
|
324
|
+
this.#remove_handler_internal(_h);
|
|
325
|
+
}
|
|
327
326
|
|
|
328
|
-
|
|
327
|
+
const _f = _h.handle;
|
|
328
|
+
|
|
329
|
+
try {
|
|
330
|
+
_f.apply(_h.context, args)
|
|
331
|
+
} catch (e) {
|
|
332
|
+
console.error("Failed to dispatch handler", _f, e);
|
|
333
|
+
}
|
|
329
334
|
|
|
330
|
-
try {
|
|
331
|
-
_f.apply(_h.context, args)
|
|
332
|
-
} catch (e) {
|
|
333
|
-
console.error("Failed to dispatch handler", _f, e);
|
|
334
335
|
}
|
|
335
336
|
|
|
336
337
|
_h = next;
|
|
@@ -363,23 +364,23 @@ export class Signal {
|
|
|
363
364
|
|
|
364
365
|
do {
|
|
365
366
|
|
|
366
|
-
if (_h.generation >= this.generation) {
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
367
|
const next = _h.next;
|
|
371
368
|
|
|
372
|
-
if
|
|
373
|
-
//handler
|
|
374
|
-
|
|
375
|
-
|
|
369
|
+
if(_h.generation < this.generation) {
|
|
370
|
+
// only process if handler was attached before this dispatch
|
|
371
|
+
|
|
372
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
373
|
+
//handler should be cut
|
|
374
|
+
this.#remove_handler_internal(_h);
|
|
375
|
+
}
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
const _f = _h.handle;
|
|
378
378
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
379
|
+
try {
|
|
380
|
+
_f.call(_h.context)
|
|
381
|
+
} catch (e) {
|
|
382
|
+
console.error("Failed to dispatch handler", _f, e);
|
|
383
|
+
}
|
|
383
384
|
}
|
|
384
385
|
|
|
385
386
|
_h = next;
|
|
@@ -412,23 +413,22 @@ export class Signal {
|
|
|
412
413
|
|
|
413
414
|
do {
|
|
414
415
|
|
|
415
|
-
if (_h.generation >= this.generation) {
|
|
416
|
-
break;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
416
|
const next = _h.next;
|
|
420
417
|
|
|
421
|
-
if
|
|
422
|
-
//handler
|
|
423
|
-
|
|
424
|
-
|
|
418
|
+
if(_h.generation < this.generation) {
|
|
419
|
+
// only process if handler was attached before this dispatch
|
|
420
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
421
|
+
//handler should be cut
|
|
422
|
+
this.#remove_handler_internal(_h);
|
|
423
|
+
}
|
|
425
424
|
|
|
426
|
-
|
|
425
|
+
const _f = _h.handle;
|
|
427
426
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
427
|
+
try {
|
|
428
|
+
_f.call(_h.context, arg)
|
|
429
|
+
} catch (e) {
|
|
430
|
+
console.error("Failed to dispatch handler", _f, e);
|
|
431
|
+
}
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
_h = next;
|
|
@@ -461,23 +461,22 @@ export class Signal {
|
|
|
461
461
|
|
|
462
462
|
do {
|
|
463
463
|
|
|
464
|
-
if (_h.generation >= this.generation) {
|
|
465
|
-
break;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
464
|
const next = _h.next;
|
|
469
465
|
|
|
470
|
-
if
|
|
471
|
-
//handler
|
|
472
|
-
|
|
473
|
-
|
|
466
|
+
if(_h.generation < this.generation) {
|
|
467
|
+
// only process if handler was attached before this dispatch
|
|
468
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
469
|
+
//handler should be cut
|
|
470
|
+
this.#remove_handler_internal(_h);
|
|
471
|
+
}
|
|
474
472
|
|
|
475
|
-
|
|
473
|
+
const _f = _h.handle;
|
|
476
474
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
475
|
+
try {
|
|
476
|
+
_f.call(_h.context, a, b)
|
|
477
|
+
} catch (e) {
|
|
478
|
+
console.error("Failed to dispatch handler", _f, e);
|
|
479
|
+
}
|
|
481
480
|
}
|
|
482
481
|
|
|
483
482
|
_h = next;
|
|
@@ -510,23 +509,22 @@ export class Signal {
|
|
|
510
509
|
|
|
511
510
|
do {
|
|
512
511
|
|
|
513
|
-
if (_h.generation >= this.generation) {
|
|
514
|
-
break;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
512
|
const next = _h.next;
|
|
518
513
|
|
|
519
|
-
if
|
|
520
|
-
//handler
|
|
521
|
-
|
|
522
|
-
|
|
514
|
+
if(_h.generation < this.generation) {
|
|
515
|
+
// only process if handler was attached before this dispatch
|
|
516
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
517
|
+
//handler should be cut
|
|
518
|
+
this.#remove_handler_internal(_h);
|
|
519
|
+
}
|
|
523
520
|
|
|
524
|
-
|
|
521
|
+
const _f = _h.handle;
|
|
525
522
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
523
|
+
try {
|
|
524
|
+
_f.call(_h.context, a, b, c)
|
|
525
|
+
} catch (e) {
|
|
526
|
+
console.error("Failed to dispatch handler", _f, e);
|
|
527
|
+
}
|
|
530
528
|
}
|
|
531
529
|
|
|
532
530
|
_h = next;
|
|
@@ -560,23 +558,22 @@ export class Signal {
|
|
|
560
558
|
|
|
561
559
|
do {
|
|
562
560
|
|
|
563
|
-
if (_h.generation >= this.generation) {
|
|
564
|
-
break;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
561
|
const next = _h.next;
|
|
568
562
|
|
|
569
|
-
if
|
|
570
|
-
//handler
|
|
571
|
-
|
|
572
|
-
|
|
563
|
+
if(_h.generation < this.generation) {
|
|
564
|
+
// only process if handler was attached before this dispatch
|
|
565
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
566
|
+
//handler should be cut
|
|
567
|
+
this.#remove_handler_internal(_h);
|
|
568
|
+
}
|
|
573
569
|
|
|
574
|
-
|
|
570
|
+
const _f = _h.handle;
|
|
575
571
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
572
|
+
try {
|
|
573
|
+
_f.call(_h.context, a, b, c, d)
|
|
574
|
+
} catch (e) {
|
|
575
|
+
console.error("Failed to dispatch handler", _f, e);
|
|
576
|
+
}
|
|
580
577
|
}
|
|
581
578
|
|
|
582
579
|
_h = next;
|
|
@@ -612,23 +609,22 @@ export class Signal {
|
|
|
612
609
|
|
|
613
610
|
do {
|
|
614
611
|
|
|
615
|
-
if (_h.generation >= this.generation) {
|
|
616
|
-
break;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
612
|
const next = _h.next;
|
|
620
613
|
|
|
621
|
-
if
|
|
622
|
-
//handler
|
|
623
|
-
|
|
624
|
-
|
|
614
|
+
if(_h.generation < this.generation) {
|
|
615
|
+
// only process if handler was attached before this dispatch
|
|
616
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
617
|
+
//handler should be cut
|
|
618
|
+
this.#remove_handler_internal(_h);
|
|
619
|
+
}
|
|
625
620
|
|
|
626
|
-
|
|
621
|
+
const _f = _h.handle;
|
|
627
622
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
623
|
+
try {
|
|
624
|
+
_f.call(_h.context, a, b, c, d, e, f)
|
|
625
|
+
} catch (e) {
|
|
626
|
+
console.error("Failed to dispatch handler", f, e);
|
|
627
|
+
}
|
|
632
628
|
}
|
|
633
629
|
|
|
634
630
|
_h = next;
|
|
@@ -666,24 +662,22 @@ export class Signal {
|
|
|
666
662
|
|
|
667
663
|
do {
|
|
668
664
|
|
|
669
|
-
if (_h.generation >= this.generation) {
|
|
670
|
-
break;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
665
|
const next = _h.next;
|
|
675
666
|
|
|
676
|
-
if
|
|
677
|
-
//handler
|
|
678
|
-
|
|
679
|
-
|
|
667
|
+
if(_h.generation < this.generation) {
|
|
668
|
+
// only process if handler was attached before this dispatch
|
|
669
|
+
if (_h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
670
|
+
//handler should be cut
|
|
671
|
+
this.#remove_handler_internal(_h);
|
|
672
|
+
}
|
|
680
673
|
|
|
681
|
-
|
|
674
|
+
const _f = _h.handle;
|
|
682
675
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
676
|
+
try {
|
|
677
|
+
_f.call(_h.context, a, b, c, d, e, f, g, h)
|
|
678
|
+
} catch (e) {
|
|
679
|
+
console.error("Failed to dispatch handler", f, e);
|
|
680
|
+
}
|
|
687
681
|
}
|
|
688
682
|
|
|
689
683
|
_h = next;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vector3.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector3.js"],"names":[],"mappings":";AAgBA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"Vector3.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector3.js"],"names":[],"mappings":";AAgBA;;;GAGG;AACH;IAq7BI;;;;;OAKG;IACH,cAJW,OAAO,UAAQ,KACf,OAAO,UAAQ,GACb,MAAM,CAIlB;IAED;;;;;OAKG;IACH,mBAJW,OAAO,KACP,OAAO,GACL,MAAM,CAIlB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,EAAE,WACR,MAAM,GACJ,OAAO,CAQnB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,OAAO,CAInB;IA79BD;;;;;;OAMG;IACH,gBALW,MAAM,MACN,MAAM,MACN,MAAM,EAuChB;IA1BG;;;;OAIG;IACH,YAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,YAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,YAFU,MAAM,CAEN;IAEV;;;OAG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AAM,CAAA;KAAC,GAAC,MAAM,QAS/C;IAED,mBAEC;IAED;;;;OAIG;IACH,2CAIC;IAED;;;;OAIG;IACH,6CAMC;IAED;;;;OAIG;IACH,kDAIC;IAED;;;;OAIG;IACH,oDAMC;IAED,eAMC;IAeD,mBAEC;IAdD,gBAEC;IAcD,mBAEC;IAdD,gBAEC;IAcD,mBAEC;IAdD,gBAEC;IAoEL,2BAxfe,OAAO,YAwfa;IAEnC,gBAlkBiB,MAAM,CAkkBG;IAC1B,mBAt7Be,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,UAq7BM;IAC3B,kBA16Be,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,6BAy6BI;IACzB;;OAEG;IACH,kBA96Be,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,6BA66BI;IA2DzB;;;OAGG;IACH,oBAFU,OAAO,CAEU;IA7HvB,sDAMC;CA4CJ;;cAiBS,OAAO;aAOP,OAAO;mBAOP,OAAO;YAMP,OAAO;cAMP,OAAO;cAMP,OAAO;eAMP,OAAO;iBAMP,OAAO;cAMP,OAAO;kBAYP,MAAM;;mBAjkCG,4BAA4B"}
|
package/src/core/geom/Vector3.js
CHANGED
|
@@ -27,15 +27,32 @@ class Vector3 {
|
|
|
27
27
|
* @constructor
|
|
28
28
|
*/
|
|
29
29
|
constructor(x = 0, y = 0, z = 0) {
|
|
30
|
+
assert.isNumber(x, 'x');
|
|
31
|
+
assert.notNaN(x, 'x');
|
|
32
|
+
|
|
33
|
+
assert.isNumber(y, 'x');
|
|
34
|
+
assert.notNaN(y, 'x');
|
|
35
|
+
|
|
36
|
+
assert.isNumber(z, 'x');
|
|
37
|
+
assert.notNaN(z, 'x');
|
|
38
|
+
|
|
30
39
|
/**
|
|
40
|
+
* NOTE: do not assign directly, please use {@link set} method instead
|
|
41
|
+
* @readonly
|
|
31
42
|
* @type {number}
|
|
32
43
|
*/
|
|
33
44
|
this.x = x;
|
|
45
|
+
|
|
34
46
|
/**
|
|
47
|
+
* NOTE: do not assign directly, please use {@link set} method instead
|
|
48
|
+
* @readonly
|
|
35
49
|
* @type {number}
|
|
36
50
|
*/
|
|
37
51
|
this.y = y;
|
|
52
|
+
|
|
38
53
|
/**
|
|
54
|
+
* NOTE: do not assign directly, please use {@link set} method instead
|
|
55
|
+
* @readonly
|
|
39
56
|
* @type {number}
|
|
40
57
|
*/
|
|
41
58
|
this.z = z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Localization.d.ts","sourceRoot":"","sources":["../../../../src/core/localization/Localization.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Localization.d.ts","sourceRoot":"","sources":["../../../../src/core/localization/Localization.js"],"names":[],"mappings":"AA8BA;IAEQ;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB,SAAc;IAEd;;;OAGG;IACH,6BAFU,gBAAgB,CAEwB;IAElD;;;OAGG;IACH,QAFU,cAAc,CAEY;IAEpC;;;OAGG;IACH,OAFU,OAAO,CAEA;IAEjB;;;OAGG;IACH,wBAIE;IAGN;;;;OAIG;IACH,4BAEC;IAED;;;;OAIG;IACH,0BAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;OAGG;IACH,wCAEC;IAED;;;OAGG;IACH,8BAHa,OAAO,CAoBnB;IAED;;;;;;OAMG;IACH,mBAJW,MAAM,SACN,MAAM,gBAgDhB;IAGD;;;OAGG;IACH,gCAFW,MAAM,UAMhB;IAED;;;;;OAKG;IACH,0BA0BC;IAED;;;;;;OAMG;IACH,eALW,MAAM,SACN,MAAM,GAEJ,MAAM,CAoBlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACL,OAAO,CAIlB;CACJ;iCApPgC,uBAAuB;2BAL7B,4BAA4B"}
|
|
@@ -2,6 +2,7 @@ import { parseTooltipString } from "../../view/tooltip/gml/parser/parseTooltipSt
|
|
|
2
2
|
import { assert } from "../assert.js";
|
|
3
3
|
import { Cache } from "../cache/Cache.js";
|
|
4
4
|
import { computeHashArray } from "../collection/array/computeHashArray.js";
|
|
5
|
+
import { isArrayEqualStrict } from "../collection/array/isArrayEqualStrict.js";
|
|
5
6
|
import ObservedString from "../model/ObservedString.js";
|
|
6
7
|
import { seedVariablesIntoTemplateString } from "../parser/seedVariablesIntoTemplateString.js";
|
|
7
8
|
import { STRING_TEMPLATE_VARIABLE_REGEX } from "../parser/STRING_TEMPLATE_VARIABLE_REGEX.js";
|
|
@@ -61,7 +62,8 @@ export class Localization {
|
|
|
61
62
|
*/
|
|
62
63
|
this.__failure_cache = new Cache({
|
|
63
64
|
maxWeight: 1024,
|
|
64
|
-
keyHashFunction: (key) => computeHashArray(key, computeStringHash)
|
|
65
|
+
keyHashFunction: (key) => computeHashArray(key, computeStringHash),
|
|
66
|
+
keyEqualityFunction: isArrayEqualStrict
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAgBA;;;GAGG;AACH;IAgaI;;;;;OAKG;IACH,+BAJW,MAAM,oCAEJ,MAAM,CAgBlB;IAlbD;;;OAGG;IACH,oBAFU,eAAe,CAES;IAWlC;;;OAGG;IACH,oBAEC;IAdD;;;OAGG;IACH,iBAEC;IAmBD;;;OAGG;IACH,4BAEC;IAfD;;;OAGG;IACH,yBAEC;IAWD;;;;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,wCAHa,MAAM,CAyDlB;IAyBL;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;gCApc+B,sBAAsB;4BAF1B,kBAAkB;mBAF3B,oCAAoC"}
|
package/src/engine/ecs/Entity.js
CHANGED
|
@@ -3,6 +3,7 @@ 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
5
|
import { EventType } from "./EntityManager.js";
|
|
6
|
+
import { EntityReference } from "./EntityReference.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Set of default flags
|
|
@@ -20,17 +21,44 @@ const DEFAULT_FLAGS =
|
|
|
20
21
|
class Entity {
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @type {
|
|
24
|
+
* @readonly
|
|
25
|
+
* @type {EntityReference}
|
|
26
|
+
*/
|
|
27
|
+
reference = new EntityReference();
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated use {@link reference} instead
|
|
32
|
+
* @returns {number}
|
|
25
33
|
*/
|
|
26
|
-
id
|
|
34
|
+
get id() {
|
|
35
|
+
return this.reference.id;
|
|
36
|
+
}
|
|
27
37
|
|
|
28
38
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @type {number}
|
|
39
|
+
* @deprecated use {@link reference} instead
|
|
40
|
+
* @param {number} v
|
|
32
41
|
*/
|
|
33
|
-
|
|
42
|
+
set id(v) {
|
|
43
|
+
this.reference.id = v;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated use {@link reference} instead
|
|
48
|
+
* @returns {number}
|
|
49
|
+
*/
|
|
50
|
+
get generation() {
|
|
51
|
+
return this.reference.generation;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated use {@link reference} instead
|
|
57
|
+
* @param {number} v
|
|
58
|
+
*/
|
|
59
|
+
set generation(v) {
|
|
60
|
+
this.reference.generation = v;
|
|
61
|
+
}
|
|
34
62
|
|
|
35
63
|
/**
|
|
36
64
|
* Components associated with the entity
|
|
@@ -220,7 +248,7 @@ class Entity {
|
|
|
220
248
|
//see if entity is built
|
|
221
249
|
if (this.getFlag(EntityFlags.Built)) {
|
|
222
250
|
|
|
223
|
-
this.dataset.removeComponentFromEntity(this.id, klass);
|
|
251
|
+
this.dataset.removeComponentFromEntity(this.reference.id, klass);
|
|
224
252
|
|
|
225
253
|
}
|
|
226
254
|
|
|
@@ -325,7 +353,7 @@ class Entity {
|
|
|
325
353
|
if (this.getFlag(EntityFlags.Built)) {
|
|
326
354
|
|
|
327
355
|
const dataset = this.dataset;
|
|
328
|
-
const entity = this.id;
|
|
356
|
+
const entity = this.reference.id;
|
|
329
357
|
|
|
330
358
|
//check that the entity is the same as what we have built
|
|
331
359
|
//assert.ok(checkExistingComponents(entity, this.element, dataset), `Signature of Entity does not match existing entity(id=${entity})`);
|
|
@@ -334,8 +362,8 @@ class Entity {
|
|
|
334
362
|
|
|
335
363
|
dataset.removeEntity(entity);
|
|
336
364
|
|
|
337
|
-
|
|
338
|
-
this.
|
|
365
|
+
// clear reference
|
|
366
|
+
this.reference.copy(EntityReference.NULL);
|
|
339
367
|
|
|
340
368
|
this.clearFlag(EntityFlags.Built);
|
|
341
369
|
|
|
@@ -362,8 +390,9 @@ class Entity {
|
|
|
362
390
|
return this.id;
|
|
363
391
|
}
|
|
364
392
|
|
|
365
|
-
const entity =
|
|
366
|
-
this.
|
|
393
|
+
const entity = dataset.createEntity();
|
|
394
|
+
this.reference.bind(dataset, entity);
|
|
395
|
+
|
|
367
396
|
this.dataset = dataset;
|
|
368
397
|
|
|
369
398
|
let i;
|
|
@@ -419,9 +448,10 @@ class Entity {
|
|
|
419
448
|
.forEach(r.add, r);
|
|
420
449
|
|
|
421
450
|
r.setFlag(EntityFlags.Built);
|
|
422
|
-
|
|
451
|
+
|
|
423
452
|
r.dataset = dataset;
|
|
424
|
-
|
|
453
|
+
|
|
454
|
+
r.reference.bind(dataset,entity);
|
|
425
455
|
|
|
426
456
|
return r;
|
|
427
457
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uniquely identifies an entity by both its ID and generation.
|
|
3
|
+
* Lets us distinguish between two entities with the same ID that were created at different times
|
|
4
|
+
*/
|
|
1
5
|
export class EntityReference {
|
|
2
6
|
/**
|
|
3
7
|
*
|
|
@@ -8,14 +12,26 @@ export class EntityReference {
|
|
|
8
12
|
static from(id: number, generation: number): EntityReference;
|
|
9
13
|
/**
|
|
10
14
|
* Entity ID
|
|
15
|
+
* When entity is live - this is the entity ID inside associated `EntityComponentDataset`, when the entity is not live - it's set to -1
|
|
11
16
|
* @type {number}
|
|
12
17
|
*/
|
|
13
18
|
id: number;
|
|
14
19
|
/**
|
|
15
20
|
* Entity generation number. This uniquely identifies an entity in combination with the ID
|
|
21
|
+
* Generation of an existing entity must match for it to be considered "the same"
|
|
16
22
|
* @type {number}
|
|
17
23
|
*/
|
|
18
24
|
generation: number;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param {EntityReference} other
|
|
28
|
+
*/
|
|
29
|
+
copy(other: EntityReference): void;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @returns {EntityReference}
|
|
33
|
+
*/
|
|
34
|
+
clone(): EntityReference;
|
|
19
35
|
/**
|
|
20
36
|
*
|
|
21
37
|
* @return {number}
|
|
@@ -39,6 +55,23 @@ export class EntityReference {
|
|
|
39
55
|
* @returns {boolean}
|
|
40
56
|
*/
|
|
41
57
|
destroy(ecd: EntityComponentDataset): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Bind reference to a specific entity
|
|
60
|
+
* @param {EntityComponentDataset} ecd
|
|
61
|
+
* @param {number} entity
|
|
62
|
+
*/
|
|
63
|
+
bind(ecd: EntityComponentDataset, entity: number): void;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param {number} id
|
|
67
|
+
* @param {number} generation
|
|
68
|
+
*/
|
|
69
|
+
from(id: number, generation: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* @readonly
|
|
72
|
+
* @type {boolean}
|
|
73
|
+
*/
|
|
74
|
+
readonly isEntityReference: boolean;
|
|
42
75
|
}
|
|
43
76
|
export namespace EntityReference {
|
|
44
77
|
let NULL: EntityReference;
|
|
@@ -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;;;GAGG;AACH;IA6GI;;;;;OAKG;IACH,gBAJW,MAAM,cACN,MAAM,GACL,eAAe,CAQ1B;IAvHD;;;;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,qCAFa,OAAO,CAQnB;IAED;;;;OAIG;IACH,sCAFa,OAAO,CASnB;IAED;;;;OAIG;IACH,0CAFW,MAAM,QAMhB;IAED;;;;OAIG;IACH,SAHW,MAAM,cACN,MAAM,QAUhB;IAiBL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C;;cAWS,eAAe"}
|
|
@@ -1,19 +1,46 @@
|
|
|
1
1
|
import { assert } from "../../core/assert.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Uniquely identifies an entity by both its ID and generation.
|
|
5
|
+
* Lets us distinguish between two entities with the same ID that were created at different times
|
|
6
|
+
*/
|
|
3
7
|
export class EntityReference {
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
* Entity ID
|
|
11
|
+
* When entity is live - this is the entity ID inside associated `EntityComponentDataset`, when the entity is not live - it's set to -1
|
|
7
12
|
* @type {number}
|
|
8
13
|
*/
|
|
9
14
|
id = -1
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* Entity generation number. This uniquely identifies an entity in combination with the ID
|
|
18
|
+
* Generation of an existing entity must match for it to be considered "the same"
|
|
13
19
|
* @type {number}
|
|
14
20
|
*/
|
|
15
21
|
generation = -1
|
|
16
22
|
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param {EntityReference} other
|
|
26
|
+
*/
|
|
27
|
+
copy(other){
|
|
28
|
+
this.id = other.id;
|
|
29
|
+
this.generation = other.generation;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @returns {EntityReference}
|
|
35
|
+
*/
|
|
36
|
+
clone(){
|
|
37
|
+
const r = new EntityReference();
|
|
38
|
+
|
|
39
|
+
r.copy(this);
|
|
40
|
+
|
|
41
|
+
return r;
|
|
42
|
+
}
|
|
43
|
+
|
|
17
44
|
/**
|
|
18
45
|
*
|
|
19
46
|
* @return {number}
|
|
@@ -60,27 +87,55 @@ export class EntityReference {
|
|
|
60
87
|
}
|
|
61
88
|
}
|
|
62
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Bind reference to a specific entity
|
|
92
|
+
* @param {EntityComponentDataset} ecd
|
|
93
|
+
* @param {number} entity
|
|
94
|
+
*/
|
|
95
|
+
bind(ecd, entity){
|
|
96
|
+
const generation = ecd.getEntityGeneration(entity);
|
|
97
|
+
|
|
98
|
+
this.from(entity, generation);
|
|
99
|
+
}
|
|
100
|
+
|
|
63
101
|
/**
|
|
64
102
|
*
|
|
65
103
|
* @param {number} id
|
|
66
104
|
* @param {number} generation
|
|
67
|
-
* @return {EntityReference}
|
|
68
105
|
*/
|
|
69
|
-
|
|
106
|
+
from(id, generation){
|
|
70
107
|
|
|
71
108
|
assert.isNonNegativeInteger(id, 'id');
|
|
72
109
|
assert.isNonNegativeInteger(generation, 'generation');
|
|
73
110
|
|
|
111
|
+
this.id = id;
|
|
112
|
+
this.generation = generation;
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @param {number} id
|
|
119
|
+
* @param {number} generation
|
|
120
|
+
* @return {EntityReference}
|
|
121
|
+
*/
|
|
122
|
+
static from(id, generation) {
|
|
74
123
|
const r = new EntityReference();
|
|
75
124
|
|
|
76
|
-
r.id
|
|
77
|
-
r.generation = generation;
|
|
125
|
+
r.from(id, generation);
|
|
78
126
|
|
|
79
127
|
return r;
|
|
80
128
|
}
|
|
81
129
|
}
|
|
82
130
|
|
|
83
131
|
/**
|
|
132
|
+
* @readonly
|
|
133
|
+
* @type {boolean}
|
|
134
|
+
*/
|
|
135
|
+
EntityReference.prototype.isEntityReference = true;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Special singleton to describe an invalid reference
|
|
84
139
|
* @readonly
|
|
85
140
|
* @type {EntityReference}
|
|
86
141
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopDownCameraLanderSystem.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopDownCameraLanderSystem.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.js"],"names":[],"mappings":"AA6EA;IACI,cAwBC;IArBG;;;OAGG;IACH,cAFU,MAAM,MAAM,YAAW,CAM/B;IAEF,8EAAkE;IAElE,+EAEC;IAED;;;OAGG;IACH,aAAc;IAGlB;;;;;OAKG;IACH,aAJW,mBAAmB,cACnB,uBAAuB,UACvB,MAAM,QAmChB;IAED;;;;;OAKG;IACH,eAJW,mBAAmB,cACnB,uBAAuB,UACvB,MAAM,QAUhB;IAED,6BAEC;CACJ;uBA5JsB,2BAA2B;sBAR5B,oCAAoC;oCAWtB,8BAA8B;oCAC9B,0BAA0B;4CALlB,0DAA0D"}
|