@woosh/meep-engine 2.75.7 → 2.75.9
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-terrain.js +1 -1
- package/build/meep.cjs +1052 -1234
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +1052 -1234
- package/editor/actions/concrete/ModifyPatchSampler2DAction.js +6 -3
- package/editor/actions/concrete/PatchTerrainTextureAction.js +6 -3
- package/editor/ecs/component/createObjectEditor.js +2 -2
- package/editor/process/EditorProcess.js +12 -16
- package/editor/process/ProcessEngine.js +9 -10
- package/package.json +1 -1
- package/src/core/binary/dec2hex.js +1 -1
- package/src/{engine/ecs/ik/IKMath.js → core/geom/vec3/v3_computeOffsetVector.js} +1 -1
- package/src/core/math/newton_solver_1d.js +13 -4
- package/src/core/math/solveQuadratic.js +5 -3
- package/src/core/math/spline/catmull_rom_compute_T.js +19 -0
- package/src/{engine/navigation/ecs/components → core/math/spline}/computeCatmullRomSpline.js +3 -3
- package/src/{engine/navigation/ecs/components → core/math/spline}/computeCatmullRomSplineUniformDistance.js +3 -3
- package/src/core/math/spline/computeNonuniformCatmullRomSplineSample.js +109 -0
- package/src/core/math/spline/interpolate_bicubic.js +12 -0
- package/src/core/math/spline/spline_catmullrom_1d.js +120 -0
- package/src/core/model/object/ImmutableObjectPool.js +14 -5
- package/src/engine/control/ControlContext.js +25 -27
- package/src/engine/ecs/EntityManager.js +12 -9
- package/src/engine/ecs/EntityObserver.js +26 -22
- package/src/engine/ecs/binding/ComponentPropertyPath.js +12 -12
- package/src/engine/ecs/components/Motion.js +5 -7
- package/src/engine/ecs/components/SerializationMetadata.js +5 -3
- package/src/engine/ecs/dynamic_actions/actions/definition/AbstractActionDescription.js +0 -2
- package/src/engine/ecs/dynamic_actions/actions/definition/ActionSequenceDescription.js +7 -9
- package/src/engine/ecs/dynamic_actions/actions/definition/DelayActionDescription.js +3 -5
- package/src/engine/ecs/dynamic_actions/actions/definition/SendRequestActionDescription.js +6 -8
- package/src/engine/ecs/dynamic_actions/actions/definition/SpeakLineActionDescription.js +14 -17
- package/src/engine/ecs/dynamic_actions/actions/definition/WeightedRandomActionDescription.js +8 -11
- package/src/engine/ecs/dynamic_actions/actions/definition/WriteToBlackboardActionDescription.js +15 -18
- package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.js +7 -7
- package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.js +6 -6
- package/src/engine/ecs/parent/EntityNode.js +39 -37
- package/src/engine/ecs/speaker/VoiceSystem.js +36 -39
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +7 -9
- package/src/engine/ecs/storage/BinaryBufferSerializer.js +15 -16
- package/src/engine/ecs/storage/binary/BinaryClassUpgrader.js +10 -59
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +14 -15
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +3 -3
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +60 -62
- package/src/engine/ecs/storage/binary/executeBinaryClassUpgraderChain.js +46 -0
- package/src/engine/ecs/storage/binary/object/BinaryObjectSerializationAdapter.js +2 -2
- package/src/engine/ecs/system/SystemEntityContext.js +25 -23
- package/src/engine/ecs/tag/find_entities_with_tag.js +18 -0
- package/src/engine/ecs/terrain/TerrainClouds.js +23 -24
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +37 -31
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +8 -7
- package/src/engine/ecs/terrain/ecs/splat/SplatMapMaterialPatch.js +5 -2
- package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +15 -14
- package/src/engine/ecs/tooltip/TooltipComponent.js +6 -7
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -4
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -5
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +2 -6
- package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +12 -14
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +22 -20
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +3 -4
- package/src/engine/graphics/render/RendererPool.js +36 -40
- package/src/engine/graphics/render/buffer/FrameBuffer.js +25 -24
- package/src/engine/graphics/render/buffer/RenderGraph.js +21 -21
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -4
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -5
- package/src/engine/graphics/render/frame_graph/IRenderContext.js +31 -1
- package/src/engine/graphics/render/frame_graph/RenderGraph.js +5 -5
- package/src/engine/graphics/render/frame_graph/RenderTarget.js +9 -0
- package/src/engine/graphics/render/frame_graph/RenderTextureManager.js +57 -0
- package/src/engine/graphics/render/frame_graph/ResourceEntry.js +7 -5
- package/src/engine/graphics/render/frame_graph/TextureDescriptor.js +48 -33
- package/src/engine/graphics/render/frame_graph/TextureInitialState.js +14 -0
- package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.js +20 -0
- package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.js +4 -0
- package/src/engine/graphics/render/frame_graph/sample/deferred/run.js +34 -6
- package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.js +34 -0
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +3 -6
- package/src/engine/graphics/sh3/gi/prototypeSHGI.js +92 -0
- package/src/engine/graphics/shadows/testShadowMapRendering.js +0 -2
- package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -11
- package/src/engine/graphics/texture/sampler/Sampler2D.js +15 -366
- package/src/engine/graphics/texture/sampler/Sampler2D.spec.js +0 -31
- package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +166 -0
- package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.spec.js +31 -0
- package/src/engine/graphics/texture/sampler/sampler2d_paint.js +81 -0
- package/src/engine/graphics/texture/sampler/sampler2d_sub_copy_same_item_size.js +50 -0
- package/src/engine/graphics/texture/virtual/{v2/VirtualTextureMemoryMapping.js → VirtualTextureMemoryMapping.js} +2 -26
- package/src/engine/graphics/texture/virtual/{v2/VirtualTexturePage.js → VirtualTexturePage.js} +10 -10
- package/src/engine/graphics/texture/virtual/{v2/VirtualTextureTileLoader.js → VirtualTextureTileLoader.js} +7 -7
- package/src/engine/graphics/texture/virtual/{v2/VirtualTextureUsage.js → VirtualTextureUsage.js} +1 -1
- package/src/engine/graphics/texture/virtual/{v2/VirtualTextureUsageUpdater.js → VirtualTextureUsageUpdater.js} +7 -7
- package/src/engine/graphics/texture/virtual/{v2/debug → debug}/ResidencyDebugView.js +4 -4
- package/src/engine/graphics/texture/virtual/{v2/debug → debug}/UsageDebugView.js +2 -2
- package/src/engine/graphics/texture/virtual/{v2/debug → debug}/UsagePyramidDebugView.js +4 -4
- package/src/engine/graphics/texture/virtual/{v2/prototype.js → prototype.js} +7 -7
- package/src/engine/graphics/texture/virtual/{v2/tile → tile}/compose_finger_print.js +1 -1
- package/src/engine/graphics/texture/virtual/{v2/tile → tile}/compose_tile_address.js +2 -2
- package/src/engine/graphics/texture/virtual/{v2/tile → tile}/tile_address_to_finger_print.js +1 -1
- package/src/engine/navigation/ecs/components/Path.js +10 -9
- package/src/engine/physics/computeInterceptPoint.js +44 -0
- package/src/engine/plugin/EnginePlugin.js +1 -2
- package/src/engine/ecs/components/AlignToVelocity.js +0 -9
- package/src/engine/ecs/components/CharacterController.js +0 -31
- package/src/engine/ecs/components/PhysicalBody.js +0 -51
- package/src/engine/ecs/components/Steering.js +0 -111
- package/src/engine/ecs/components/SteeringSerializationAdapter.js +0 -34
- package/src/engine/ecs/storage/json/Blueprint.js +0 -129
- package/src/engine/ecs/storage/json/EntityFactory.js +0 -207
- package/src/engine/ecs/storage/json/JSONDeSerializer.js +0 -148
- package/src/engine/ecs/storage/json/JSONSerializer.js +0 -132
- package/src/engine/ecs/storage/json/README.md +0 -5
- package/src/engine/ecs/systems/AlignToVelocitySystem.js +0 -51
- package/src/engine/ecs/systems/CharacterControlSystem.js +0 -134
- package/src/engine/ecs/systems/PhysicsSystem.js +0 -89
- package/src/engine/ecs/systems/PropertySetSystem.js +0 -18
- package/src/engine/ecs/systems/SteeringSystem.js +0 -171
- package/src/engine/ecs/systems/TagSystem.d.ts +0 -5
- package/src/engine/ecs/systems/TagSystem.js +0 -31
- package/src/engine/graphics/render/webgpu/sample/MeshInstance.js +0 -108
- package/src/engine/graphics/render/webgpu/sample/fragmentDeferredRendering.wgsl +0 -71
- package/src/engine/graphics/render/webgpu/sample/fragmentGBuffersDebugView.wgsl +0 -39
- package/src/engine/graphics/render/webgpu/sample/fragmentWriteGBuffers.wgsl +0 -21
- package/src/engine/graphics/render/webgpu/sample/lightUpdate.wgsl +0 -41
- package/src/engine/graphics/render/webgpu/sample/main.js +0 -605
- package/src/engine/graphics/render/webgpu/sample/vertexTextureQuad.wgsl +0 -9
- package/src/engine/graphics/render/webgpu/sample/vertexWriteGBuffers.wgsl +0 -30
- package/src/engine/graphics/texture/sampler/bicubic.js +0 -59
- package/src/engine/graphics/texture/sampler/bicubic.spec.js +0 -13
- package/src/engine/graphics/texture/virtual/TileOperation.js +0 -13
- package/src/engine/graphics/texture/virtual/TileTree.js +0 -150
- package/src/engine/graphics/texture/virtual/TileTree.spec.js +0 -58
- package/src/engine/graphics/texture/virtual/TileUsage.js +0 -137
- package/src/engine/graphics/texture/virtual/VirtualTexture.js +0 -238
- package/src/engine/graphics/texture/virtual/VirtualTexture.spec.js +0 -39
- package/src/engine/graphics/texture/virtual/page/TilePage.js +0 -148
- package/src/engine/graphics/texture/virtual/page/TilePageSlot.js +0 -36
- package/src/engine/graphics/texture/virtual/tile/Tile.js +0 -44
- package/src/engine/graphics/texture/virtual/tile/Tile.spec.js +0 -11
- package/src/engine/graphics/texture/virtual/tile/TileAddress.js +0 -63
- package/src/engine/graphics/texture/virtual/tile/TileAddress.spec.js +0 -30
- package/src/engine/graphics/texture/virtual/tile/TileLoader.js +0 -178
- package/src/engine/graphics/texture/virtual/tile/TileRequest.js +0 -40
- package/src/engine/graphics/texture/virtual/tile/TileStatus.js +0 -10
- package/src/engine/navigation/ecs/components/computeNonuniformCatmullRomSplineSample.js +0 -242
- /package/src/engine/graphics/texture/virtual/{v2/NOTES.md → NOTES.md} +0 -0
- /package/src/engine/graphics/texture/virtual/{v2/VirtualTextureMaterial.js → VirtualTextureMaterial.js} +0 -0
- /package/src/engine/graphics/texture/virtual/{v2/VirtualTextureUsageShader.js → VirtualTextureUsageShader.js} +0 -0
- /package/src/engine/graphics/texture/virtual/{v2/tile → tile}/VirtualTextureTile.js +0 -0
- /package/src/engine/graphics/texture/virtual/{v2/tile → tile}/decompose_finger_print.js +0 -0
- /package/src/engine/graphics/texture/virtual/{v2/tile → tile}/finger_print_to_tile_address.js +0 -0
|
@@ -6,10 +6,29 @@
|
|
|
6
6
|
* @constructor
|
|
7
7
|
* @class
|
|
8
8
|
*/
|
|
9
|
-
import { BitSet } from "../../core/binary/BitSet.js";
|
|
10
9
|
import { assert } from "../../core/assert.js";
|
|
10
|
+
import { BitSet } from "../../core/binary/BitSet.js";
|
|
11
11
|
|
|
12
12
|
export class EntityObserver {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @type {BitSet}
|
|
16
|
+
*/
|
|
17
|
+
componentMask = new BitSet();
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Mapping from component index to position in array of observed component types,
|
|
21
|
+
* this is used to build arguments for callbacks
|
|
22
|
+
* @type {number[]}
|
|
23
|
+
*/
|
|
24
|
+
componentIndexMapping = [];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {EntityComponentDataset|null}
|
|
29
|
+
*/
|
|
30
|
+
dataset = null;
|
|
31
|
+
|
|
13
32
|
/**
|
|
14
33
|
*
|
|
15
34
|
* @param {Array} componentTypes
|
|
@@ -18,7 +37,12 @@ export class EntityObserver {
|
|
|
18
37
|
* @param {*} [thisArg=undefined] will assume {@link this} value inside callbacks
|
|
19
38
|
* @constructor
|
|
20
39
|
*/
|
|
21
|
-
constructor(
|
|
40
|
+
constructor(
|
|
41
|
+
componentTypes,
|
|
42
|
+
completedCallback,
|
|
43
|
+
brokenCallback,
|
|
44
|
+
thisArg
|
|
45
|
+
) {
|
|
22
46
|
assert.isArray(componentTypes, 'componentTypes must be an array, instead was something else');
|
|
23
47
|
assert.isFunction(completedCallback, 'completedCallback');
|
|
24
48
|
assert.isFunction(brokenCallback, 'brokenCallback');
|
|
@@ -57,26 +81,6 @@ export class EntityObserver {
|
|
|
57
81
|
* @type {*}
|
|
58
82
|
*/
|
|
59
83
|
this.thisArg = thisArg;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @type {BitSet}
|
|
65
|
-
*/
|
|
66
|
-
this.componentMask = new BitSet();
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Mapping from component index to position in array of observed component types,
|
|
70
|
-
* this is used to build arguments for callbacks
|
|
71
|
-
* @type {number[]}
|
|
72
|
-
*/
|
|
73
|
-
this.componentIndexMapping = [];
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
* @type {EntityComponentDataset|null}
|
|
78
|
-
*/
|
|
79
|
-
this.dataset = null;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export class ComponentPropertyPath {
|
|
2
|
-
constructor() {
|
|
3
|
-
/**
|
|
4
|
-
* Component type name
|
|
5
|
-
* @type {string}
|
|
6
|
-
*/
|
|
7
|
-
this.component = "";
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Component type name
|
|
5
|
+
* @type {string}
|
|
6
|
+
*/
|
|
7
|
+
component = "";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Path to the property
|
|
11
|
+
* @type {string}
|
|
12
|
+
*/
|
|
13
|
+
path = "";
|
|
14
|
+
|
|
15
15
|
}
|
|
@@ -7,13 +7,11 @@ import Vector3 from '../../../core/geom/Vector3.js';
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class Motion {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.velocity = new Vector3();
|
|
16
|
-
}
|
|
10
|
+
/**
|
|
11
|
+
* @readonly
|
|
12
|
+
* @type {Vector3}
|
|
13
|
+
*/
|
|
14
|
+
velocity = new Vector3();
|
|
17
15
|
|
|
18
16
|
toJSON() {
|
|
19
17
|
return {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
2
1
|
import { SequenceBehavior } from "../../../../intelligence/behavior/composite/SequenceBehavior.js";
|
|
2
|
+
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
3
3
|
|
|
4
4
|
export class ActionSequenceDescription extends AbstractActionDescription {
|
|
5
|
-
constructor() {
|
|
6
|
-
super();
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @type {AbstractActionDescription[]}
|
|
10
|
+
*/
|
|
11
|
+
elements = [];
|
|
14
12
|
|
|
15
13
|
execute(actor, dataset, context, system) {
|
|
16
14
|
const sequence = this.elements.map(e => {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
2
1
|
import { DelayBehavior } from "../../../../intelligence/behavior/util/DelayBehavior.js";
|
|
2
|
+
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
3
3
|
|
|
4
4
|
export class DelayActionDescription extends AbstractActionDescription {
|
|
5
|
-
constructor() {
|
|
6
|
-
super();
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
|
|
7
|
+
time = 0;
|
|
10
8
|
|
|
11
9
|
execute(actor, dataset, context, system) {
|
|
12
10
|
return DelayBehavior.from(this.time);
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
2
1
|
import { assert } from "../../../../../core/assert.js";
|
|
2
|
+
import { compileReactiveExpression } from "../../../../../core/lang/reactive/compileReactiveExpression.js";
|
|
3
3
|
import { ActionBehavior } from "../../../../intelligence/behavior/primitive/ActionBehavior.js";
|
|
4
4
|
import { Transform } from "../../../transform/Transform.js";
|
|
5
|
-
import {
|
|
5
|
+
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
6
6
|
|
|
7
7
|
export class SendRequestActionDescription extends AbstractActionDescription {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
9
|
+
|
|
10
|
+
distance = Number.POSITIVE_INFINITY;
|
|
11
|
+
responders = 1;
|
|
12
|
+
context = {};
|
|
15
13
|
|
|
16
14
|
fromJSON({
|
|
17
15
|
distance = Number.POSITIVE_INFINITY,
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SendEventBehavior } from "../../../../../../../model/game/util/behavior/SendEventBehavior.js";
|
|
2
|
+
import { assert } from "../../../../../core/assert.js";
|
|
2
3
|
import {
|
|
3
4
|
ParallelBehavior,
|
|
4
5
|
ParallelBehaviorPolicy
|
|
5
6
|
} from "../../../../intelligence/behavior/composite/ParallelBehavior.js";
|
|
6
7
|
import { WaitForEventBehavior } from "../../../../intelligence/behavior/ecs/WaitForEventBehavior.js";
|
|
7
8
|
import { VoiceEvents } from "../../../speaker/VoiceEvents.js";
|
|
8
|
-
import {
|
|
9
|
-
import { assert } from "../../../../../core/assert.js";
|
|
9
|
+
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
10
10
|
|
|
11
11
|
export class SpeakLineActionDescription extends AbstractActionDescription {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
id = "";
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
isGroup = false;
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
21
|
+
/**
|
|
22
|
+
* If override is on, will request speaking a line even if another line is currently being spoken
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
*/
|
|
25
|
+
override = false;
|
|
29
26
|
|
|
30
27
|
execute(actor, dataset, context, system) {
|
|
31
28
|
const id = this.id;
|
package/src/engine/ecs/dynamic_actions/actions/definition/WeightedRandomActionDescription.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
2
|
-
import { WeightedRandomBehavior } from "../../../../intelligence/behavior/selector/WeightedRandomBehavior.js";
|
|
3
|
-
import { WeightedElement } from "../../../../intelligence/behavior/selector/WeightedElement.js";
|
|
4
1
|
import { computeHashFloat } from "../../../../../core/primitives/numbers/computeHashFloat.js";
|
|
2
|
+
import { WeightedElement } from "../../../../intelligence/behavior/selector/WeightedElement.js";
|
|
3
|
+
import { WeightedRandomBehavior } from "../../../../intelligence/behavior/selector/WeightedRandomBehavior.js";
|
|
4
|
+
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
5
5
|
|
|
6
6
|
export class WeightedRandomActionDescription extends AbstractActionDescription {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @type {WeightedElement<AbstractActionDescription>[]}
|
|
11
|
+
*/
|
|
12
|
+
elements = [];
|
|
16
13
|
|
|
17
14
|
execute(actor, dataset, context, system) {
|
|
18
15
|
|
package/src/engine/ecs/dynamic_actions/actions/definition/WriteToBlackboardActionDescription.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assert } from "../../../../../core/assert.js";
|
|
2
|
+
import { compileReactiveExpression } from "../../../../../core/lang/reactive/compileReactiveExpression.js";
|
|
2
3
|
import { ActionBehavior } from "../../../../intelligence/behavior/primitive/ActionBehavior.js";
|
|
3
4
|
import { Blackboard } from "../../../../intelligence/blackboard/Blackboard.js";
|
|
4
|
-
import {
|
|
5
|
-
import { assert } from "../../../../../core/assert.js";
|
|
5
|
+
import { AbstractActionDescription } from "./AbstractActionDescription.js";
|
|
6
6
|
|
|
7
7
|
export class WriteToBlackboardActionDescription extends AbstractActionDescription {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
this.name = "";
|
|
22
|
-
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {ReactiveExpression}
|
|
12
|
+
*/
|
|
13
|
+
expression = null;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
19
|
+
name = "";
|
|
23
20
|
|
|
24
21
|
execute(actor, dataset, context, system) {
|
|
25
22
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { clamp } from "../../../core/math/clamp.js";
|
|
2
|
-
import { inverseLerp } from "../../../core/math/inverseLerp.js";
|
|
3
|
-
import { IKSolver } from "./IKSolver.js";
|
|
4
|
-
import { findSkeletonBoneByType } from "../../graphics/ecs/mesh/SkeletonUtils.js";
|
|
5
|
-
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
6
|
-
import Vector3 from "../../../core/geom/Vector3.js";
|
|
7
1
|
import { SurfacePoint3 } from "../../../core/geom/3d/SurfacePoint3.js";
|
|
8
|
-
import
|
|
2
|
+
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
3
|
+
import { v3_computeOffsetVector } from "../../../core/geom/vec3/v3_computeOffsetVector.js";
|
|
9
4
|
import { v3_dot } from "../../../core/geom/vec3/v3_dot.js";
|
|
10
5
|
import { v3_length } from "../../../core/geom/vec3/v3_length.js";
|
|
6
|
+
import Vector3 from "../../../core/geom/Vector3.js";
|
|
7
|
+
import { clamp } from "../../../core/math/clamp.js";
|
|
11
8
|
import { clamp01 } from "../../../core/math/clamp01.js";
|
|
9
|
+
import { inverseLerp } from "../../../core/math/inverseLerp.js";
|
|
10
|
+
import { findSkeletonBoneByType } from "../../graphics/ecs/mesh/SkeletonUtils.js";
|
|
11
|
+
import { IKSolver } from "./IKSolver.js";
|
|
12
12
|
|
|
13
13
|
const boneWorldPosition = new Vector3();
|
|
14
14
|
const boneWorldRotation = new Quaternion();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { SurfacePoint3 } from "../../../core/geom/3d/SurfacePoint3.js";
|
|
3
|
+
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
4
|
+
import { v3_computeOffsetVector } from "../../../core/geom/vec3/v3_computeOffsetVector.js";
|
|
5
|
+
import { v3_dot } from "../../../core/geom/vec3/v3_dot.js";
|
|
6
|
+
import { v3_length } from "../../../core/geom/vec3/v3_length.js";
|
|
2
7
|
import Vector3 from "../../../core/geom/Vector3.js";
|
|
3
8
|
import { clamp } from "../../../core/math/clamp.js";
|
|
9
|
+
import { clamp01 } from "../../../core/math/clamp01.js";
|
|
4
10
|
import { inverseLerp } from "../../../core/math/inverseLerp.js";
|
|
5
|
-
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
6
11
|
import { findSkeletonBoneByType } from "../../graphics/ecs/mesh/SkeletonUtils.js";
|
|
7
|
-
import { SurfacePoint3 } from "../../../core/geom/3d/SurfacePoint3.js";
|
|
8
12
|
import { IKSolver } from "./IKSolver.js";
|
|
9
|
-
import { v3_computeOffsetVector } from "./IKMath.js";
|
|
10
|
-
import { v3_dot } from "../../../core/geom/vec3/v3_dot.js";
|
|
11
|
-
import { v3_length } from "../../../core/geom/vec3/v3_length.js";
|
|
12
|
-
import { clamp01 } from "../../../core/math/clamp01.js";
|
|
13
13
|
|
|
14
14
|
const boneWorldPositionC = new Vector3();
|
|
15
15
|
const boneWorldPositionB = new Vector3();
|
|
@@ -1,27 +1,53 @@
|
|
|
1
|
-
import {assert} from "../../../core/assert.js";
|
|
2
|
-
import {array_push_if_unique} from "../../../core/collection/array/array_push_if_unique.js";
|
|
3
|
-
import {array_remove_first} from "../../../core/collection/array/array_remove_first.js";
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { array_push_if_unique } from "../../../core/collection/array/array_push_if_unique.js";
|
|
3
|
+
import { array_remove_first } from "../../../core/collection/array/array_remove_first.js";
|
|
4
4
|
import Signal from "../../../core/events/signal/Signal.js";
|
|
5
5
|
import Entity from "../Entity.js";
|
|
6
|
-
import {TransformAttachment, TransformAttachmentFlags} from "../transform-attachment/TransformAttachment.js";
|
|
7
|
-
import {Transform} from "../transform/Transform.js";
|
|
8
|
-
import {EntityNodeFlags} from "./EntityNodeFlags.js";
|
|
9
|
-
import {ParentEntity} from "./ParentEntity.js";
|
|
6
|
+
import { TransformAttachment, TransformAttachmentFlags } from "../transform-attachment/TransformAttachment.js";
|
|
7
|
+
import { Transform } from "../transform/Transform.js";
|
|
8
|
+
import { EntityNodeFlags } from "./EntityNodeFlags.js";
|
|
9
|
+
import { ParentEntity } from "./ParentEntity.js";
|
|
10
10
|
|
|
11
11
|
const DEFAULT_FLAGS = EntityNodeFlags.LiveManagement;
|
|
12
12
|
|
|
13
13
|
export class EntityNode {
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @type {EntityNode|null}
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
__parent = null;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {EntityNode[]}
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
__children = [];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Local transform
|
|
30
|
+
* @type {Transform}
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
__transform = new Transform();
|
|
34
|
+
|
|
35
|
+
on = {
|
|
36
|
+
built: new Signal(),
|
|
37
|
+
destroyed: new Signal()
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
*/
|
|
44
|
+
flags = DEFAULT_FLAGS;
|
|
45
|
+
|
|
14
46
|
/**
|
|
15
47
|
*
|
|
16
48
|
* @param {Entity} [entity] optional entity to be wrapped
|
|
17
49
|
*/
|
|
18
50
|
constructor(entity = new Entity()) {
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @type {EntityNode|null}
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
this.__parent = null;
|
|
25
51
|
|
|
26
52
|
/**
|
|
27
53
|
*
|
|
@@ -30,30 +56,6 @@ export class EntityNode {
|
|
|
30
56
|
*/
|
|
31
57
|
this.__entity = entity;
|
|
32
58
|
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @type {EntityNode[]}
|
|
36
|
-
* @private
|
|
37
|
-
*/
|
|
38
|
-
this.__children = [];
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Local transform
|
|
42
|
-
* @type {Transform}
|
|
43
|
-
* @private
|
|
44
|
-
*/
|
|
45
|
-
this.__transform = new Transform();
|
|
46
|
-
|
|
47
|
-
this.on = {
|
|
48
|
-
built: new Signal(),
|
|
49
|
-
destroyed: new Signal()
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* @type {number}
|
|
55
|
-
*/
|
|
56
|
-
this.flags = DEFAULT_FLAGS;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
/**
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { max2 } from "../../../core/math/max2.js";
|
|
2
|
-
import { Voice } from "./Voice.js";
|
|
3
|
-
import Entity from "../Entity.js";
|
|
4
|
-
import GUIElement from "../gui/GUIElement.js";
|
|
5
|
-
import { SerializationMetadata } from "../components/SerializationMetadata.js";
|
|
6
|
-
import HeadsUpDisplay from "../gui/hud/HeadsUpDisplay.js";
|
|
7
|
-
import ViewportPosition from "../gui/position/ViewportPosition.js";
|
|
8
|
-
import { Transform } from "../transform/Transform.js";
|
|
9
|
-
import { Attachment } from "../attachment/Attachment.js";
|
|
10
|
-
import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
11
|
-
import { SequenceBehavior } from "../../intelligence/behavior/composite/SequenceBehavior.js";
|
|
12
|
-
import { DelayBehavior } from "../../intelligence/behavior/util/DelayBehavior.js";
|
|
13
|
-
import { DieBehavior } from "../../intelligence/behavior/ecs/DieBehavior.js";
|
|
14
|
-
import Vector2 from "../../../core/geom/Vector2.js";
|
|
15
|
-
import { VoiceEvents } from "./VoiceEvents.js";
|
|
16
|
-
import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
|
|
17
|
-
import { SystemEntityContext } from "../system/SystemEntityContext.js";
|
|
18
|
-
import { ActionBehavior } from "../../intelligence/behavior/primitive/ActionBehavior.js";
|
|
19
|
-
import { Blackboard } from "../../intelligence/blackboard/Blackboard.js";
|
|
20
|
-
import { VoiceFlags } from "./VoiceFlags.js";
|
|
21
1
|
import { assert } from "../../../core/assert.js";
|
|
22
2
|
import { weightedRandomFromArray } from "../../../core/collection/array/weightedRandomFromArray.js";
|
|
23
|
-
import
|
|
3
|
+
import Vector2 from "../../../core/geom/Vector2.js";
|
|
4
|
+
import { max2 } from "../../../core/math/max2.js";
|
|
5
|
+
import { ResourceAccessKind } from "../../../core/model/ResourceAccessKind.js";
|
|
6
|
+
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
24
7
|
import { DomSizeObserver } from "../../../view/util/DomSizeObserver.js";
|
|
25
|
-
import { SpeechBubbleView } from "./SpeechBubbleView.js";
|
|
26
|
-
import { AnimationBehavior } from "../../animation/keyed2/behavior/AnimationBehavior.js";
|
|
27
8
|
import AnimationTrack from "../../animation/keyed2/AnimationTrack.js";
|
|
28
|
-
import TransitionFunctions from "../../animation/TransitionFunctions.js";
|
|
29
9
|
import AnimationTrackPlayback from "../../animation/keyed2/AnimationTrackPlayback.js";
|
|
10
|
+
import { AnimationBehavior } from "../../animation/keyed2/behavior/AnimationBehavior.js";
|
|
11
|
+
import TransitionFunctions from "../../animation/TransitionFunctions.js";
|
|
12
|
+
import { GameAssetType } from "../../asset/GameAssetType.js";
|
|
13
|
+
import { SequenceBehavior } from "../../intelligence/behavior/composite/SequenceBehavior.js";
|
|
14
|
+
import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
15
|
+
import { DieBehavior } from "../../intelligence/behavior/ecs/DieBehavior.js";
|
|
16
|
+
import { ActionBehavior } from "../../intelligence/behavior/primitive/ActionBehavior.js";
|
|
17
|
+
import { DelayBehavior } from "../../intelligence/behavior/util/DelayBehavior.js";
|
|
18
|
+
import { Blackboard } from "../../intelligence/blackboard/Blackboard.js";
|
|
30
19
|
import { globalMetrics } from "../../metrics/GlobalMetrics.js";
|
|
31
20
|
import { MetricsCategory } from "../../metrics/MetricsCategory.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
21
|
+
import { Attachment } from "../attachment/Attachment.js";
|
|
22
|
+
import { SerializationMetadata } from "../components/SerializationMetadata.js";
|
|
23
|
+
import Entity from "../Entity.js";
|
|
34
24
|
import { EntityFlags } from "../EntityFlags.js";
|
|
25
|
+
import GUIElement from "../gui/GUIElement.js";
|
|
26
|
+
import HeadsUpDisplay from "../gui/hud/HeadsUpDisplay.js";
|
|
27
|
+
import ViewportPosition from "../gui/position/ViewportPosition.js";
|
|
28
|
+
import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
|
|
29
|
+
import { SystemEntityContext } from "../system/SystemEntityContext.js";
|
|
30
|
+
import { Transform } from "../transform/Transform.js";
|
|
31
|
+
import { SpeechBubbleView } from "./SpeechBubbleView.js";
|
|
32
|
+
import { Voice } from "./Voice.js";
|
|
33
|
+
import { VoiceEvents } from "./VoiceEvents.js";
|
|
34
|
+
import { VoiceFlags } from "./VoiceFlags.js";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Delay before the user notices the text and begins to read
|
|
@@ -94,21 +94,18 @@ class LineWeigher {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
class Context extends SystemEntityContext {
|
|
97
|
-
constructor() {
|
|
98
|
-
super();
|
|
99
97
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @type {LineDescription}
|
|
101
|
+
*/
|
|
102
|
+
active_line = null;
|
|
105
103
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
104
|
+
/**
|
|
105
|
+
*
|
|
106
|
+
* @type {Entity}
|
|
107
|
+
*/
|
|
108
|
+
active_executor = null;
|
|
112
109
|
|
|
113
110
|
handleSpeakLineEvent({ id }) {
|
|
114
111
|
this.system.sayLine(this.entity, id, this.components[0]);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
1
2
|
import Task from "../../../core/process/task/Task.js";
|
|
2
3
|
import { TaskSignal } from "../../../core/process/task/TaskSignal.js";
|
|
3
|
-
import {
|
|
4
|
+
import { emptyTask } from "../../../core/process/task/util/emptyTask.js";
|
|
4
5
|
import { BinaryCollectionDeSerializer } from "./binary/collection/BinaryCollectionDeSerializer.js";
|
|
5
6
|
import { BinaryObjectSerializationAdapter } from "./binary/object/BinaryObjectSerializationAdapter.js";
|
|
6
|
-
import { emptyTask } from "../../../core/process/task/util/emptyTask.js";
|
|
7
7
|
|
|
8
8
|
class BinaryBufferDeSerializer {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.registry = null;
|
|
15
|
-
}
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {BinarySerializationRegistry}
|
|
12
|
+
*/
|
|
13
|
+
registry = null;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
16
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SerializationFlags, SerializationMetadata } from "../components/SerializationMetadata.js";
|
|
2
1
|
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { current_time_in_seconds } from "../../../core/time/current_time_in_seconds.js";
|
|
3
|
+
import { logger } from "../../logging/GlobalLogger.js";
|
|
4
|
+
import { SerializationFlags, SerializationMetadata } from "../components/SerializationMetadata.js";
|
|
3
5
|
import { BinaryCollectionSerializer } from "./binary/collection/BinaryCollectionSerializer.js";
|
|
4
|
-
import { COMPONENT_SERIALIZATION_TRANSIENT_FIELD } from "./COMPONENT_SERIALIZATION_TRANSIENT_FIELD.js";
|
|
5
6
|
import { BinaryObjectSerializationAdapter } from "./binary/object/BinaryObjectSerializationAdapter.js";
|
|
6
|
-
import {
|
|
7
|
-
import { current_time_in_seconds } from "../../../core/time/current_time_in_seconds.js";
|
|
7
|
+
import { COMPONENT_SERIALIZATION_TRANSIENT_FIELD } from "./COMPONENT_SERIALIZATION_TRANSIENT_FIELD.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @template T
|
|
@@ -50,18 +50,17 @@ function isEntityTransient(entity, dataset, smComponentIndex, componentInstance)
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
class BinaryBufferSerializer {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @type {BinarySerializationRegistry}
|
|
56
|
+
*/
|
|
57
|
+
registry = null;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @type {Engine|null}
|
|
62
|
+
*/
|
|
63
|
+
engine = null;
|
|
65
64
|
|
|
66
65
|
/**
|
|
67
66
|
*
|