@woosh/meep-engine 2.36.27 → 2.36.30
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/core/bvh2/bvh3/{bvh_query_user_data_by_frustum.js → bvh_query_user_data_overlaps_frustum.js} +4 -5
- package/core/bvh2/traversal/ThreeClippingPlaneComputingBVHVisitor.js +1 -1
- package/core/color/Color.js +54 -3
- package/core/color/hsv2rgb.js +3 -3
- package/core/color/kelvin_to_rgb.js +51 -0
- package/core/color/kelvin_to_rgb.spec.js +61 -0
- package/core/color/linear_to_sRGB.js +17 -0
- package/core/color/prototype_kelvin_to_rgb.js +44 -0
- package/core/color/rgb_to_kelvin.js +34 -0
- package/core/color/rgb_to_kelvin.spec.js +15 -0
- package/core/color/sRGB_to_linear.js +16 -0
- package/core/geom/3d/frustum/read_frustum_planes_to_array.d.ts +3 -0
- package/{engine/graphics/render/forward_plus/cluster → core/geom/3d/frustum}/read_frustum_planes_to_array.js +1 -1
- package/core/geom/3d/line/line3_computeSegmentPointDistance_sqr.js +2 -2
- package/core/geom/LineSegment.js +2 -2
- package/core/geom/Vector3.js +14 -0
- package/core/math/DEG_TO_RAD.js +1 -0
- package/core/math/MathUtils.spec.js +0 -13
- package/core/math/RAD_TO_DEG.js +1 -0
- package/core/math/clamp01.js +15 -0
- package/core/math/fract.js +10 -0
- package/core/math/newton_solver_1d.js +21 -0
- package/core/math/smoothStep.js +3 -3
- package/core/math/solveQuadratic.js +32 -12
- package/core/math/solveQuadratic.spec.js +18 -0
- package/core/primitives/strings/StringUtils.js +10 -0
- package/core/process/task/TaskUtils.js +2 -2
- package/editor/view/ecs/components/color/GaugeView.js +2 -2
- package/editor/view/ecs/components/particles/ColorParameterLUTController.js +5 -4
- package/editor/view/ecs/components/particles/ScalarParameterLUTController.js +5 -3
- package/engine/Clock.js +4 -0
- package/engine/UserController.js +2 -1
- package/engine/animation/behavior/animateProperty.js +6 -1
- package/engine/animation/keyed2/behavior/AnimationBehavior.js +0 -1
- package/engine/ecs/EntityBuilder.js +12 -1
- package/engine/ecs/animation/OneBoneSurfaceAlignmentSolver.js +2 -1
- package/engine/ecs/animation/TwoBoneInverseKinematicsSolver.js +2 -1
- package/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js +14 -11
- package/engine/ecs/systems/AimControllerSystem.js +3 -2
- package/engine/ecs/systems/RangedAttackSystem.js +3 -2
- package/engine/ecs/systems/SteeringSystem.js +3 -3
- package/engine/ecs/terrain/ecs/ClingToTerrainSystem.js +2 -2
- package/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js +2 -2
- package/engine/graphics/GraphicsEngine.js +2 -1
- package/engine/graphics/camera/CameraShake.js +4 -4
- package/engine/graphics/ecs/animation/animator/graph/AnimationTransition.js +2 -2
- package/engine/graphics/ecs/camera/TiltCameraController.js +3 -2
- package/engine/graphics/ecs/compileAllMaterials.js +2 -2
- package/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +14 -24
- package/engine/graphics/ecs/light/LightSystem.js +2 -3
- package/engine/graphics/ecs/mesh/createTaskWaitForMeshesToLoad.js +2 -2
- package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +6 -0
- package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +19 -0
- package/engine/graphics/ecs/mesh-v2/render/ShadedGeometryRendererContext.js +4 -2
- package/engine/graphics/ecs/mesh-v2/render/optimization/RuntimeDrawMethodOptimizer.js +6 -0
- package/engine/graphics/geometry/instancing/InstancedMeshGroup.js +31 -0
- package/engine/graphics/micron/build/fill_patch_geometry_data.js +2 -2
- package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +5 -3
- package/engine/graphics/render/forward_plus/LightManager.js +1 -1
- package/engine/graphics/render/gizmo/Gizmo.js +3 -0
- package/engine/graphics/render/gizmo/GizmoRenderingPlugin.js +5 -0
- package/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.js +91 -0
- package/engine/graphics/render/view/CameraView.js +1 -1
- package/engine/graphics/texture/sampler/Sampler2D.js +110 -18
- package/engine/graphics/three/OrbitControls.js +3 -2
- package/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js +2 -2
- package/engine/graphics/util/makeMeshPreviewScene.js +11 -3
- package/engine/intelligence/behavior/Behavior.js +36 -17
- package/engine/intelligence/behavior/SelectorBehavior.js +6 -5
- package/engine/intelligence/behavior/composite/ParallelBehavior.js +0 -66
- package/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.js +63 -0
- package/engine/intelligence/behavior/composite/SequenceBehavior.js +36 -11
- package/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +0 -2
- package/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.js +2 -4
- package/engine/intelligence/behavior/decorator/InverterBehavior.js +3 -3
- package/engine/intelligence/behavior/decorator/RepeatBehavior.js +0 -35
- package/engine/intelligence/behavior/decorator/RepeatBehavior.spec.js +0 -10
- package/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.js +37 -0
- package/engine/intelligence/behavior/decorator/RepeatUntilFailureBehavior.js +0 -3
- package/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +5 -10
- package/engine/intelligence/behavior/ecs/BehaviorComponent.js +95 -7
- package/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js +15 -8
- package/engine/intelligence/behavior/ecs/BehaviorSystem.js +28 -37
- package/engine/intelligence/behavior/ecs/DieBehavior.js +2 -7
- package/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +2 -29
- package/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.js +29 -0
- package/engine/intelligence/behavior/primitive/ActionBehavior.js +6 -13
- package/engine/intelligence/behavior/primitive/FailingBehavior.js +1 -29
- package/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.js +29 -0
- package/engine/intelligence/behavior/primitive/PromiseBehavior.js +15 -3
- package/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +1 -5
- package/engine/intelligence/behavior/util/ConditionBehavior.js +1 -3
- package/engine/intelligence/behavior/util/ConditionBehavior.spec.js +1 -7
- package/engine/intelligence/behavior/util/ConditionalBehavior.js +3 -6
- package/engine/intelligence/behavior/util/DelayBehavior.js +2 -4
- package/engine/intelligence/behavior/util/SelectorBehavior.js +13 -12
- package/engine/intelligence/blackboard/AbstractBlackboard.js +16 -2
- package/engine/plugin/EnginePluginManager.js +4 -14
- package/engine/sound/ecs/emitter/SoundEmitter.js +3 -0
- package/generation/filtering/numeric/math/CellFilterSaturate.js +2 -2
- package/generation/grid/generation/GridTaskDensityMarkerDistribution.js +3 -2
- package/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.spec.js +1 -1
- package/generation/rules/CellMatcherLayerBitMaskTest.js +3 -3
- package/package.json +1 -1
- package/view/elements/progress/SmoothProgressBar.js +2 -2
- package/view/elements/progress/segmented/SegmentedResourceBarView.js +3 -3
- package/view/elements/radial/RadialProgressView.js +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../core/assert.js";
|
|
2
|
-
import { clamp } from "../../core/math/clamp.js";
|
|
3
2
|
import { GridLayerCellMatcher } from "./GridLayerCellMatcher.js";
|
|
3
|
+
import { clamp01 } from "../../core/math/clamp01.js";
|
|
4
4
|
|
|
5
5
|
export class CellMatcherLayerBitMaskTest extends GridLayerCellMatcher {
|
|
6
6
|
constructor() {
|
|
@@ -30,13 +30,13 @@ export class CellMatcherLayerBitMaskTest extends GridLayerCellMatcher {
|
|
|
30
30
|
if (x_max === 0) {
|
|
31
31
|
u = 0;
|
|
32
32
|
} else {
|
|
33
|
-
u =
|
|
33
|
+
u = clamp01(x / x_max);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (y_max === 0) {
|
|
37
37
|
v = 0;
|
|
38
38
|
} else {
|
|
39
|
-
v =
|
|
39
|
+
v = clamp01(y / y_max);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
const _x = Math.round(u * (sampler.width - 1));
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"productName": "Meep",
|
|
6
6
|
"description": "production-ready JavaScript game engine based on Entity Component System Architecture",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.36.
|
|
8
|
+
"version": "2.36.30",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { clamp } from "../../../core/math/clamp.js";
|
|
2
1
|
import View from "../../View.js";
|
|
3
2
|
import dom from "../../DOM.js";
|
|
4
3
|
|
|
5
4
|
import BoundedValue from "../../../core/model/BoundedValue.js";
|
|
6
5
|
import { frameThrottle } from "../../../engine/graphics/FrameThrottle.js";
|
|
7
6
|
import { passThrough } from "../../../core/function/Functions.js";
|
|
7
|
+
import { clamp01 } from "../../../core/math/clamp01.js";
|
|
8
8
|
|
|
9
9
|
function makeTextPercentage(value, max, process) {
|
|
10
10
|
const r = (value / max) * 100;
|
|
@@ -147,7 +147,7 @@ class ProgressBarView extends View {
|
|
|
147
147
|
const style = this.__el_fill.style;
|
|
148
148
|
//sanitize input to be in range 0 to 1
|
|
149
149
|
|
|
150
|
-
const fill =
|
|
150
|
+
const fill = clamp01(value / max);
|
|
151
151
|
|
|
152
152
|
const fill_percent_string = (fill * 100) + "%";
|
|
153
153
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { clamp } from "../../../../core/math/clamp.js";
|
|
2
1
|
import View from "../../../View.js";
|
|
3
2
|
import Vector1 from "../../../../core/geom/Vector1.js";
|
|
4
3
|
import { CanvasView } from "../../CanvasView.js";
|
|
@@ -7,6 +6,7 @@ import { DomSizeObserver } from "../../../util/DomSizeObserver.js";
|
|
|
7
6
|
import { RESOURCE_BAR_SEGMENTS } from "./RESOURCE_BAR_SEGMENTS.js";
|
|
8
7
|
import List from "../../../../core/collection/list/List.js";
|
|
9
8
|
import ListView from "../../../common/ListView.js";
|
|
9
|
+
import { clamp01 } from "../../../../core/math/clamp01.js";
|
|
10
10
|
|
|
11
11
|
export class SegmentedResourceBarView extends View {
|
|
12
12
|
/**
|
|
@@ -283,7 +283,7 @@ export class SegmentedResourceBarView extends View {
|
|
|
283
283
|
|
|
284
284
|
total_current += value;
|
|
285
285
|
|
|
286
|
-
const v_fraction =
|
|
286
|
+
const v_fraction = clamp01(v / m);
|
|
287
287
|
|
|
288
288
|
const fill_view = this.__value_fills[i];
|
|
289
289
|
|
|
@@ -291,7 +291,7 @@ export class SegmentedResourceBarView extends View {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
|
|
294
|
-
const f =
|
|
294
|
+
const f = clamp01(total_current / m);
|
|
295
295
|
|
|
296
296
|
const width = `${f * 100}%`;
|
|
297
297
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import { clamp } from "../../../core/math/clamp.js";
|
|
7
6
|
import View from "../../View.js";
|
|
8
7
|
import SVG from '../../SVG.js';
|
|
9
8
|
|
|
10
9
|
import ObservedValue from "../../../core/model/ObservedValue.js";
|
|
11
10
|
import BoundedValue from "../../../core/model/BoundedValue.js";
|
|
11
|
+
import { clamp01 } from "../../../core/math/clamp01.js";
|
|
12
12
|
|
|
13
13
|
class RadialProgressView extends View {
|
|
14
14
|
constructor(model, options) {
|
|
@@ -46,7 +46,7 @@ class RadialProgressView extends View {
|
|
|
46
46
|
limit = value;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const n0 =
|
|
49
|
+
const n0 = clamp01(value / limit);
|
|
50
50
|
|
|
51
51
|
const a0 = 0;
|
|
52
52
|
const a1 = n0 * Math.PI * 2;
|