@woosh/meep-engine 2.120.4 → 2.121.0

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 (68) hide show
  1. package/README.md +36 -9
  2. package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
  3. package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
  4. package/editor/view/node-graph/NodeView.d.ts.map +1 -1
  5. package/editor/view/node-graph/PortView.d.ts.map +1 -1
  6. package/package.json +1 -1
  7. package/src/core/codegen/LineBuilder.d.ts +2 -2
  8. package/src/core/codegen/LineBuilder.d.ts.map +1 -1
  9. package/src/core/codegen/LineBuilder.js +14 -9
  10. package/src/core/collection/array/array_set_diff_sorting.d.ts +1 -1
  11. package/src/core/collection/array/array_set_diff_sorting.js +1 -1
  12. package/src/core/color/oklab/find_cusp.d.ts.map +1 -1
  13. package/src/core/color/oklab/find_cusp.js +4 -1
  14. package/src/core/color/oklab/oklab_to_linear_srgb.d.ts.map +1 -1
  15. package/src/core/color/oklab/oklab_to_linear_srgb.js +1 -0
  16. package/src/core/color/operations/color_lighten.d.ts +1 -1
  17. package/src/core/color/operations/color_lighten.d.ts.map +1 -1
  18. package/src/core/color/operations/color_lighten.js +6 -1
  19. package/src/core/geom/Vector1.d.ts.map +1 -1
  20. package/src/core/geom/Vector1.js +15 -2
  21. package/src/core/process/action/AsynchronousDelayAction.js +1 -1
  22. package/src/engine/EntityCreator.js +1 -1
  23. package/src/engine/achievements/AchievementManager.js +1 -1
  24. package/src/engine/animation/AnimationUtils.js +1 -1
  25. package/src/engine/animation/async/prototypeAsyncAnimation.js +2 -2
  26. package/src/engine/animation/behavior/animateProperty.js +1 -1
  27. package/src/engine/animation/playTrackRealTime.js +1 -1
  28. package/src/engine/ecs/Entity.d.ts.map +1 -1
  29. package/src/engine/ecs/Entity.js +18 -7
  30. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  31. package/src/engine/ecs/EntityComponentDataset.js +14 -7
  32. package/src/engine/ecs/EntityReference.d.ts +4 -4
  33. package/src/engine/ecs/EntityReference.js +4 -4
  34. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +1 -1
  35. package/src/engine/ecs/speaker/VoiceSystem.d.ts +8 -2
  36. package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
  37. package/src/engine/ecs/speaker/VoiceSystem.js +1 -1
  38. package/src/engine/ecs/util/hideEntityGracefully.js +3 -3
  39. package/src/engine/graphics/ecs/camera/filter/setup_filtered_camera_controller.d.ts.map +1 -1
  40. package/src/engine/graphics/ecs/camera/filter/setup_filtered_camera_controller.js +6 -6
  41. package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +1 -1
  42. package/src/engine/graphics/ecs/mesh-v2/aggregate/prototypeSGMesh.js +1 -1
  43. package/src/engine/graphics/ecs/mesh-v2/sample/prototypeShadedGeometry.js +2 -2
  44. package/src/engine/graphics/ecs/mesh-v2/sample/prototype_sg_raycast.js +1 -1
  45. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
  46. package/src/engine/graphics/ecs/trail2d/prototypeTrail2D.js +1 -1
  47. package/src/engine/graphics/impostors/octahedral/prototypeBaker.js +1 -1
  48. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
  49. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +4 -4
  50. package/src/engine/graphics/sh3/path_tracer/make_one_vector3.d.ts.map +1 -1
  51. package/src/engine/graphics/sh3/path_tracer/make_sky_hosek.d.ts.map +1 -1
  52. package/src/engine/graphics/sh3/path_tracer/make_sky_rtiw.d.ts.map +1 -1
  53. package/src/engine/graphics/sh3/path_tracer/make_zero_vector3.d.ts.map +1 -1
  54. package/src/engine/input/devices/PointerDevice.js +1 -1
  55. package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts +79 -3
  56. package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts.map +1 -1
  57. package/src/engine/intelligence/behavior/ecs/BehaviorComponent.js +24 -8
  58. package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.d.ts.map +1 -1
  59. package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js +2 -2
  60. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +33 -7
  61. package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +3 -2
  62. package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts.map +1 -1
  63. package/src/engine/intelligence/behavior/primitive/ActionBehavior.js +7 -5
  64. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +10 -9
  65. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts.map +1 -1
  66. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.js +19 -20
  67. package/src/engine/physics/fluid/prototype.js +1 -1
  68. package/src/engine/physics/inverse_kinematics/fabrik/prototype.js +1 -1
