@woosh/meep-engine 2.49.7 → 2.49.9

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 (108) hide show
  1. package/editor/enableEditor.js +1 -8
  2. package/package.json +1 -1
  3. package/samples/terrain/editor.js +2 -2
  4. package/src/core/cache/Cache.js +1 -1
  5. package/src/core/collection/HashSet.js +1 -1
  6. package/src/core/collection/table/RowFirstTableSpec.js +110 -92
  7. package/src/core/collection/table/RowFirstTableSpec.spec.js +49 -0
  8. package/src/core/color/Color.d.ts +4 -2
  9. package/src/core/color/Color.js +7 -8
  10. package/src/core/color/Color.spec.js +93 -0
  11. package/src/core/color/hex2rgb.spec.js +10 -0
  12. package/src/core/color/rgb2hex.js +1 -1
  13. package/src/core/color/rgb2hex.spec.js +13 -0
  14. package/src/core/fsm/simple/SimpleStateMachine.spec.js +75 -0
  15. package/src/core/fsm/simple/SimpleStateMachineDescription.js +1 -1
  16. package/src/core/fsm/simple/SimpleStateMachineDescription.spec.js +32 -0
  17. package/src/core/geom/2d/Rectangle.spec.js +51 -0
  18. package/src/core/geom/3d/aabb/aabb3_intersects_ray.spec.js +90 -0
  19. package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.spec.js +61 -0
  20. package/src/core/geom/3d/morton/mortonEncode_magicbits.js +1 -34
  21. package/src/core/geom/3d/morton/split_by_2.js +17 -0
  22. package/src/core/geom/3d/morton/split_by_3.js +16 -0
  23. package/src/core/geom/3d/plane/computePlaneLineIntersection.js +6 -1
  24. package/src/core/geom/3d/sphere/sphere_intersects_ray.spec.js +11 -0
  25. package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_array_transformed.spec.js +8 -0
  26. package/src/core/geom/3d/topology/samples/sampleFloodFill.js +3 -3
  27. package/src/core/geom/3d/topology/struct/binary/io/OrderedEdge.js +1 -1
  28. package/src/core/geom/random/randomPointOnBox.spec.js +57 -0
  29. package/src/core/math/bessel_i0.spec.js +43 -0
  30. package/src/core/math/bessel_j0.js +30 -0
  31. package/src/core/math/hash/murmur3_32.spec.js +8 -0
  32. package/src/core/math/hash/squirrel3.spec.js +16 -0
  33. package/src/core/math/interval/NumericInterval.js +1 -0
  34. package/src/core/math/{bessel_i0.js → modified_bessel_i0.js} +5 -2
  35. package/src/core/math/noise/{create_noise_2d.js → create_simplex_noise_2d.js} +2 -2
  36. package/src/core/math/noise/create_simplex_noise_2d.spec.js +21 -0
  37. package/src/core/math/normalizeArrayVector.spec.js +15 -0
  38. package/src/core/math/physics/irradiance/interpolate_irradiance_linear.spec.js +20 -0
  39. package/src/core/math/physics/irradiance/interpolate_irradiance_lograrithmic.js +4 -4
  40. package/src/core/math/physics/irradiance/interpolate_irradiance_lograrithmic.spec.js +18 -0
  41. package/src/core/math/physics/irradiance/interpolate_irradiance_smith.js +1 -1
  42. package/src/core/math/physics/irradiance/interpolate_irradiance_smith.spec.js +20 -0
  43. package/src/core/math/random/seededRandomMersenneTwister.spec.js +10 -0
  44. package/src/core/math/spline/spline_bezier3.js +1 -1
  45. package/src/core/math/spline/spline_bezier3_bounds.js +2 -1
  46. package/src/core/math/spline/spline_bezier3_bounds.spec.js +37 -0
  47. package/src/core/math/statistics/computeSampleSize_Cochran.spec.js +12 -0
  48. package/src/core/math/statistics/computeStatisticalPartialMedian.js +4 -0
  49. package/src/core/math/statistics/computeStatisticalPartialMedian.spec.js +13 -0
  50. package/src/engine/Engine.d.ts +4 -2
  51. package/src/engine/Engine.js +62 -41
  52. package/src/engine/Engine.spec.js +11 -0
  53. package/src/engine/InputEngine.js +12 -0
  54. package/src/engine/achievements/Achievement.spec.js +21 -0
  55. package/src/engine/animation/curve/compression/prototypeCurveCompression.js +2 -2
  56. package/src/engine/animation/curve/compression/{animation_curve_to_float_array.js → sample_animation_curve_to_float_array.js} +10 -3
  57. package/src/engine/animation/curve/compression/sample_animation_curve_to_float_array.spec.js +29 -0
  58. package/src/engine/animation/curve/draw/build_curve_editor.js +3 -3
  59. package/src/engine/development/performance/RingBufferMetric.js +1 -1
  60. package/src/engine/ecs/animation/Animation.js +2 -180
  61. package/src/engine/ecs/animation/AnimationClip.js +132 -0
  62. package/src/engine/ecs/animation/AnimationClip.spec.js +5 -0
  63. package/src/engine/ecs/animation/AnimationClipFlag.js +7 -0
  64. package/src/engine/ecs/animation/AnimationFlags.js +8 -0
  65. package/src/engine/ecs/animation/AnimationSerializationAdapter.js +32 -0
  66. package/src/engine/ecs/systems/AnimationSystem.js +3 -1
  67. package/src/engine/graphics/GraphicsEngine.js +2 -13
  68. package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
  69. package/src/engine/graphics/ecs/animation/AnimationControllerSystem.js +2 -1
  70. package/src/engine/graphics/ecs/compileAllMaterials.js +1 -1
  71. package/src/engine/graphics/ecs/mesh/createTaskWaitForMeshesToLoad.js +1 -1
  72. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -1
  73. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
  74. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +1 -1
  75. package/src/engine/graphics/load_and_set_cubemap_v0.js +21 -0
  76. package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +1 -1
  77. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +3 -5
  78. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +3 -5
  79. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +2 -2
  80. package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +1 -1
  81. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +3 -5
  82. package/src/engine/graphics/sh3/prototypeSH3Probe.js +4 -4
  83. package/src/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.js +4 -3
  84. package/src/engine/graphics/texture/sampler/filter/kaiser_1.js +8 -4
  85. package/src/engine/graphics/texture/sampler/filter/kaiser_bessel_window.js +2 -0
  86. package/src/engine/graphics/texture/virtual/VirtualTexture.js +9 -0
  87. package/src/engine/graphics/texture/virtual/VirtualTexture.spec.js +5 -4
  88. package/src/engine/graphics/texture/virtual/tile/TileLoader.js +5 -0
  89. package/src/engine/input/devices/PointerDevice.spec.js +7 -0
  90. package/src/engine/platform/InMemoryEnginePlatform.js +20 -0
  91. package/src/engine/save/Storage.d.ts +7 -7
  92. package/src/engine/save/storage/InMemoryStorage.js +34 -0
  93. package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +11 -4
  94. package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.spec.js +30 -0
  95. package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +18 -2
  96. package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.spec.js +17 -0
  97. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +2 -2
  98. package/src/generation/grid/GridData.js +0 -60
  99. package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +2 -2
  100. /package/src/core/collection/{IteratorUtils.js → collectIteratorValueToArray.js} +0 -0
  101. /package/src/core/color/{ColorUtils.js → parseColor.js} +0 -0
  102. /package/src/engine/ecs/{animation → ik}/IKMath.js +0 -0
  103. /package/src/engine/ecs/{animation → ik}/IKProblem.js +0 -0
  104. /package/src/engine/ecs/{animation → ik}/IKSolver.js +0 -0
  105. /package/src/engine/ecs/{animation → ik}/InverseKinematics.js +0 -0
  106. /package/src/engine/ecs/{animation → ik}/InverseKinematicsSystem.js +0 -0
  107. /package/src/engine/ecs/{animation → ik}/OneBoneSurfaceAlignmentSolver.js +0 -0
  108. /package/src/engine/ecs/{animation → ik}/TwoBoneInverseKinematicsSolver.js +0 -0
