@woosh/meep-engine 2.75.8 → 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.
Files changed (77) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/build/meep.cjs +784 -982
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +784 -982
  5. package/editor/actions/concrete/ModifyPatchSampler2DAction.js +6 -3
  6. package/editor/actions/concrete/PatchTerrainTextureAction.js +6 -3
  7. package/editor/process/EditorProcess.js +12 -16
  8. package/editor/process/ProcessEngine.js +9 -10
  9. package/package.json +1 -1
  10. package/src/core/binary/dec2hex.js +1 -1
  11. package/src/{engine/ecs/ik/IKMath.js → core/geom/vec3/v3_computeOffsetVector.js} +1 -1
  12. package/src/core/math/newton_solver_1d.js +13 -4
  13. package/src/core/math/solveQuadratic.js +5 -3
  14. package/src/core/math/spline/catmull_rom_compute_T.js +19 -0
  15. package/src/{engine/navigation/ecs/components → core/math/spline}/computeCatmullRomSpline.js +3 -3
  16. package/src/{engine/navigation/ecs/components → core/math/spline}/computeCatmullRomSplineUniformDistance.js +3 -3
  17. package/src/core/math/spline/computeNonuniformCatmullRomSplineSample.js +109 -0
  18. package/src/core/math/spline/interpolate_bicubic.js +12 -0
  19. package/src/core/math/spline/spline_catmullrom_1d.js +120 -0
  20. package/src/engine/control/ControlContext.js +25 -27
  21. package/src/engine/ecs/EntityManager.js +12 -9
  22. package/src/engine/ecs/EntityObserver.js +26 -22
  23. package/src/engine/ecs/binding/ComponentPropertyPath.js +12 -12
  24. package/src/engine/ecs/components/Motion.js +5 -7
  25. package/src/engine/ecs/components/SerializationMetadata.js +5 -3
  26. package/src/engine/ecs/dynamic_actions/actions/definition/AbstractActionDescription.js +0 -2
  27. package/src/engine/ecs/dynamic_actions/actions/definition/ActionSequenceDescription.js +7 -9
  28. package/src/engine/ecs/dynamic_actions/actions/definition/DelayActionDescription.js +3 -5
  29. package/src/engine/ecs/dynamic_actions/actions/definition/SendRequestActionDescription.js +6 -8
  30. package/src/engine/ecs/dynamic_actions/actions/definition/SpeakLineActionDescription.js +14 -17
  31. package/src/engine/ecs/dynamic_actions/actions/definition/WeightedRandomActionDescription.js +8 -11
  32. package/src/engine/ecs/dynamic_actions/actions/definition/WriteToBlackboardActionDescription.js +15 -18
  33. package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.js +7 -7
  34. package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.js +6 -6
  35. package/src/engine/ecs/parent/EntityNode.js +39 -37
  36. package/src/engine/ecs/speaker/VoiceSystem.js +36 -39
  37. package/src/engine/ecs/system/SystemEntityContext.js +25 -23
  38. package/src/engine/ecs/tag/find_entities_with_tag.js +18 -0
  39. package/src/engine/ecs/terrain/TerrainClouds.js +23 -24
  40. package/src/engine/ecs/terrain/ecs/splat/SplatMapMaterialPatch.js +5 -2
  41. package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +15 -14
  42. package/src/engine/ecs/tooltip/TooltipComponent.js +6 -7
  43. package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -4
  44. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -5
  45. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +2 -6
  46. package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +12 -14
  47. package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +22 -20
  48. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +3 -4
  49. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -4
  50. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -4
  51. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -4
  52. package/src/engine/graphics/shadows/testShadowMapRendering.js +0 -2
  53. package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -11
  54. package/src/engine/graphics/texture/sampler/Sampler2D.js +15 -366
  55. package/src/engine/graphics/texture/sampler/Sampler2D.spec.js +0 -31
  56. package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +166 -0
  57. package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.spec.js +31 -0
  58. package/src/engine/graphics/texture/sampler/sampler2d_paint.js +81 -0
  59. package/src/engine/graphics/texture/sampler/sampler2d_sub_copy_same_item_size.js +50 -0
  60. package/src/engine/navigation/ecs/components/Path.js +10 -9
  61. package/src/engine/physics/computeInterceptPoint.js +44 -0
  62. package/src/engine/plugin/EnginePlugin.js +1 -2
  63. package/src/engine/ecs/components/AlignToVelocity.js +0 -9
  64. package/src/engine/ecs/components/CharacterController.js +0 -31
  65. package/src/engine/ecs/components/PhysicalBody.js +0 -51
  66. package/src/engine/ecs/components/Steering.js +0 -111
  67. package/src/engine/ecs/components/SteeringSerializationAdapter.js +0 -34
  68. package/src/engine/ecs/systems/AlignToVelocitySystem.js +0 -51
  69. package/src/engine/ecs/systems/CharacterControlSystem.js +0 -134
  70. package/src/engine/ecs/systems/PhysicsSystem.js +0 -89
  71. package/src/engine/ecs/systems/PropertySetSystem.js +0 -18
  72. package/src/engine/ecs/systems/SteeringSystem.js +0 -171
  73. package/src/engine/ecs/systems/TagSystem.d.ts +0 -5
  74. package/src/engine/ecs/systems/TagSystem.js +0 -31
  75. package/src/engine/graphics/texture/sampler/bicubic.js +0 -59
  76. package/src/engine/graphics/texture/sampler/bicubic.spec.js +0 -13
  77. package/src/engine/navigation/ecs/components/computeNonuniformCatmullRomSplineSample.js +0 -242