@@ -1,13 +1,13 @@
1
1
  /**
2
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
3
+ * Lets us uniquely distinguish between two entities, even those with the same ID that were created at different times
4
4
  *
5
5
  * @example
6
6
  * // 1. Get your EntityComponentDataset to where you manager entities.
7
- * const ecd = ... ; //EntityComponentDataset
7
+ * const ecd = ... ; // EntityComponentDataset
8
8
  *
9
- * // 2. Create an entity (we'll get an ID). Or use an existing one.
10
- * const entityId = ecd.createEntity(); // Let's say this returns ID 1, generation 0
9
+ * // 2. Create an entity (we'll get an ID).
10
+ * const entityId = ecd.createEntity();
11
11
  *
12
12
  * // 3. Create an EntityReference and bind it to the entity.
13
13
  * const entityRef = EntityReference.bind(ecd, entityId);
@@ -2,14 +2,14 @@ import { assert } from "../../core/assert.js";
2
2
 
3
3
  /**
4
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
5
+ * Lets us uniquely distinguish between two entities, even those with the same ID that were created at different times
6
6
  *
7
7
  * @example
8
8
  * // 1. Get your EntityComponentDataset to where you manager entities.
9
- * const ecd = ... ; //EntityComponentDataset
9
+ * const ecd = ... ; // EntityComponentDataset
10
10
  *
11
- * // 2. Create an entity (we'll get an ID). Or use an existing one.
12
- * const entityId = ecd.createEntity(); // Let's say this returns ID 1, generation 0
11
+ * // 2. Create an entity (we'll get an ID).
12
+ * const entityId = ecd.createEntity();
13
13
  *
14
14
  * // 3. Create an EntityReference and bind it to the entity.
15
15
  * const entityRef = EntityReference.bind(ecd, entityId);
@@ -264,7 +264,7 @@ export class DynamicActorSystem extends AbstractContextSystem {
264
264
  const behavior = rule.action.execute(entity, ecd, context, this);
265
265
 
266
266
  const entity_builder = new Entity()
267
- .add(BehaviorComponent.fromOne(SequenceBehavior.from([
267
+ .add(BehaviorComponent.from(SequenceBehavior.from([
268
268
  OverrideContextBehavior.from(
269
269
  {
270
270
  entity
@@ -9,7 +9,7 @@ export class VoiceSystem extends AbstractContextSystem<any> {
9
9
  font_size: number;
10
10
  });
11
11
  dependencies: (typeof Voice)[];
12
- components_used: ResourceAccessSpecification<typeof BehaviorComponent>[];
12
+ components_used: (ResourceAccessSpecification<typeof GUIElement> | ResourceAccessSpecification<typeof Transform> | ResourceAccessSpecification<typeof ViewportPosition> | ResourceAccessSpecification<typeof HeadsUpDisplay> | ResourceAccessSpecification<typeof Attachment> | ResourceAccessSpecification<typeof SerializationMetadata> | ResourceAccessSpecification<typeof BehaviorComponent>)[];
13
13
  /**
14
14
  *
15
15
  * @type {Localization}
@@ -100,6 +100,12 @@ export class VoiceSystem extends AbstractContextSystem<any> {
100
100
  }
101
101
  import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
102
102
  import { Voice } from "./Voice.js";
103
- import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
103
+ import GUIElement from "../gui/GUIElement.js";
104
104
  import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
105
+ import { Transform } from "../transform/Transform.js";
106
+ import ViewportPosition from "../gui/position/ViewportPosition.js";
107
+ import HeadsUpDisplay from "../gui/hud/HeadsUpDisplay.js";
108
+ import { Attachment } from "../attachment/Attachment.js";
109
+ import { SerializationMetadata } from "../components/SerializationMetadata.js";
110
+ import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
105
111
  //# sourceMappingURL=VoiceSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VoiceSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/speaker/VoiceSystem.js"],"names":[],"mappings":"AA2JA;IACI;;;;OAIG;IACH,oBAHW,MAAM;;;OA8FhB;IArFG,+BAA2B;IAE3B,yEAQC;IAGD;;;OAGG;IACH,aAFU,YAAY,CAEC;IAEvB;;;OAGG;IACH,KAFU,SAAS,CAEJ;IAEf;;;OAGG;IACH,OAFU,oBAAoB,CAEb;IAEjB;;;OAGG;IACH,MAFU,uBAAuB,CAEjB;IAEhB;;;OAGG;IACH,QAFU,MAAM,CAEI;IAEpB;;;;OAIG;IACH,iCAAyC;IAEzC;;;;OAIG;IACH,kBAAkC;IAIlC;;;;OAIG;IACH,eAAkB;IAElB;;;;OAIG;IACH,oBAAgC;IAEhC;;;OAGG;IACH,oBAAqC;IAErC;;;;OAIG;IACH,gBAAoB;IAGxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED,0EAuBC;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,MAAM,SACN,KAAK,QAsBf;IAED;;;;;OAKG;IACH,wBAoBC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,WACN,MAAM,SACN,KAAK,QAuHf;CACJ;sCAxbqC,oCAAoC;sBAIpD,YAAY;kCAlBA,sDAAsD;4CAR5C,oDAAoD"}
1
+ {"version":3,"file":"VoiceSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/speaker/VoiceSystem.js"],"names":[],"mappings":"AA2JA;IACI;;;;OAIG;IACH,oBAHW,MAAM;;;OA8FhB;IArFG,+BAA2B;IAE3B,qYAQC;IAGD;;;OAGG;IACH,aAFU,YAAY,CAEC;IAEvB;;;OAGG;IACH,KAFU,SAAS,CAEJ;IAEf;;;OAGG;IACH,OAFU,oBAAoB,CAEb;IAEjB;;;OAGG;IACH,MAFU,uBAAuB,CAEjB;IAEhB;;;OAGG;IACH,QAFU,MAAM,CAEI;IAEpB;;;;OAIG;IACH,iCAAyC;IAEzC;;;;OAIG;IACH,kBAAkC;IAIlC;;;;OAIG;IACH,eAAkB;IAElB;;;;OAIG;IACH,oBAAgC;IAEhC;;;OAGG;IACH,oBAAqC;IAErC;;;;OAIG;IACH,gBAAoB;IAGxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED,0EAuBC;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,MAAM,SACN,KAAK,QAsBf;IAED;;;;;OAKG;IACH,wBAoBC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,WACN,MAAM,SACN,KAAK,QAuHf;CACJ;sCAxbqC,oCAAoC;sBAIpD,YAAY;uBAPX,sBAAsB;4CAnBD,oDAAoD;0BAwBtE,2BAA2B;6BAHxB,qCAAqC;2BADvC,8BAA8B;2BAL9B,6BAA6B;sCAClB,wCAAwC;kCAR5C,sDAAsD"}
@@ -423,7 +423,7 @@ export class VoiceSystem extends AbstractContextSystem {
423
423
  immediate: true
424
424
  }))
425
425
  .add(SerializationMetadata.Transient)
426
- .add(BehaviorComponent.fromOne(SequenceBehavior.from([
426
+ .add(BehaviorComponent.from(SequenceBehavior.from([
427
427
  // play intro animation
428
428
  new AnimationBehavior(new AnimationTrackPlayback(SPEECH_BUBBLE_ANIMATION_INTRO, bubble_animation_update_function, view)),
429
429
  // wait for a certain amount of time
@@ -81,7 +81,7 @@ addShutdown(Mesh, (mesh, builder, createEntity, createEntityThisArg) => {
81
81
 
82
82
  const eb = createEntity.call(createEntityThisArg);
83
83
 
84
- eb.add(BehaviorComponent.fromOne(SequenceBehavior.from([
84
+ eb.add(BehaviorComponent.from(SequenceBehavior.from([
85
85
  scale,
86
86
  DieBehavior.create()
87
87
  ])));
@@ -104,7 +104,7 @@ addShutdown(Light, (light, builder, createEntity, createEntityThisArg) => {
104
104
 
105
105
  const eb = createEntity.call(createEntityThisArg);
106
106
 
107
- eb.add(BehaviorComponent.fromOne(SequenceBehavior.from([
107
+ eb.add(BehaviorComponent.from(SequenceBehavior.from([
108
108
  TransitionPropertyVectorXBehavior.from({
109
109
  component: 'Light',
110
110
  path: 'intensity',
@@ -146,7 +146,7 @@ addShutdown(SoundEmitter, (soundEmitter, builder, createEntity, createEntityThis
146
146
 
147
147
  const eb = createEntity.call(createEntityThisArg);
148
148
 
149
- eb.add(BehaviorComponent.fromOne(SequenceBehavior.from([
149
+ eb.add(BehaviorComponent.from(SequenceBehavior.from([
150
150
  DelayBehavior.from(SHUTDOWN_GRACE_PERIOD - setVolume.duration),
151
151
  setVolume,
152
152
  DieBehavior.create()
@@ -1 +1 @@
1
- {"version":3,"file":"setup_filtered_camera_controller.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/camera/filter/setup_filtered_camera_controller.js"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,2FANW,uBAAuB,GAIrB;IAAC,UAAU,EAAC,uBAAuB,CAAC;IAAC,MAAM,EAAC,MAAM,CAAA;CAAC,CA6D/D;oCA5EmC,uCAAuC;mBACxD,2BAA2B"}
1
+ {"version":3,"file":"setup_filtered_camera_controller.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/camera/filter/setup_filtered_camera_controller.js"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,2FANW,uBAAuB,GAIrB;IAAC,UAAU,EAAC,uBAAuB,CAAC;IAAC,MAAM,EAAC,MAAM,CAAA;CAAC,CA6D/D;oCArEmC,uCAAuC;mBAJxD,2BAA2B"}
@@ -1,12 +1,12 @@
1
1
  import { assert } from "../../../../../core/assert.js";
2
- import TopDownCameraController from "../topdown/TopDownCameraController.js";
2
+ import { clamp01 } from "../../../../../core/math/clamp01.js";
3
+ import { lerp } from "../../../../../core/math/lerp.js";
4
+ import { SerializationMetadata } from "../../../../ecs/components/SerializationMetadata.js";
3
5
  import Entity from "../../../../ecs/Entity.js";
4
- import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
5
6
  import { RepeatBehavior } from "../../../../intelligence/behavior/decorator/RepeatBehavior.js";
7
+ import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
6
8
  import { ActionBehavior } from "../../../../intelligence/behavior/primitive/ActionBehavior.js";
7
- import { SerializationMetadata } from "../../../../ecs/components/SerializationMetadata.js";
8
- import { clamp01 } from "../../../../../core/math/clamp01.js";
9
- import { lerp } from "../../../../../core/math/lerp.js";
9
+ import TopDownCameraController from "../topdown/TopDownCameraController.js";
10
10
 
11
11
  /**
12
12
  *
@@ -36,7 +36,7 @@ export function setup_filtered_camera_controller({
36
36
  const entityBuilder = new Entity();
37
37
 
38
38
  entityBuilder
39
- .add(BehaviorComponent.fromOne(
39
+ .add(BehaviorComponent.from(
40
40
  RepeatBehavior.from(
41
41
  new ActionBehavior(time_delta => {
42
42
  if (!remembered_value.equals(target)) {
@@ -372,7 +372,7 @@ function makeNormalTestDecal() {
372
372
  .add(ShadedGeometry.from(DEBUG_BOX, new LineBasicMaterial(), DrawMode.LineSegments))
373
373
  .add(transform)
374
374
  .add(decal)
375
- .add(BehaviorComponent.fromOne(RotationBehavior.fromJSON({ speed: 1, axis: Vector3.left })))
375
+ .add(BehaviorComponent.from(RotationBehavior.fromJSON({ speed: 1, axis: Vector3.left })))
376
376
 
377
377
  return entity;
378
378
  }
@@ -110,7 +110,7 @@ function make_grid(ecd, engine) {
110
110
  new Entity()
111
111
  .add(mesh)
112
112
  .add(transform)
113
- .add(BehaviorComponent.fromOne(
113
+ .add(BehaviorComponent.from(
114
114
  orbitingBehavior
115
115
  // RepeatBehavior.from(
116
116
  // new ActionBehavior((t) => {
@@ -43,7 +43,7 @@ function makeMovingShadedGeometry() {
43
43
  return new Entity()
44
44
  .add(new Transform())
45
45
  .add(sg)
46
- .add(BehaviorComponent.fromOne(b));
46
+ .add(BehaviorComponent.from(b));
47
47
  }
48
48
 
49
49
  /**
@@ -126,7 +126,7 @@ async function main(engine) {
126
126
  let iterator = 0;
127
127
 
128
128
  new Entity()
129
- .add(BehaviorComponent.fromOne(
129
+ .add(BehaviorComponent.from(
130
130
  RepeatBehavior.from(SequenceBehavior.from([
131
131
  DelayBehavior.from(0.001),
132
132
  RepeatBehavior.from(new ActionBehavior(() => {
@@ -50,7 +50,7 @@ function makeMovingShadedGeometry() {
50
50
  return new Entity()
51
51
  .add(new Transform())
52
52
  .add(sg)
53
- .add(BehaviorComponent.fromOne(b));
53
+ .add(BehaviorComponent.from(b));
54
54
  }
55
55
 
56
56
  /**
@@ -371,7 +371,7 @@ function main(engine) {
371
371
 
372
372
  let time = 0;
373
373
  new Entity()
374
- .add(BehaviorComponent.looping_function((delta) => {
374
+ .add(BehaviorComponent.loop((delta) => {
375
375
  time += delta * 0.01;
376
376
 
377
377
  const segment_count = 23;
@@ -38,7 +38,7 @@ async function main(engine) {
38
38
  entity.add(Transform.fromJSON({
39
39
  position: { x, y, z }
40
40
  }));
41
- entity.add(BehaviorComponent.fromOne(OrbitingBehavior.from({
41
+ entity.add(BehaviorComponent.from(OrbitingBehavior.from({
42
42
  center: new Vector3(x,y,z),
43
43
  radius: 0.1-0.02
44
44
  })))
@@ -149,7 +149,7 @@ function make_spin(entity, speed = 1, axis = Vector3.up) {
149
149
  return;
150
150
  }
151
151
 
152
- entity.add(BehaviorComponent.fromOne(RotationBehavior.fromJSON({
152
+ entity.add(BehaviorComponent.from(RotationBehavior.fromJSON({
153
153
  axis, speed
154
154
  })));
155
155
  }
@@ -994,7 +994,7 @@ function make_box_editor(engine, transform = new Transform()) {
994
994
  }
995
995
  }
996
996
  ]))
997
- .add(BehaviorComponent.looping_function(() => {
997
+ .add(BehaviorComponent.loop(() => {
998
998
 
999
999
  threeUpdateTransform(controls);
1000
1000
 
@@ -1210,7 +1210,7 @@ async function make_demo_volume({
1210
1210
  v.attributes.color.lookup = lut;
1211
1211
 
1212
1212
  new Entity()
1213
- .add(BehaviorComponent.fromOne(RepeatBehavior.from(new ActionBehavior((time) => {
1213
+ .add(BehaviorComponent.from(RepeatBehavior.from(new ActionBehavior((time) => {
1214
1214
  time_total += time;
1215
1215
 
1216
1216
  const _t = pingpong(time_total + period_offset, period);
@@ -338,7 +338,7 @@ function setup_scene_0(engine, ecd) {
338
338
  b.offset.copy(transform.position);
339
339
 
340
340
  builder
341
- .add(BehaviorComponent.fromOne(b))
341
+ .add(BehaviorComponent.from(b))
342
342
  .build(ecd);
343
343
  }
344
344
 
@@ -647,8 +647,8 @@ function setup_scene_3(engine, ecd) {
647
647
 
648
648
 
649
649
  builder
650
- .add(BehaviorComponent.fromOne(b))
651
- // .add(BehaviorComponent.looping_function(()=>{
650
+ .add(BehaviorComponent.from(b))
651
+ // .add(BehaviorComponent.loop(()=>{
652
652
  //
653
653
  // }))
654
654
  .build(ecd);
@@ -953,7 +953,7 @@ function setup_scene_2(engine, ecd) {
953
953
  b.offset.copy(transform.position);
954
954
 
955
955
  builder
956
- .add(BehaviorComponent.fromOne(b))
956
+ .add(BehaviorComponent.from(b))
957
957
  .build(ecd);
958
958
  }
959
959
 
@@ -1 +1 @@
1
- {"version":3,"file":"make_one_vector3.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_one_vector3.js"],"names":[],"mappings":"AAAA,+GAEC;AACD,iIAMC"}
1
+ {"version":3,"file":"make_one_vector3.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_one_vector3.js"],"names":[],"mappings":"AAAA,+GAEC;AACD,uDACY,QAAG,EAAE,eAAU,EAAE,cAAS,EAAE,qBAAgB,UAKvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"make_sky_hosek.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_sky_hosek.js"],"names":[],"mappings":"AAQA,2LAmCC"}
1
+ {"version":3,"file":"make_sky_hosek.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_sky_hosek.js"],"names":[],"mappings":"AAQA,2GAaY,WAAM,EAAE,kBAAa,EAAE,cAAS,EAAE,qBAAgB,UAsB7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"make_sky_rtiw.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_sky_rtiw.js"],"names":[],"mappings":"AAEA,4GAYC"}
1
+ {"version":3,"file":"make_sky_rtiw.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_sky_rtiw.js"],"names":[],"mappings":"AAEA,kCAGY,QAAG,EAAE,eAAU,EAAE,cAAS,EAAE,qBAAgB,UASvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"make_zero_vector3.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_zero_vector3.js"],"names":[],"mappings":"AAAA,gHAMC"}
1
+ {"version":3,"file":"make_zero_vector3.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/path_tracer/make_zero_vector3.js"],"names":[],"mappings":"AAAA,sCACY,QAAG,EAAE,eAAU,EAAE,cAAS,EAAE,qBAAgB,UAKvD"}
@@ -344,7 +344,7 @@ export class PointerDevice {
344
344
 
345
345
  /**
346
346
  *
347
- * @param {MouseEvent} event
347
+ * @param {PointerEvent} event
348
348
  */