@@ -4,157 +4,10 @@
4
4
 
5
5
 
6
6
  import List from '../../../core/collection/list/List.js';
7
- import ObservedString from "../../../core/model/ObservedString.js";
8
- import ObservedInteger from "../../../core/model/ObservedInteger.js";
9
- import Vector1 from "../../../core/geom/Vector1.js";
10
- import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
11
7
  import { computeHashIntegerArray } from "../../../core/collection/array/computeHashIntegerArray.js";
12
8
  import { computeHashFloat } from "../../../core/primitives/numbers/computeHashFloat.js";
13
-
14
- /**
15
- *
16
- * @enum {number}
17
- */
18
- export const AnimationClipFlag = {
19
- ClampWhenFinished: 1
20
- };
21
-
22
- class AnimationClip {
23
- constructor() {
24
- this.name = new ObservedString("");
25
- this.repeatCount = new ObservedInteger(1);
26
-
27
- /**
28
- *
29
- * @type {Vector1}
30
- */
31
- this.weight = new Vector1(1);
32
-
33
- /**
34
- *
35
- * @type {Vector1}
36
- */
37
- this.timeScale = new Vector1(1);
38
-
39
- /**
40
- *
41
- * @type {number}
42
- */
43
- this.flags = 0;
44
- }
45
-
46
- /**
47
- *
48
- * @param {AnimationClip} other
49
- * @returns {boolean}
50
- */
51
- equals(other) {
52
- return this.name.equals(other.name)
53
- && this.repeatCount.equals(other.repeatCount)
54
- && this.weight.equals(other.weight)
55
- && this.timeScale.equals(other.timeScale)
56
- && this.flags === other.flags;
57
- }
58
-
59
- /**
60
- *
61
- * @returns {number}
62
- */
63
- hash() {
64
- return computeHashIntegerArray(
65
- this.name.hash(),
66
- this.repeatCount.hash(),
67
- this.weight.hash(),
68
- this.timeScale.hash(),
69
- this.flags
70
- );
71
- }
72
-
73
- /**
74
- *
75
- * @param {number|AnimationClipFlag} v
76
- * @returns {boolean}
77
- */
78
- getFlag(v) {
79
- return (this.flags & v) !== 0;
80
- }
81
-
82
- fromJSON(json) {
83
- if (typeof json.name === "string") {
84
- this.name.fromJSON(json.name);
85
- }
86
-
87
- if (typeof json.repeatCount === "number") {
88
- this.repeatCount.fromJSON(json.repeatCount);
89
- } else {
90
- this.repeatCount.set(Number.POSITIVE_INFINITY);
91
- }
92
-
93
- if (typeof json.weight === "number") {
94
- this.weight.fromJSON(json.weight);
95
- } else {
96
- this.weight.set(1);
97
- }
98
-
99
- if (typeof json.timeScale === "number") {
100
- this.timeScale.fromJSON(json.timeScale);
101
- } else {
102
- this.timeScale.set(1);
103
- }
104
-
105
- if (typeof json.flags === "number") {
106
- this.flags = json.flags;
107
- } else {
108
- this.flags = 0;
109
- }
110
- }
111
-
112
- toJSON() {
113
- return {
114
- name: this.name.toJSON(),
115
- repeatCount: this.repeatCount.toJSON(),
116
- weight: this.weight.toJSON(),
117
- timeScale: this.timeScale.toJSON(),
118
- flags: this.flags
119
- };
120
- }
121
-
122
- /**
123
- *
124
- * @param {BinaryBuffer} buffer
125
- */
126
- toBinaryBuffer(buffer) {
127
- //write flags
128
- buffer.writeUint8(this.flags);
129
-
130
- this.name.toBinaryBuffer(buffer);
131
- this.repeatCount.toBinaryBuffer(buffer);
132
- this.weight.toBinaryBuffer(buffer);
133
- this.timeScale.toBinaryBuffer(buffer);
134
- }
135
-
136
- /**
137
- *
138
- * @param {BinaryBuffer} buffer
139
- */
140
- fromBinaryBuffer(buffer) {
141
- this.flags = buffer.readUint8();
142
-
143
- this.name.fromBinaryBuffer(buffer);
144
- this.repeatCount.fromBinaryBuffer(buffer);
145
- this.weight.fromBinaryBuffer(buffer);
146
- this.timeScale.fromBinaryBuffer(buffer);
147
- }
148
- }
149
-
150
- /**
151
- *
152
- * @enum {number}
153
- */
154
- export const AnimationFlags = {
155
- Playing: 1,
156
- MeshSizeCulling: 2
157
- };
9
+ import { AnimationClip } from "./AnimationClip.js";
10
+ import { AnimationFlags } from "./AnimationFlags.js";
158
11
 
