@woosh/meep-engine 2.47.34 → 2.47.35

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 (59) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/build/meep.cjs +43 -21
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +43 -21
  5. package/editor/tools/FoliagePaintTool.js +3 -3
  6. package/editor/tools/GridPaintTool.js +2 -2
  7. package/package.json +1 -1
  8. package/src/core/binary/dec2hex.js +9 -0
  9. package/src/core/binary/hex2dec.js +8 -0
  10. package/src/core/color/Color.js +8 -0
  11. package/src/core/color/ColorUtils.js +2 -2
  12. package/src/core/color/{parseHex.js → hex2rgb.js} +3 -5
  13. package/src/core/color/rgb2hex.js +1 -4
  14. package/src/core/geom/3d/aabb/aabb3_intersects_aabb3.js +1 -1
  15. package/src/core/geom/3d/topology/struct/TopoMesh.js +9 -3
  16. package/src/core/geom/AABB2.js +1 -1
  17. package/src/core/geom/Rectangle.js +2 -2
  18. package/src/core/math/computeGreatestCommonDivisor.js +30 -3
  19. package/src/core/math/{intersects1D.js → interval/intersects1D.js} +1 -1
  20. package/src/core/math/{overlap1D.js → interval/overlap1D.js} +1 -1
  21. package/src/core/math/mix.js +5 -7
  22. package/src/core/math/random/randomUint8.js +10 -0
  23. package/src/core/math/spline/spline_bezier3.js +26 -0
  24. package/src/core/math/spline/spline_bezier3_bounds.js +87 -0
  25. package/src/core/model/node-graph/node/NodeInstance.js +1 -0
  26. package/src/core/process/task/Task.js +8 -6
  27. package/src/engine/achievements/AchievementManager.js +1 -1
  28. package/src/engine/animation/TransitionFunctions.js +1 -1
  29. package/src/engine/animation/curve/AnimationCurve.js +93 -1
  30. package/src/engine/animation/curve/Keyframe.js +20 -0
  31. package/src/engine/animation/curve/compression/prototypeCurveCompression.js +3 -1
  32. package/src/engine/ecs/components/MeshCollider.js +5 -0
  33. package/src/engine/ecs/components/MonsterAI.js +5 -0
  34. package/src/engine/ecs/fow/shader/FogOfWarRenderer.js +1 -1
  35. package/src/engine/ecs/guid/GUID.js +257 -0
  36. package/src/engine/ecs/guid/GUID.spec.js +41 -0
  37. package/src/engine/ecs/guid/GUIDSerializationAdapter.js +25 -0
  38. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +11 -12
  39. package/src/engine/ecs/terrain/util/loadVisibleTerrainTiles.js +23 -9
  40. package/src/engine/graphics/camera/CameraShake.js +1 -1
  41. package/src/engine/graphics/ecs/camera/CameraClippingPlaneComputer.js +1 -1
  42. package/src/engine/graphics/ecs/decal/v2/Decal.js +8 -6
  43. package/src/engine/intelligence/behavior/behavior_to_dot.js +11 -1
  44. package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +6 -0
  45. package/src/engine/intelligence/behavior/util/behavior_traverse_tree.js +35 -0
  46. package/src/engine/scene/transitionToScene.js +4 -1
  47. package/src/view/elements/radial/RadialText.js +1 -1
  48. package/src/core/math/bezierCurve.js +0 -22
  49. /package/src/core/math/{isValueBetween.js → interval/isValueBetween.js} +0 -0
  50. /package/src/core/math/{isValueBetween.spec.js → interval/isValueBetween.spec.js} +0 -0
  51. /package/src/core/math/{isValueBetweenInclusive.js → interval/isValueBetweenInclusive.js} +0 -0
  52. /package/src/core/math/{isValueBetweenInclusive.spec.js → interval/isValueBetweenInclusive.spec.js} +0 -0
  53. /package/src/core/math/{overlap1D.spec.js → interval/overlap1D.spec.js} +0 -0
  54. /package/src/core/math/{cubicCurve.js → spline/cubicCurve.js} +0 -0
  55. /package/src/core/math/{cubicCurve.spec.js → spline/cubicCurve.spec.js} +0 -0
  56. /package/src/core/math/{makeCubicCurve.js → spline/makeCubicCurve.js} +0 -0
  57. /package/src/core/math/{makeCubicCurve.spec.js → spline/makeCubicCurve.spec.js} +0 -0
  58. /package/src/core/math/{quadraticCurve.js → spline/quadraticCurve.js} +0 -0
  59. /package/src/core/math/{quadraticCurve.spec.js → spline/quadraticCurve.spec.js} +0 -0