349
349
  #eventHandlerGlobalPointerUp = (event) => {
350
350
  this.readPointerPositionFromEvent(this.position, event);
@@ -1,3 +1,79 @@
1
- export class BehaviorComponent {
2
-
3
- }
1
+ /**
2
+ * ECS wrapper around a {@link Behavior} tree
3
+ */
4
+ export class BehaviorComponent {
5
+ /**
6
+ * Executes input function every update cycle.
7
+ * Will run forever.
8
+ * @param {function(time_delta_seconds:number)} action function to loop over
9
+ * @param {*} [thisArg]
10
+ * @returns {BehaviorComponent}
11
+ */
12
+ static loop(action: any, thisArg?: any): BehaviorComponent;
13
+ /**
14
+ *
15
+ * @param {Behavior} b
16
+ * @returns {BehaviorComponent}
17
+ */
18
+ static from(b: Behavior): BehaviorComponent;
19
+ /**
20
+ * What clock should be used for ticking associated behavior
21
+ * @type {ClockChannelType|number}
22
+ */
23
+ clock: ClockChannelType | number;
24
+ /**
25
+ *
26
+ * @type {number}
27
+ */
28
+ flags: number;
29
+ /**
30
+ * Associated behavior tree
31
+ * @type {Behavior|null}
32
+ * @private
33
+ */
34
+ private __behavior;
35
+ /**
36
+ *
37
+ * @param {number|BehaviorComponentFlag} flag
38
+ * @returns {void}
39
+ */
40
+ setFlag(flag: number | BehaviorComponentFlag): void;
41
+ /**
42
+ *
43
+ * @param {number|BehaviorComponentFlag} flag
44
+ * @returns {void}
45
+ */
46
+ clearFlag(flag: number | BehaviorComponentFlag): void;
47
+ /**
48
+ *
49
+ * @param {number|BehaviorComponentFlag} flag
50
+ * @param {boolean} value
51
+ */
52
+ writeFlag(flag: number | BehaviorComponentFlag, value: boolean): void;
53
+ /**
54
+ *
55
+ * @param {number|BehaviorComponentFlag} flag
56
+ * @returns {boolean}
57
+ */
58
+ getFlag(flag: number | BehaviorComponentFlag): boolean;
59
+ /**
60
+ *
61
+ * @param {Behavior} v
62
+ */
63
+ set behavior(v: Behavior);
64
+ /**
65
+ *
66
+ * @returns {Behavior|null}
67
+ */
68
+ get behavior(): Behavior | null;
69
+ }
70
+ export namespace BehaviorComponent {
71
+ import fromOne = BehaviorComponent.from;
72
+ export { fromOne };
73
+ import looping_function = BehaviorComponent.loop;
74
+ export { looping_function };
75
+ export let serializable: boolean;
76
+ export let typeName: string;
77
+ }
78
+ import { ClockChannelType } from "./ClockChannelType.js";
79
+ //# sourceMappingURL=BehaviorComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BehaviorComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorComponent.js"],"names":[],"mappings":"AAKA;IA6EI;;;;;OAKG;IACH,0CAHW,GAAC,GACC,iBAAiB,CAM7B;IAED;;;;OAIG;IACH,kBAHW,QAAQ,GACN,iBAAiB,CAa7B;IAvGD;;;OAGG;IACH,OAFU,gBAAgB,GAAC,MAAM,CAEG;IAEpC;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,mBAAkB;IAElB;;;;OAIG;IACH,cAHW,MAAM,GAAC,qBAAqB,GAC1B,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,qBAAqB,GAC1B,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,qBAAqB,SAC5B,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,qBAAqB,GAC1B,OAAO,CAInB;IAUD;;;OAGG;IACH,gBAFW,QAAQ,EAIlB;IAdD;;;OAGG;IACH,gBAFa,QAAQ,GAAC,IAAI,CAIzB;CAuCJ;;sBAIS,OAAO;kBAMP,MAAM;;iCAtHiB,uBAAuB"}
1
+ {"version":3,"file":"BehaviorComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorComponent.js"],"names":[],"mappings":"AAKA;;GAEG;AACH;IA6EI;;;;;;OAMG;IACH,mCAHW,GAAC,GACC,iBAAiB,CAQ7B;IAED;;;;OAIG;IACH,eAHW,QAAQ,GACN,iBAAiB,CAa7B;IA1GD;;;OAGG;IACH,OAFU,gBAAgB,GAAC,MAAM,CAEG;IAEpC;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,mBAAkB;IAElB;;;;OAIG;IACH,cAHW,MAAM,GAAC,qBAAqB,GAC1B,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,qBAAqB,GAC1B,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,qBAAqB,SAC5B,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,qBAAqB,GAC1B,OAAO,CAInB;IAUD;;;OAGG;IACH,gBAFW,QAAQ,EAIlB;IAdD;;;OAGG;IACH,gBAFa,QAAQ,GAAC,IAAI,CAIzB;CA0CJ;;;;;;6BAcS,OAAO;yBAMP,MAAM;;iCAtIiB,uBAAuB"}
@@ -3,6 +3,9 @@ import { RepeatBehavior } from "../decorator/RepeatBehavior.js";
3
3
  import { ActionBehavior } from "../primitive/ActionBehavior.js";