159
12
  /**
160
13
  * @class
@@ -308,8 +161,6 @@ export class Animation {
308
161
 
309
162
  }
310
163
 
311
- Animation.Clip = AnimationClip;
312
-
313
164
  /**
314
165
  *
315
166
  * @param json
@@ -324,32 +175,3 @@ Animation.fromJSON = function (json) {
324
175
  };
325
176
 
326
177
  Animation.typeName = "Animation";
327
-
328
- export class AnimationSerializationAdapter extends BinaryClassSerializationAdapter {
329
- constructor() {
330
- super();
331
-
332
- this.klass = Animation;
333
- this.version = 0;
334
- }
335
-
336
- /**
337
- *
338
- * @param {BinaryBuffer} buffer
339
- * @param {Animation} value
340
- */
341
- serialize(buffer, value) {
342
- value.clips.toBinaryBuffer(buffer);
343
- buffer.writeFloat64(value.debtTime);
344
- }
345
-
346
- /**
347
- *
348
- * @param {BinaryBuffer} buffer
349
- * @param {Animation} value
350
- */
351
- deserialize(buffer, value) {
352
- value.clips.fromBinaryBuffer(buffer, AnimationClip);
353
- value.debtTime = buffer.readFloat64();
354
- }
355
- }
@@ -0,0 +1,132 @@
1
+ import ObservedString from "../../../core/model/ObservedString.js";
2
+ import ObservedInteger from "../../../core/model/ObservedInteger.js";
3
+ import Vector1 from "../../../core/geom/Vector1.js";
4
+ import { computeHashIntegerArray } from "../../../core/collection/array/computeHashIntegerArray.js";
5
+
6
+ export class AnimationClip {
7
+ constructor() {
8
+ this.name = new ObservedString("");
9
+ this.repeatCount = new ObservedInteger(1);
10
+
11
+ /**
12
+ *
13
+ * @type {Vector1}
14
+ */
15
+ this.weight = new Vector1(1);
16
+
17
+ /**
18
+ *
19
+ * @type {Vector1}
20
+ */
21
+ this.timeScale = new Vector1(1);
22
+
23
+ /**
24
+ *
25
+ * @type {number}
26
+ */
27
+ this.flags = 0;
28
+ }
29
+
30
+ /**
31
+ *
32
+ * @param {AnimationClip} other
33
+ * @returns {boolean}
34
+ */
35
+ equals(other) {
36
+ return this.name.equals(other.name)
37
+ && this.repeatCount.equals(other.repeatCount)
38
+ && this.weight.equals(other.weight)
39
+ && this.timeScale.equals(other.timeScale)
40
+ && this.flags === other.flags;
41
+ }
42
+
43
+ /**
44
+ *
45
+ * @returns {number}
46
+ */
47
+ hash() {
48
+ return computeHashIntegerArray(
49
+ this.name.hash(),
50
+ this.repeatCount.hash(),
51
+ this.weight.hash(),
52
+ this.timeScale.hash(),
53
+ this.flags
54
+ );
55
+ }
56
+
57
+ /**
58
+ *
59
+ * @param {number|AnimationClipFlag} v
60
+ * @returns {boolean}
61
+ */
62
+ getFlag(v) {
63
+ return (this.flags & v) !== 0;
64
+ }
65
+
66
+ fromJSON(json) {
67
+ if (typeof json.name === "string") {
68
+ this.name.fromJSON(json.name);
69
+ }
70
+
71
+ if (typeof json.repeatCount === "number") {
72
+ this.repeatCount.fromJSON(json.repeatCount);
73
+ } else {
74
+ this.repeatCount.set(Number.POSITIVE_INFINITY);
75
+ }
76
+
77
+ if (typeof json.weight === "number") {
78
+ this.weight.fromJSON(json.weight);
79
+ } else {
80
+ this.weight.set(1);
81
+ }
82
+
83
+ if (typeof json.timeScale === "number") {
84
+ this.timeScale.fromJSON(json.timeScale);
85
+ } else {
86
+ this.timeScale.set(1);
87
+ }
88
+
89
+ if (typeof json.flags === "number") {
90
+ this.flags = json.flags;
91
+ } else {
92
+ this.flags = 0;
93
+ }
94
+ }
95
+
96
+ toJSON() {
97
+ return {
98
+ name: this.name.toJSON(),
99
+ repeatCount: this.repeatCount.toJSON(),
100
+ weight: this.weight.toJSON(),
101
+ timeScale: this.timeScale.toJSON(),
102
+ flags: this.flags
103
+ };
104
+ }
105
+
106
+ /**
107
+ *
108
+ * @param {BinaryBuffer} buffer
109
+ */
110
+ toBinaryBuffer(buffer) {
111
+ //write flags
112
+ buffer.writeUint8(this.flags);
113
+
114
+ this.name.toBinaryBuffer(buffer);
115
+ this.repeatCount.toBinaryBuffer(buffer);
116
+ this.weight.toBinaryBuffer(buffer);
117
+ this.timeScale.toBinaryBuffer(buffer);
118
+ }
119
+
120
+ /**
121
+ *
122
+ * @param {BinaryBuffer} buffer
123
+ */
124
+ fromBinaryBuffer(buffer) {
125
+ this.flags = buffer.readUint8();
126
+
127
+ this.name.fromBinaryBuffer(buffer);
128
+ this.repeatCount.fromBinaryBuffer(buffer);
129
+ this.weight.fromBinaryBuffer(buffer);
130
+ this.timeScale.fromBinaryBuffer(buffer);
131
+ }
132
+ }
@@ -0,0 +1,5 @@
1
+ import { AnimationClip } from "./AnimationClip.js";
2
+
3
+ test("constructor does not throw", () => {
4
+ expect(() => new AnimationClip()).not.toThrow();
5
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @enum {number}
4
+ */
5
+ export const AnimationClipFlag = {
6
+ ClampWhenFinished: 1
7
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @enum {number}
4
+ */
5
+ export const AnimationFlags = {
6
+ Playing: 1,
7
+ MeshSizeCulling: 2
8
+ };
@@ -0,0 +1,32 @@
1
+ import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
2
+ import { AnimationClip } from "./AnimationClip.js";
3
+ import { Animation } from "./Animation.js";
4
+
5
+ export class AnimationSerializationAdapter extends BinaryClassSerializationAdapter {
6
+ constructor() {
7
+ super();
8
+
9
+ this.klass = Animation;
10
+ this.version = 0;
11
+ }
12
+
13
+ /**
14
+ *
15
+ * @param {BinaryBuffer} buffer
16
+ * @param {Animation} value
17
+ */
18
+ serialize(buffer, value) {
19
+ value.clips.toBinaryBuffer(buffer);
20
+ buffer.writeFloat64(value.debtTime);
21
+ }
22
+
23
+ /**
24
+ *
25
+ * @param {BinaryBuffer} buffer
26
+ * @param {Animation} value
27
+ */
28
+ deserialize(buffer, value) {
29
+ value.clips.fromBinaryBuffer(buffer, AnimationClip);
30
+ value.debtTime = buffer.readFloat64();
31
+ }
32
+ }
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { max3 } from "../../../core/math/max3.js";
9
9
  import { System } from '../System.js';
10
- import { Animation, AnimationClipFlag, AnimationFlags } from '../animation/Animation.js';
10
+ import { Animation } from '../animation/Animation.js';
11
11
  import Mesh from '../../graphics/ecs/mesh/Mesh.js';
12
12
  import Future, { FutureStates } from '../../../core/process/Future.js';
13
13
 
@@ -25,6 +25,8 @@ import { MeshSystem } from "../../graphics/ecs/mesh/MeshSystem.js";
25
25
  import { projectSphere } from "../../graphics/util/projectSphere.js";
26
26
  import { threeUpdateTransform } from "../../graphics/util/threeUpdateTransform.js";
27
27
  import { MeshEvents } from "../../graphics/ecs/mesh/MeshEvents.js";
28
+ import { AnimationClipFlag } from "../animation/AnimationClipFlag.js";
29
+ import { AnimationFlags } from "../animation/AnimationFlags.js";
28
30
 
29
31
  /**
30
32
  *
@@ -36,7 +36,6 @@ import { MaterialManager } from "./material/manager/MaterialManager.js";
36
36
  import { ShadowMapRenderer } from "./shadows/ShadowMapRenderer.js";
37
37
  import { CameraViewManager } from "./render/view/CameraViewManager.js";
38
38
  import { StandardFrameBuffers } from "./StandardFrameBuffers.js";
39
- import { load_environment_map } from "./texture/cubemap/load_environment_map.js";
40
39
  import { CompositingStages } from "./composit/CompositingStages.js";
41
40
  import { DEG_TO_RAD } from "../../core/math/DEG_TO_RAD.js";
42
41
 
@@ -256,22 +255,12 @@ GraphicsEngine.prototype.getRenderer = function () {
256
255
  };
257
256
 
258
257
  /**
259
- *
258
+ * @deprecated
260
259
  * @param {string[]|string} paths URLs to faces of the cubemap
261
260
  * @returns {Promise<Texture>}
262
261
  */
263
262
  GraphicsEngine.prototype.loadEnvironmentMap = async function (paths) {
264
-
265
- const { filtered } = await load_environment_map({
266
- path: paths,
267
- renderer: this.renderer,
268
- original: false,
269
- filtered: true
270
- });
271
-
272
- this.scene.environment = filtered;
273
-
274
- return filtered;
263
+ throw new Error('Deprecated use `load_and_set_cubemap_v0` instead');
275
264
  }
276
265
 
277
266
  GraphicsEngine.prototype.updateSize = function () {
@@ -38,7 +38,7 @@ import { FogOfWarSystem } from "../../ecs/fow/FogOfWarSystem.js";
38
38
  import { FogOfWarRevealerSystem } from "../../ecs/fow/FogOfWarRevealerSystem.js";
39
39
  import { BehaviorSystem } from "../../intelligence/behavior/ecs/BehaviorSystem.js";
40
40
  import { SerializationMetadataSystem } from "../../ecs/systems/SerializationMetadataSystem.js";
41
- import { InverseKinematicsSystem } from "../../ecs/animation/InverseKinematicsSystem.js";
41
+ import { InverseKinematicsSystem } from "../../ecs/ik/InverseKinematicsSystem.js";
42
42
  import { PathDisplaySystem } from "../ecs/path/PathDisplaySystem.js";
43
43
  import RenderSystem from "../../ecs/systems/RenderSystem.js";
44
44
  import { makeEngineOptionsModel } from "../../../../../model/game/options/makeEngineOptionsModel.js";
@@ -6,6 +6,7 @@
6
6
  import { System } from '../../../ecs/System.js';
7
7
  import AnimationController from './AnimationController.js';
8
8
  import { Animation } from '../../../ecs/animation/Animation.js';
9
+ import { AnimationClip } from "../../../ecs/animation/AnimationClip.js";
9
10
 
10
11
  class AnimationControllerSystem extends System {
11
12
  constructor() {
@@ -33,7 +34,7 @@ class AnimationControllerSystem extends System {
33
34
  removeAnimation(animation);
34
35
 
35
36
  //create a new animation according to the rule
36
- const clip = new Animation.Clip();
37
+ const clip = new AnimationClip();
37
38
  clip.fromJSON({
38
39
  name: r.animation,
39
40
  timeScale: r.speed,
@@ -1,7 +1,7 @@
1
1
  import { Mesh, PlaneBufferGeometry } from "three";
2
2
  import Task from "../../../core/process/task/Task.js";
3
3
  import { TaskSignal } from "../../../core/process/task/TaskSignal.js";
4
- import { collectIteratorValueToArray } from "../../../core/collection/IteratorUtils.js";
4
+ import { collectIteratorValueToArray } from "../../../core/collection/collectIteratorValueToArray.js";
5
5
  import { clamp01 } from "../../../core/math/clamp01.js";
6
6
 
7
7
  /**
@@ -4,7 +4,7 @@ import Task from "../../../../core/process/task/Task.js";
4
4
  import { TaskSignal } from "../../../../core/process/task/TaskSignal.js";
5
5
  import { assert } from "../../../../core/assert.js";
6
6
  import { assetTypeByPath } from "./assetTypeByPath.js";
7
- import { collectIteratorValueToArray } from "../../../../core/collection/IteratorUtils.js";
7
+ import { collectIteratorValueToArray } from "../../../../core/collection/collectIteratorValueToArray.js";
8
8
  import { clamp01 } from "../../../../core/math/clamp01.js";
9
9
 
10
10
  /**
@@ -39,7 +39,7 @@ import AnimationControllerSystem from "../animation/AnimationControllerSystem.js
39
39
  import { AnimationGraphSystem } from "../animation/animator/AnimationGraphSystem.js";
40
40
  import { BehaviorSystem } from "../../../intelligence/behavior/ecs/BehaviorSystem.js";
41
41
  import { SerializationMetadataSystem } from "../../../ecs/systems/SerializationMetadataSystem.js";
42
- import { InverseKinematicsSystem } from "../../../ecs/animation/InverseKinematicsSystem.js";
42
+ import { InverseKinematicsSystem } from "../../../ecs/ik/InverseKinematicsSystem.js";
43
43
  import { PathDisplaySystem } from "./PathDisplaySystem.js";
44
44
  import { PathDisplay } from "./PathDisplay.js";
45
45
  import { PathDisplayType } from "./PathDisplayType.js";
@@ -37,7 +37,7 @@ import AnimationControllerSystem from "../../animation/AnimationControllerSystem
37
37
  import { AnimationGraphSystem } from "../../animation/animator/AnimationGraphSystem.js";
38
38
  import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
39
39
  import { SerializationMetadataSystem } from "../../../../ecs/systems/SerializationMetadataSystem.js";
40
- import { InverseKinematicsSystem } from "../../../../ecs/animation/InverseKinematicsSystem.js";
40
+ import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
41
41
  import { PathDisplaySystem } from "../PathDisplaySystem.js";
42
42
  import {
43
43
  AmbientOcclusionPostProcessEffect
@@ -14,7 +14,7 @@ import { UvEncoder } from "./grid/UvEncoder.js";
14
14
  import { OctahedralUvEncoder } from "./grid/OctahedralUvEncoder.js";
15
15
  import { HemiOctahedralUvEncoder } from "./grid/HemiOctahedralUvEncoder.js";
16
16
  import { prepare_bake_material } from "./bake/prepare_bake_material.js";
17
- import { collectIteratorValueToArray } from "../../../../core/collection/IteratorUtils.js";
17
+ import { collectIteratorValueToArray } from "../../../../core/collection/collectIteratorValueToArray.js";
18
18
  import { compute_bounding_sphere } from "./bake/compute_bounding_sphere.js";
19
19
  import { build_cutout_from_atlas_by_alpha } from "./util/build_cutout_from_atlas_by_alpha.js";
20
20
 
@@ -0,0 +1,21 @@
1
+ import { buildCubeURLs } from "./texture/cubemap/buildCubeURLs.js";
2
+ import { load_environment_map } from "./texture/cubemap/load_environment_map.js";
3
+
4
+ /**
5
+ *
6
+ * @param {GraphicsEngine} graphics
7
+ * @param {string} folder_path
8
+ * @param {string} file_extension
9
+ */
10
+ export async function load_and_set_cubemap_v0(graphics, folder_path, file_extension) {
11
+ const paths = buildCubeURLs(folder_path, file_extension);
12
+
13
+ const { filtered } = await load_environment_map({
14
+ path: paths,
15
+ renderer: graphics.renderer,
16
+ original: false,
17
+ filtered: true
18
+ });
19
+
20
+ graphics.scene.environment = filtered;
21
+ }
@@ -7,7 +7,7 @@ import { Sampler2D } from "../../texture/sampler/Sampler2D.js";
7
7
  import { array_push_if_unique } from "../../../../core/collection/array/array_push_if_unique.js";
8
8
  import { computeMaterialHash } from "../../../asset/loaders/material/computeMaterialHash.js";
9
9
  import { computeMaterialEquality } from "../../../asset/loaders/material/computeMaterialEquality.js";
10
- import { collectIteratorValueToArray } from "../../../../core/collection/IteratorUtils.js";
10
+ import { collectIteratorValueToArray } from "../../../../core/collection/collectIteratorValueToArray.js";
11
11
  import {
12
12
  AdditiveBlending,
13
13
  ClampToEdgeWrapping,
@@ -27,7 +27,6 @@ import { PathDisplaySystem } from "../../../../../ecs/path/PathDisplaySystem.js"
27
27
  import RenderSystem from "../../../../../../ecs/systems/RenderSystem.js";
28
28
  import { makeEngineOptionsModel } from "../../../../../../../../../model/game/options/makeEngineOptionsModel.js";
29
29
  import { enableEditor } from "../../../../../../../../editor/enableEditor.js";
30
- import { buildCubeURLs } from "../../../../../texture/cubemap/buildCubeURLs.js";
31
30
  import {
32
31
  AmbientOcclusionPostProcessEffect
33
32
  } from "../../../../../render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
@@ -36,7 +35,7 @@ import Vector3 from "../../../../../../../core/geom/Vector3.js";
36
35
  import EntityBuilder from "../../../../../../ecs/EntityBuilder.js";
37
36
  import { Transform } from "../../../../../../ecs/transform/Transform.js";
38
37
  import Mesh from "../../../../../ecs/mesh/Mesh.js";
39
- import { AABB3 } from "../../../../../../../core/bvh2/aabb3/AABB3.js";
38
+ import { AABB3 } from "../../../../../../../core/geom/3d/aabb/AABB3.js";
40
39
  import { ParticleVolume } from "./ParticleVolume.js";
41
40
  import { ParticleEmitterSystem } from "../../../../ecs/ParticleEmitterSystem.js";
42
41
  import { BehaviorComponent } from "../../../../../../intelligence/behavior/ecs/BehaviorComponent.js";
@@ -75,13 +74,13 @@ import ButtonView from "../../../../../../../view/elements/button/ButtonView.js"
75
74
  import { UnitSphereShape3D } from "../../../../../../../core/geom/3d/shape/UnitSphereShape3D.js";
76
75
  import TopDownCameraController from "../../../../../ecs/camera/topdown/TopDownCameraController.js";
77
76
  import { randomFloatBetween } from "../../../../../../../core/math/random/randomFloatBetween.js";
78
- import { MicronRenderPlugin } from "../../../../../micron/plugin/MicronRenderPlugin.js";
79
77
  import { obtainTerrain } from "../../../../../../ecs/terrain/util/obtainTerrain.js";
80
78
  import { pick } from "../../../../../../ecs/grid/pick.js";
81
79
  import { clamp01 } from "../../../../../../../core/math/clamp01.js";
82
80
  import { randomFromArray } from "../../../../../../../core/math/random/randomFromArray.js";
83
81
  import { SamplingFunctionKind } from "./SamplingFunctionKind.js";
84
82
  import { RGBA_LUT_HEATMAP_IR } from "../../parameter/sample/RGBA_LUT_HEATMAP_IR.js";
83
+ import { load_and_set_cubemap_v0 } from "../../../../../load_and_set_cubemap_v0.js";
85
84
 
86
85
  const engineHarness = new EngineHarness();
87
86
 
@@ -134,7 +133,6 @@ function makeConfig(engine) {
134
133
 
135
134
 
136
135
  // Plugins
137
- config.addPlugin(MicronRenderPlugin);
138
136
  config.addPlugin(AmbientOcclusionPostProcessEffect);
139
137
 
140
138
 
@@ -160,7 +158,7 @@ async function init(harness) {
160
158
 
161
159
  enableEditor(engine);
162
160
 
163
- await engine.graphics.loadEnvironmentMap(buildCubeURLs('data/textures/cubemaps/hip_miramar/32/', '.png'));
161
+ await load_and_set_cubemap_v0(engine.graphics, 'data/textures/cubemaps/hip_miramar/32/', '.png');
164
162
 
165
163
 
166
164
  await harness.initialize();
@@ -39,7 +39,7 @@ import { FogOfWarSystem } from "../../../../ecs/fow/FogOfWarSystem.js";
39
39
  import { FogOfWarRevealerSystem } from "../../../../ecs/fow/FogOfWarRevealerSystem.js";
40
40
  import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
41
41
  import { SerializationMetadataSystem } from "../../../../ecs/systems/SerializationMetadataSystem.js";
42
- import { InverseKinematicsSystem } from "../../../../ecs/animation/InverseKinematicsSystem.js";
42
+ import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
43
43
  import { CanvasView } from "../../../../../view/elements/CanvasView.js";
44
44
  import Vector3 from "../../../../../core/geom/Vector3.js";
45
45
  import Vector2 from "../../../../../core/geom/Vector2.js";
@@ -63,9 +63,8 @@ import {
63
63
  } from "three";
64
64
  import { AmbientOcclusionPostProcessEffect } from "../simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
65
65
  import { PathDisplaySystem } from "../../../ecs/path/PathDisplaySystem.js";
66
- import { MicronRenderPlugin } from "../../../micron/plugin/MicronRenderPlugin.js";
67
66
  import { StandardFrameBuffers } from "../../../StandardFrameBuffers.js";
68
- import { buildCubeURLs } from "../../../texture/cubemap/buildCubeURLs.js";
67
+ import { load_and_set_cubemap_v0 } from "../../../load_and_set_cubemap_v0.js";
69
68
 
70
69
  const engineHarness = new EngineHarness();
71
70
 
@@ -133,7 +132,6 @@ function makeConfig(engine) {
133
132
 
134
133
 
135
134
  // Plugins
136
- config.addPlugin(MicronRenderPlugin);
137
135
 
138
136
 
139
137
  // Knowledge
@@ -240,7 +238,7 @@ async function init(harness) {
240
238
 
241
239
  enableEditor(engine);
242
240
 
243
- await engine.graphics.loadEnvironmentMap(buildCubeURLs('data/textures/cubemaps/hip_miramar/32/', '.png'));
241
+ await load_and_set_cubemap_v0(engine.graphics, 'data/textures/cubemaps/hip_miramar/32/', '.png');
244
242
 
245
243
 
246
244
  await engine.plugins.acquire(AmbientOcclusionPostProcessEffect);
@@ -40,7 +40,7 @@ import { FogOfWarSystem } from "../../../../ecs/fow/FogOfWarSystem.js";
40
40
  import { FogOfWarRevealerSystem } from "../../../../ecs/fow/FogOfWarRevealerSystem.js";
41
41
  import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
42
42
  import { SerializationMetadataSystem } from "../../../../ecs/systems/SerializationMetadataSystem.js";
43
- import { InverseKinematicsSystem } from "../../../../ecs/animation/InverseKinematicsSystem.js";
43
+ import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
44
44
  import { PathDisplaySystem } from "../../../ecs/path/PathDisplaySystem.js";
45
45
  import {
46
46
  BoxBufferGeometry,
@@ -64,7 +64,7 @@ import { OrbitingBehavior } from "../../../../../../../model/game/util/behavior/
64
64
  import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
65
65
  import { Light } from "../../../ecs/light/Light.js";
66
66
  import { LightType } from "../../../ecs/light/LightType.js";
67
- import { parseColor } from "../../../../../core/color/ColorUtils.js";
67
+ import { parseColor } from "../../../../../core/color/parseColor.js";
68
68
  import Renderable from "../../../../ecs/components/Renderable.js";
69
69
  import { makeHelperSphereGeometry } from "../../../../../../editor/process/symbolic/makeHelperSphereGeometry.js";
70
70
  import TopDownCameraController from "../../../ecs/camera/topdown/TopDownCameraController.js";