@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.
Files changed (107) hide show
  1. package/core/bvh2/bvh3/{bvh_query_user_data_by_frustum.js → bvh_query_user_data_overlaps_frustum.js} +4 -5
  2. package/core/bvh2/traversal/ThreeClippingPlaneComputingBVHVisitor.js +1 -1
  3. package/core/color/Color.js +54 -3
  4. package/core/color/hsv2rgb.js +3 -3
  5. package/core/color/kelvin_to_rgb.js +51 -0
  6. package/core/color/kelvin_to_rgb.spec.js +61 -0
  7. package/core/color/linear_to_sRGB.js +17 -0
  8. package/core/color/prototype_kelvin_to_rgb.js +44 -0
  9. package/core/color/rgb_to_kelvin.js +34 -0
  10. package/core/color/rgb_to_kelvin.spec.js +15 -0
  11. package/core/color/sRGB_to_linear.js +16 -0
  12. package/core/geom/3d/frustum/read_frustum_planes_to_array.d.ts +3 -0
  13. package/{engine/graphics/render/forward_plus/cluster → core/geom/3d/frustum}/read_frustum_planes_to_array.js +1 -1
  14. package/core/geom/3d/line/line3_computeSegmentPointDistance_sqr.js +2 -2
  15. package/core/geom/LineSegment.js +2 -2
  16. package/core/geom/Vector3.js +14 -0
  17. package/core/math/DEG_TO_RAD.js +1 -0
  18. package/core/math/MathUtils.spec.js +0 -13
  19. package/core/math/RAD_TO_DEG.js +1 -0
  20. package/core/math/clamp01.js +15 -0
  21. package/core/math/fract.js +10 -0
  22. package/core/math/newton_solver_1d.js +21 -0
  23. package/core/math/smoothStep.js +3 -3
  24. package/core/math/solveQuadratic.js +32 -12
  25. package/core/math/solveQuadratic.spec.js +18 -0
  26. package/core/primitives/strings/StringUtils.js +10 -0
  27. package/core/process/task/TaskUtils.js +2 -2
  28. package/editor/view/ecs/components/color/GaugeView.js +2 -2
  29. package/editor/view/ecs/components/particles/ColorParameterLUTController.js +5 -4
  30. package/editor/view/ecs/components/particles/ScalarParameterLUTController.js +5 -3
  31. package/engine/Clock.js +4 -0
  32. package/engine/UserController.js +2 -1
  33. package/engine/animation/behavior/animateProperty.js +6 -1
  34. package/engine/animation/keyed2/behavior/AnimationBehavior.js +0 -1
  35. package/engine/ecs/EntityBuilder.js +12 -1
  36. package/engine/ecs/animation/OneBoneSurfaceAlignmentSolver.js +2 -1
  37. package/engine/ecs/animation/TwoBoneInverseKinematicsSolver.js +2 -1
  38. package/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js +14 -11
  39. package/engine/ecs/systems/AimControllerSystem.js +3 -2
  40. package/engine/ecs/systems/RangedAttackSystem.js +3 -2
  41. package/engine/ecs/systems/SteeringSystem.js +3 -3
  42. package/engine/ecs/terrain/ecs/ClingToTerrainSystem.js +2 -2
  43. package/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js +2 -2
  44. package/engine/graphics/GraphicsEngine.js +2 -1
  45. package/engine/graphics/camera/CameraShake.js +4 -4
  46. package/engine/graphics/ecs/animation/animator/graph/AnimationTransition.js +2 -2
  47. package/engine/graphics/ecs/camera/TiltCameraController.js +3 -2
  48. package/engine/graphics/ecs/compileAllMaterials.js +2 -2
  49. package/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +14 -24
  50. package/engine/graphics/ecs/light/LightSystem.js +2 -3
  51. package/engine/graphics/ecs/mesh/createTaskWaitForMeshesToLoad.js +2 -2
  52. package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +6 -0
  53. package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +19 -0
  54. package/engine/graphics/ecs/mesh-v2/render/ShadedGeometryRendererContext.js +4 -2
  55. package/engine/graphics/ecs/mesh-v2/render/optimization/RuntimeDrawMethodOptimizer.js +6 -0
  56. package/engine/graphics/geometry/instancing/InstancedMeshGroup.js +31 -0
  57. package/engine/graphics/micron/build/fill_patch_geometry_data.js +2 -2
  58. package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +5 -3
  59. package/engine/graphics/render/forward_plus/LightManager.js +1 -1
  60. package/engine/graphics/render/gizmo/Gizmo.js +3 -0
  61. package/engine/graphics/render/gizmo/GizmoRenderingPlugin.js +5 -0
  62. package/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.js +91 -0
  63. package/engine/graphics/render/view/CameraView.js +1 -1
  64. package/engine/graphics/texture/sampler/Sampler2D.js +110 -18
  65. package/engine/graphics/three/OrbitControls.js +3 -2
  66. package/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js +2 -2
  67. package/engine/graphics/util/makeMeshPreviewScene.js +11 -3
  68. package/engine/intelligence/behavior/Behavior.js +36 -17
  69. package/engine/intelligence/behavior/SelectorBehavior.js +6 -5
  70. package/engine/intelligence/behavior/composite/ParallelBehavior.js +0 -66
  71. package/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.js +63 -0
  72. package/engine/intelligence/behavior/composite/SequenceBehavior.js +36 -11
  73. package/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +0 -2
  74. package/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.js +2 -4
  75. package/engine/intelligence/behavior/decorator/InverterBehavior.js +3 -3
  76. package/engine/intelligence/behavior/decorator/RepeatBehavior.js +0 -35
  77. package/engine/intelligence/behavior/decorator/RepeatBehavior.spec.js +0 -10
  78. package/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.js +37 -0
  79. package/engine/intelligence/behavior/decorator/RepeatUntilFailureBehavior.js +0 -3
  80. package/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +5 -10
  81. package/engine/intelligence/behavior/ecs/BehaviorComponent.js +95 -7
  82. package/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js +15 -8
  83. package/engine/intelligence/behavior/ecs/BehaviorSystem.js +28 -37
  84. package/engine/intelligence/behavior/ecs/DieBehavior.js +2 -7
  85. package/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +2 -29
  86. package/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.js +29 -0
  87. package/engine/intelligence/behavior/primitive/ActionBehavior.js +6 -13
  88. package/engine/intelligence/behavior/primitive/FailingBehavior.js +1 -29
  89. package/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.js +29 -0
  90. package/engine/intelligence/behavior/primitive/PromiseBehavior.js +15 -3
  91. package/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +1 -5
  92. package/engine/intelligence/behavior/util/ConditionBehavior.js +1 -3
  93. package/engine/intelligence/behavior/util/ConditionBehavior.spec.js +1 -7
  94. package/engine/intelligence/behavior/util/ConditionalBehavior.js +3 -6
  95. package/engine/intelligence/behavior/util/DelayBehavior.js +2 -4
  96. package/engine/intelligence/behavior/util/SelectorBehavior.js +13 -12
  97. package/engine/intelligence/blackboard/AbstractBlackboard.js +16 -2
  98. package/engine/plugin/EnginePluginManager.js +4 -14
  99. package/engine/sound/ecs/emitter/SoundEmitter.js +3 -0
  100. package/generation/filtering/numeric/math/CellFilterSaturate.js +2 -2
  101. package/generation/grid/generation/GridTaskDensityMarkerDistribution.js +3 -2
  102. package/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.spec.js +1 -1
  103. package/generation/rules/CellMatcherLayerBitMaskTest.js +3 -3
  104. package/package.json +1 -1
  105. package/view/elements/progress/SmoothProgressBar.js +2 -2
  106. package/view/elements/progress/segmented/SegmentedResourceBarView.js +3 -3
  107. 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 = clamp(x / x_max, 0, 1);
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 = clamp(y / y_max, 0, 1);
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.27",
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 = clamp(value / max, 0, 1);
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 = clamp(v / m, 0, 1);
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 = clamp(total_current / m, 0, 1);
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 = clamp(value / limit, 0, 1);
49
+ const n0 = clamp01(value / limit);
50
50
 
51
51
  const a0 = 0;
52
52
  const a1 = n0 * Math.PI * 2;