4
4
  import { ClockChannelType } from "./ClockChannelType.js";
5
5
 
6
+ /**
7
+ * ECS wrapper around a {@link Behavior} tree
8
+ */
6
9
  export class BehaviorComponent {
7
10
 
8
11
  /**
@@ -18,7 +21,7 @@ export class BehaviorComponent {
18
21
  flags = 0;
19
22
 
20
23
  /**
21
- *
24
+ * Associated behavior tree
22
25
  * @type {Behavior|null}
23
26
  * @private
24
27
  */
@@ -81,15 +84,18 @@ export class BehaviorComponent {
81
84
  }
82
85
 
83
86
  /**
84
- * Executes input function every update cycle
85
- * @param {function(time_delta_seconds:number)} f
87
+ * Executes input function every update cycle.
88
+ * Will run forever.
89
+ * @param {function(time_delta_seconds:number)} action function to loop over
86
90
  * @param {*} [thisArg]
87
91
  * @returns {BehaviorComponent}
88
92
  */
89
- static looping_function(f, thisArg) {
90
- return BehaviorComponent.fromOne(RepeatBehavior.from(
91
- new ActionBehavior(f, thisArg)
92
- ));
93
+ static loop(action, thisArg) {
94
+ return BehaviorComponent.from(
95
+ RepeatBehavior.from(
96
+ new ActionBehavior(action, thisArg)
97
+ )
98
+ );
93
99
  }
94
100
 
95
101
  /**
@@ -97,7 +103,7 @@ export class BehaviorComponent {
97
103
  * @param {Behavior} b
98
104
  * @returns {BehaviorComponent}
99
105
  */
100
- static fromOne(b) {
106
+ static from(b) {
101
107
  assert.defined(b, 'behavior');
102
108
  assert.notNull(b, 'behavior');
103
109
  assert.equal(b.isBehavior, true, 'b.isBehavior !== true');
@@ -111,6 +117,16 @@ export class BehaviorComponent {
111
117
  }
112
118
  }
113
119
 
120
+ /**
121
+ * @deprecated use {@link BehaviorComponent.from} instead
122
+ */
123
+ BehaviorComponent.fromOne = BehaviorComponent.from;
124
+
125
+ /**
126
+ * @deprecated use {@link BehaviorComponent.loop} instead
127
+ */
128
+ BehaviorComponent.looping_function = BehaviorComponent.loop;
129
+
114
130
  /**
115
131
  * @readonly
116
132
  * @type {boolean}
@@ -1 +1 @@
1
- {"version":3,"file":"BehaviorComponentSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js"],"names":[],"mappings":"AAKA;IAEI,gCAA0B;IAG1B;;;OAGG;IACH,eAFU,gCAAgC,CAErB;IAErB;;;;OAIG;IACH,mBAHW,cAAc,iBACd,gCAAgC,QAI1C;IAED;;;;OAIG;IACH,kBAHW,YAAY,SACZ,iBAAiB,QAc3B;IAED;;;;OAIG;IACH,oBAHW,YAAY,SACZ,iBAAiB,QA+B3B;CACJ;gDA/E+C,gEAAgE;kCAC9E,wBAAwB"}
1
+ {"version":3,"file":"BehaviorComponentSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js"],"names":[],"mappings":"AAKA;IAEI,gCAA0B;IAG1B;;;OAGG;IACH,eAFU,gCAAgC,CAErB;IAErB;;;;OAIG;IACH,mBAHW,cAAc,iBACd,gCAAgC,QAI1C;IAED;;;;OAIG;IACH,kBAHW,YAAY,SACZ,iBAAiB,QAc3B;IAED;;;;OAIG;IACH,oBAHW,YAAY,SACZ,iBAAiB,QA+B3B;CACJ;gDA/E+C,gEAAgE;kCAG9E,wBAAwB"}
@@ -1,7 +1,7 @@
1
1
  import { BinaryClassSerializationAdapter } from "../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
2
- import { BehaviorComponent } from "./BehaviorComponent.js";
3
2
  import { SequenceBehavior } from "../composite/SequenceBehavior.js";
4
3
  import { SucceedingBehavior } from "../primitive/SucceedingBehavior.js";
4
+ import { BehaviorComponent } from "./BehaviorComponent.js";
5
5
 
6
6
  export class BehaviorComponentSerializationAdapter extends BinaryClassSerializationAdapter {
7
7
 
@@ -74,7 +74,7 @@ export class BehaviorComponentSerializationAdapter extends BinaryClassSerializat
74
74
  } else if (behaviors.length === 1) {
75
75
  value.behavior = behaviors[0];
76
76
  } else {
77
- value.behavior = SucceedingBehavior.from(0);
77
+ value.behavior = SucceedingBehavior.INSTANCE;
78
78
  }
79
79
  }
80
80
  }
@@ -1,7 +1,33 @@
1
- import {System} from "../../../ecs/System";
2
- import Engine from "../../../Engine";
3
- import {BehaviorComponent} from "./BehaviorComponent";
4
-
5
- export class BehaviorSystem extends System<BehaviorComponent> {
6
- constructor(engine: Engine)
7
- }
1
+ export class BehaviorSystem extends System<any, any, any, any, any> {
2
+ /**
3
+ *
4
+ * @param {Engine} engine
5
+ */
6
+ constructor(engine: Engine);
7
+ dependencies: (typeof BehaviorComponent)[];
8
+ systemClock: Clock;
9
+ /**
10
+ *
11
+ * @type {Engine}
12
+ */
13
+ engine: Engine;
14
+ startup(entityManager: any, readyCallback: any, errorCallback: any): void;
15
+ shutdown(entityManager: any, readyCallback: any, errorCallback: any): void;
16
+ /**
17
+ *
18
+ * @param {BehaviorComponent} component
19
+ * @param {number} entity
20
+ */
21
+ link(component: BehaviorComponent, entity: number): void;
22
+ /**
23
+ *
24
+ * @param {BehaviorComponent} component
25
+ * @param {number} entity
26
+ */
27
+ unlink(component: BehaviorComponent, entity: number): void;
28
+ update(timeDelta: any): void;
29
+ }
30
+ import { System } from "../../../ecs/System.js";
31
+ import { BehaviorComponent } from "./BehaviorComponent.js";
32
+ import Clock from "../../../Clock.js";
33
+ //# sourceMappingURL=BehaviorSystem.d.ts.map
@@ -1,14 +1,15 @@
1
1
  /**
2
+ * Single-shot behavior that executes the given function and resolves {@link BehaviorStatus.SUCCESS}
2
3
  * @template CTX
3
4
  * @extends {Behavior<CTX>}
4
5
  */
5
6
  export class ActionBehavior<CTX> extends Behavior<CTX> {
6
7
  /**
7
8
  *
8
- * @param {function(timeDelta:number, context:CTX)} func
9
+ * @param {function(timeDelta:number, context:CTX)} action
9
10
  * @param {*} [thisArg] defaults to behavior itself if not specified
10
11
  */
11
- constructor(func: any, thisArg?: any);
12
+ constructor(action: any, thisArg?: any);
12
13
  __action: any;
13
14
  __context: any;
14
15
  tick(timeDelta: any): BehaviorStatus.Succeeded | BehaviorStatus.Failed;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/primitive/ActionBehavior.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,4BAHa,GAAG;IAIZ;;;;OAIG;IACH,iCAFW,GAAC,EAcX;IAPG,cAAoB;IAGhB,eAAqB;IAM7B,uEAcC;CACJ;yBA3CwB,gBAAgB;+BACV,sBAAsB"}
1
+ {"version":3,"file":"ActionBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/primitive/ActionBehavior.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,4BAHa,GAAG;IAIZ;;;;OAIG;IACH,mCAFW,GAAC,EAeX;IARG,cAAsB;IAIlB,eAAqB;IAM7B,uEAcC;CACJ;yBA5CwB,gBAAgB;+BACV,sBAAsB"}
@@ -1,25 +1,27 @@
1
+ import { assert } from "../../../../core/assert.js";
1
2
  import { Behavior } from "../Behavior.js";
2
3
  import { BehaviorStatus } from "../BehaviorStatus.js";
3
- import { assert } from "../../../../core/assert.js";
4
4
 
5
5
  /**
6
+ * Single-shot behavior that executes the given function and resolves {@link BehaviorStatus.SUCCESS}
6
7
  * @template CTX
7
8
  * @extends {Behavior<CTX>}
8
9
  */
9
10
  export class ActionBehavior extends Behavior {
10
11
  /**
11
12
  *
12
- * @param {function(timeDelta:number, context:CTX)} func
13
+ * @param {function(timeDelta:number, context:CTX)} action
13
14
  * @param {*} [thisArg] defaults to behavior itself if not specified
14
15
  */
15
- constructor(func, thisArg) {
16
+ constructor(action, thisArg) {
16
17
  super();
17
18
 
18
- assert.typeOf(func, 'function', "action");
19
+ assert.isFunction(action, "action");
19
20
 
20
- this.__action = func;
21
+ this.__action = action;
21
22
 
22
23
  if (thisArg === undefined) {
24
+ // if thisArg is not supplied, will bind to behavior instead
23
25
  this.__context = this;
24
26
  } else {
25
27
  this.__context = thisArg;
@@ -1,21 +1,22 @@
1
1
  /**
2
- * Behavior that always succeeds
2
+ * Behavior that always succeeds.
3
+ * Useful when you need to specify a behavior to fulfill the API, but you don't actually want to perform any action.
4
+ * You usually want to use {@link INSTANCE} singleton
3
5
  */
4
6
  export class SucceedingBehavior extends Behavior<any> {
5
7
  /**
6
8
  * @deprecated use static INSTANCE instead
7
- * @param {number} delayTicks
8
9
  * @return {SucceedingBehavior}
9
10
  */
10
- static from(delayTicks?: number): SucceedingBehavior;
11
- static INSTANCE: SucceedingBehavior;
12
- constructor(delayTicks?: number);
11
+ static from(): SucceedingBehavior;
13
12
  /**
14
- * @deprecated
15
- * @type {number}
13
+ * @readonly
14
+ * @type {SucceedingBehavior}
16
15
  */
17
- delayTicks: number;
18
- tick(timeDelta: any): BehaviorStatus.Running | BehaviorStatus.Succeeded;
16
+ static readonly INSTANCE: SucceedingBehavior;
17
+ constructor();
18
+ initialize(context: any): void;
19
+ tick(timeDelta: any): BehaviorStatus;
19
20
  }
20
21
  export namespace SucceedingBehavior {
21
22
  let typeName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SucceedingBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/primitive/SucceedingBehavior.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAeI;;;;OAIG;IACH,yBAHW,MAAM,GACL,kBAAkB,CAI7B;IAWD,oCAA2C;IAhC3C,iCAYC;IALG;;;OAGG;IACH,YAFU,MAAM,CAEY;IAYhC,wEAOC;CAGJ;;;;yBAxCwB,gBAAgB;+BACV,sBAAsB"}
1
+ {"version":3,"file":"SucceedingBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/primitive/SucceedingBehavior.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH;IAcI;;;OAGG;IACH,eAFY,kBAAkB,CAI7B;IAMD;;;OAGG;IACH,0BAFU,kBAAkB,CAE8B;IA5B1D,cAEC;IAED,+BAEC;IAcD,qCAEC;CAOJ;;;;yBAvCwB,gBAAgB;+BACV,sBAAsB"}