@@ -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
- * Path to the property
11
- * @type {string}
12
- */
13
- this.path = "";
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
- constructor() {
11
- /**
12
- * @readonly
13
- * @type {Vector3}
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 {
@@ -3,10 +3,12 @@ export const SerializationFlags = {
3
3
  };
4
4
 
5
5
  export class SerializationMetadata {
6
- constructor() {
7
- this.flags = 0;
8
- }
9
6
 
7
+ /**
8
+ *
9
+ * @type {number}
10
+ */
11
+ flags = 0;
10
12
 
11
13
  /**
12
14
  *
@@ -1,6 +1,4 @@
1
1
  export class AbstractActionDescription {
2
- constructor() {
3
- }
4
2
 
5
3
  /**
6
4
  * Main entry point
@@ -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
- * @type {AbstractActionDescription[]}
11
- */
12
- this.elements = [];
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
- this.time = 0;
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 { compileReactiveExpression } from "../../../../../core/lang/reactive/compileReactiveExpression.js";
5
+ import { AbstractActionDescription } from "./AbstractActionDescription.js";
6
6
 
7
7
  export class SendRequestActionDescription extends AbstractActionDescription {
8
- constructor() {
9
- super();
10
8
 
11
- this.distance = Number.POSITIVE_INFINITY;
12
- this.responders = 1;
13
- this.context = {};
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 { AbstractActionDescription } from "./AbstractActionDescription.js";
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 { SendEventBehavior } from "../../../../../../../model/game/util/behavior/SendEventBehavior.js";
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
- * @type {string}
18
- */
19
- this.id = "";
13
+ /**
14
+ *
15
+ * @type {string}
16
+ */
17
+ id = "";
20
18
 
21
- this.isGroup = false;
19
+ isGroup = false;
22
20
 
23
- /**
24
- * If override is on, will request speaking a line even if another line is currently being spoken
25
- * @type {boolean}
26
- */
27
- this.override = false;
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;
@@ -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
- * @type {WeightedElement<AbstractActionDescription>[]}
13
- */
14
- this.elements = [];
15
- }
8
+ /**
9
+ *
10
+ * @type {WeightedElement<AbstractActionDescription>[]}
11
+ */
12
+ elements = [];
16
13
 
17
14
  execute(actor, dataset, context, system) {
18
15
 
@@ -1,25 +1,22 @@
1
- import { AbstractActionDescription } from "./AbstractActionDescription.js";
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 { compileReactiveExpression } from "../../../../../core/lang/reactive/compileReactiveExpression.js";
5
- import { assert } from "../../../../../core/assert.js";
5
+ import { AbstractActionDescription } from "./AbstractActionDescription.js";
6
6
 
7
7
  export class WriteToBlackboardActionDescription extends AbstractActionDescription {
8
- constructor() {
9
- super();
10
-
11
- /**
12
- *
13
- * @type {ReactiveExpression}
14
- */
15
- this.expression = null;
16
-
17
- /**
18
- *
19
- * @type {string}
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 { v3_computeOffsetVector } from "./IKMath.js";
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 { GameAssetType } from "../../asset/GameAssetType.js";
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 { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
33
- import { ResourceAccessKind } from "../../../core/model/ResourceAccessKind.js";
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
- * @type {LineDescription}
103
- */
104
- this.active_line = null;
98
+ /**
99
+ *
100
+ * @type {LineDescription}
101
+ */
102
+ active_line = null;
105
103
 
106
- /**
107
- *
108
- * @type {Entity}
109
- */
110
- this.active_executor = null;
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,27 +1,29 @@
1
1
  export class SystemEntityContext {
2
- constructor() {
3
-
4
- this.entity = -1;
5
-
6
- /**
7
- * Pointer back to the system
8
- * @type {System}
9
- */
10
- this.system = null;
11
-
12
- /**
13
- *
14
- * @type {*[]}
15
- */
16
- this.components = [];
17
-
18
- /**
19
- *
20
- * @type {boolean}
21
- * @protected
22
- */
23
- this.__is_linked = false;
24
- }
2
+
3
+ /**
4
+ *
5
+ * @type {number}
6
+ */
7
+ entity = -1;
8
+
9
+ /**
10
+ * Pointer back to the system
11
+ * @type {System}
12
+ */
13
+ system = null;
14
+
15
+ /**
16
+ *
17
+ * @type {*[]}
18
+ */
19
+ components = [];
20
+
21
+ /**
22
+ *
23
+ * @type {boolean}
24
+ * @protected
25
+ */
26
+ __is_linked = false;
25
27
 
26
28
  /**
27
29
  *
@@ -0,0 +1,18 @@
1
+ import Tag from "../components/Tag.js";
2
+
3
+ /**
4
+ *
5
+ * @param {string} tag
6
+ * @param {EntityComponentDataset} ecd
7
+ * @returns {number[]}
8
+ */
9
+ export function find_entities_with_tag(tag, ecd) {
10
+ const r = [];
11
+ ecd.traverseComponents(Tag, (t, e) => {
12
+ if (t.contains(tag)) {
13
+ r.push(e);
14
+ }
15
+ });
16
+
17
+ return r;
18
+ }
@@ -3,8 +3,8 @@
3
3
  */
4
4
 
5
5
 
6
- import Vector2 from '../../../core/geom/Vector2.js';
7
6
  import { RepeatWrapping, TextureLoader } from "three";
7
+ import Vector2 from '../../../core/geom/Vector2.js';
8
8
 
9
9
  const texture_cache = new Map();
10
10
 
@@ -33,31 +33,30 @@ function loadCloudTexture(url) {
33
33
 
34
34
 
35
35
  class Clouds {
36
- constructor() {
37
- /**
38
- *
39
- * @type {boolean}
40
- * @private
41
- */
42
- this.__enabled = false;
43
- /**
44
- *
45
- * @type {Array}
46
- * @private
47
- */
48
- this.materials = [];
49
- this.time = 0;
50
-
51
-
52
- this.__speed0 = new Vector2();
53
- this.__speed1 = new Vector2();
54
- this.__speed2 = new Vector2();
55
-
56
- //how fast clouds reform
57
- this.variability = 0.37;
36
+ /**
37
+ *
38
+ * @type {boolean}
39
+ * @private
40
+ */
41
+ __enabled = false;
42
+ /**
43
+ *
44
+ * @type {Array}
45
+ * @private
46
+ */
47
+ materials = [];
48
+ time = 0;
58
49
 
59
- this.setSpeed(0.5, -0.5);
60
50
 
51
+ __speed0 = new Vector2();
52
+ __speed1 = new Vector2();
53
+ __speed2 = new Vector2();
54
+
55
+ //how fast clouds reform
56
+ variability = 0.37;
57
+
58
+ constructor() {
59
+ this.setSpeed(0.5, -0.5);
61
60
  }
62
61
 
63
62
  /**
@@ -3,6 +3,9 @@ import AABB2 from "../../../../../core/geom/AABB2.js";
3
3
  import { max2 } from "../../../../../core/math/max2.js";
4
4
  import { min2 } from "../../../../../core/math/min2.js";
5
5
  import { Sampler2D } from "../../../../graphics/texture/sampler/Sampler2D.js";
6
+ import {
7
+ sampler2d_sub_copy_same_item_size
8
+ } from "../../../../graphics/texture/sampler/sampler2d_sub_copy_same_item_size.js";
6
9
 
7
10
  export class SplatMapMaterialPatch {
8
11
  /**
@@ -413,8 +416,8 @@ export class SplatMapMaterialPatch {
413
416
  const target = new Sampler2D(newWeights, 1, nW, nH);
414
417
 
415
418
  //copy both sources to the new weights target
416
- target.copy_sameItemSize(t_Source, 0, 0, nBB_x0 - t_bb.x0, nBB_y0 - t_bb.y0, t_bb.getHeight(), t_bb.getHeight());
417
- target.copy_sameItemSize(o_Source, 0, 0, nBB_x0 - o_bb.x0, nBB_y0 - o_bb.y0, o_bb.getHeight(), o_bb.getHeight());
419
+ sampler2d_sub_copy_same_item_size(target,t_Source, 0, 0, nBB_x0 - t_bb.x0, nBB_y0 - t_bb.y0, t_bb.getHeight(), t_bb.getHeight());
420
+ sampler2d_sub_copy_same_item_size(target,o_Source, 0, 0, nBB_x0 - o_bb.x0, nBB_y0 - o_bb.y0, o_bb.getHeight(), o_bb.getHeight());
418
421
 
419
422
  this.weights = newWeights;
420
423
  }