@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.
- package/build/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +43 -21
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +43 -21
- package/editor/tools/FoliagePaintTool.js +3 -3
- package/editor/tools/GridPaintTool.js +2 -2
- package/package.json +1 -1
- package/src/core/binary/dec2hex.js +9 -0
- package/src/core/binary/hex2dec.js +8 -0
- package/src/core/color/Color.js +8 -0
- package/src/core/color/ColorUtils.js +2 -2
- package/src/core/color/{parseHex.js → hex2rgb.js} +3 -5
- package/src/core/color/rgb2hex.js +1 -4
- package/src/core/geom/3d/aabb/aabb3_intersects_aabb3.js +1 -1
- package/src/core/geom/3d/topology/struct/TopoMesh.js +9 -3
- package/src/core/geom/AABB2.js +1 -1
- package/src/core/geom/Rectangle.js +2 -2
- package/src/core/math/computeGreatestCommonDivisor.js +30 -3
- package/src/core/math/{intersects1D.js → interval/intersects1D.js} +1 -1
- package/src/core/math/{overlap1D.js → interval/overlap1D.js} +1 -1
- package/src/core/math/mix.js +5 -7
- package/src/core/math/random/randomUint8.js +10 -0
- package/src/core/math/spline/spline_bezier3.js +26 -0
- package/src/core/math/spline/spline_bezier3_bounds.js +87 -0
- package/src/core/model/node-graph/node/NodeInstance.js +1 -0
- package/src/core/process/task/Task.js +8 -6
- package/src/engine/achievements/AchievementManager.js +1 -1
- package/src/engine/animation/TransitionFunctions.js +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +93 -1
- package/src/engine/animation/curve/Keyframe.js +20 -0
- package/src/engine/animation/curve/compression/prototypeCurveCompression.js +3 -1
- package/src/engine/ecs/components/MeshCollider.js +5 -0
- package/src/engine/ecs/components/MonsterAI.js +5 -0
- package/src/engine/ecs/fow/shader/FogOfWarRenderer.js +1 -1
- package/src/engine/ecs/guid/GUID.js +257 -0
- package/src/engine/ecs/guid/GUID.spec.js +41 -0
- package/src/engine/ecs/guid/GUIDSerializationAdapter.js +25 -0
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +11 -12
- package/src/engine/ecs/terrain/util/loadVisibleTerrainTiles.js +23 -9
- package/src/engine/graphics/camera/CameraShake.js +1 -1
- package/src/engine/graphics/ecs/camera/CameraClippingPlaneComputer.js +1 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.js +8 -6
- package/src/engine/intelligence/behavior/behavior_to_dot.js +11 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +6 -0
- package/src/engine/intelligence/behavior/util/behavior_traverse_tree.js +35 -0
- package/src/engine/scene/transitionToScene.js +4 -1
- package/src/view/elements/radial/RadialText.js +1 -1
- package/src/core/math/bezierCurve.js +0 -22
- /package/src/core/math/{isValueBetween.js → interval/isValueBetween.js} +0 -0
- /package/src/core/math/{isValueBetween.spec.js → interval/isValueBetween.spec.js} +0 -0
- /package/src/core/math/{isValueBetweenInclusive.js → interval/isValueBetweenInclusive.js} +0 -0
- /package/src/core/math/{isValueBetweenInclusive.spec.js → interval/isValueBetweenInclusive.spec.js} +0 -0
- /package/src/core/math/{overlap1D.spec.js → interval/overlap1D.spec.js} +0 -0
- /package/src/core/math/{cubicCurve.js → spline/cubicCurve.js} +0 -0
- /package/src/core/math/{cubicCurve.spec.js → spline/cubicCurve.spec.js} +0 -0
- /package/src/core/math/{makeCubicCurve.js → spline/makeCubicCurve.js} +0 -0
- /package/src/core/math/{makeCubicCurve.spec.js → spline/makeCubicCurve.spec.js} +0 -0
- /package/src/core/math/{quadraticCurve.js → spline/quadraticCurve.js} +0 -0
- /package/src/core/math/{quadraticCurve.spec.js → spline/quadraticCurve.spec.js} +0 -0
|
@@ -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(
|
|
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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/core/math/{isValueBetweenInclusive.spec.js → interval/isValueBetweenInclusive.spec.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|