@@ -44,3 +44,9 @@ export class AbstractDecoratorBehavior extends Behavior {
44
44
  this.__source.finalize();
45
45
  }
46
46
  }
47
+
48
+ /**
49
+ * @readonly
50
+ * @type {boolean}
51
+ */
52
+ AbstractDecoratorBehavior.prototype.isDecoratorBehavior = true;
@@ -0,0 +1,35 @@
1
+ /**
2
+ *
3
+ * @param {Behavior} root
4
+ * @param {function(Behavior):boolean?} visitor
5
+ * @param {*} [thisArg]
6
+ */
7
+ export function behavior_traverse_tree(root, visitor, thisArg) {
8
+
9
+ const should_continue = visitor.call(thisArg, root);
10
+
11
+ if (should_continue === false) {
12
+ // terminate traversal
13
+ return;
14
+ }
15
+
16
+ if (root.isCompositeBehavior === true) {
17
+
18
+ const children = root.getChildren();
19
+
20
+ const child_count = children.length;
21
+
22
+ for (let i = 0; i < child_count; i++) {
23
+ const child = children[i];
24
+
25
+ behavior_traverse_tree(child, visitor, thisArg);
26
+ }
27
+ }
28
+
29
+ if (root.isCompositeBehavior === true) {
30
+
31
+ const source = root.getSource();
32
+ behavior_traverse_tree(source, visitor, thisArg);
33
+ }
34
+
35
+ }
@@ -31,7 +31,10 @@ export function transitionToScene({ tasks = [], scene, engine, name }) {
31
31
 
32
32
 
33
33
  //wait for visible terrain tiles to be loaded
34
- const tWaitForVisibleTerrainTiles = wrapTaskIgnoreFailure(loadVisibleTerrainTiles(engine.entityManager, scene.dataset));
34
+ const tWaitForVisibleTerrainTiles = wrapTaskIgnoreFailure(loadVisibleTerrainTiles({
35
+ em: engine.entityManager,
36
+ ecd: scene.dataset
37
+ }));
35
38
  tWaitForVisibleTerrainTiles.name = "Waiting for visible terrain tiles";
36
39
 
37
40
  tWaitForVisibleTerrainTiles.addDependencies(tasks);
@@ -1,7 +1,7 @@
1
1
  import View from "../../View.js";
2
2
  import SVG, { svgCircularPath } from "../../SVG.js";
3
3
  import { assert } from "../../../core/assert.js";
4
- import { isValueBetween } from "../../../core/math/isValueBetween.js";
4
+ import { isValueBetween } from "../../../core/math/interval/isValueBetween.js";
5
5
  import { PI2 } from "../../../core/math/PI2.js";
6
6
 
7
7
  let idCount = 0;
@@ -1,22 +0,0 @@
1
- /**
2
- * 3-rd degree bezier curve
3
- * @param {number} t
4
- * @param {number} p0 start point
5
- * @param {number} p1 control point
6
- * @param {number} p2 control point
7
- * @param {number} p3 end point
8
- * @returns {number}
9
- */
10
- function bezierCurve(t, p0, p1, p2, p3) {
11
- const nt = 1 - t;
12
-
13
- const nt_2 = nt * nt;
14
-
15
- const nt_3 = nt_2 * nt;
16
-
17
- const t_2 = t * t;
18
-
19
- const t_3 = t_2 * t;
20
-
21
- return nt_3 * p0 + 3 * nt_2 * t * p1 + 3 * nt * t_2 * p2 + t_3 * p3;
22
- }