@woosh/meep-engine 2.48.12 → 2.48.14

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 (68) hide show
  1. package/package.json +1 -1
  2. package/src/core/collection/queue/Deque.d.ts +9 -0
  3. package/src/core/collection/queue/Deque.js +3 -0
  4. package/src/core/collection/queue/Deque.spec.js +51 -0
  5. package/src/core/font/FontAssetLoader.js +2 -2
  6. package/src/core/math/bessel_3.js +3 -1
  7. package/src/core/math/noise/create_noise_2d.js +193 -0
  8. package/src/core/path/computeFileExtension.js +3 -2
  9. package/src/engine/Engine.js +14 -8
  10. package/src/engine/achievements/AchievementManager.js +16 -16
  11. package/src/engine/asset/AssetManager.d.ts +10 -5
  12. package/src/engine/asset/AssetManager.js +79 -24
  13. package/src/engine/asset/AssetManager.spec.js +1 -1
  14. package/src/engine/asset/AssetRequest.js +19 -1
  15. package/src/engine/asset/AssetRequestScope.d.ts +3 -0
  16. package/src/engine/asset/AssetRequestScope.js +64 -0
  17. package/src/engine/asset/PendingAsset.js +7 -7
  18. package/src/engine/asset/loaders/ArrayBufferLoader.js +1 -1
  19. package/src/engine/asset/loaders/AssetLoader.d.ts +9 -2
  20. package/src/engine/asset/loaders/AssetLoader.js +19 -16
  21. package/src/engine/asset/loaders/GLTFAssetLoader.d.ts +1 -1
  22. package/src/engine/asset/loaders/GLTFAssetLoader.js +2 -2
  23. package/src/engine/asset/loaders/JavascriptAssetLoader.js +17 -12
  24. package/src/engine/asset/loaders/JsonAssetLoader.js +1 -1
  25. package/src/engine/asset/loaders/LegacyThreeJSONAssetLoader.js +4 -1
  26. package/src/engine/asset/loaders/SVGAssetLoader.js +1 -1
  27. package/src/engine/asset/loaders/SoundAssetLoader.js +4 -6
  28. package/src/engine/asset/loaders/TextAssetLoader.js +1 -1
  29. package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +24 -17
  30. package/src/engine/asset/loaders/texture/TextureAssetLoader.d.ts +1 -1
  31. package/src/engine/asset/loaders/texture/TextureAssetLoader.js +1 -1
  32. package/src/engine/asset/preloader/Preloader.js +1 -1
  33. package/src/engine/development/performance/MetricStatistics.js +7 -5
  34. package/src/engine/development/performance/RingBufferMetric.js +2 -2
  35. package/src/engine/ecs/foliage/ecs/Foliage2System.js +7 -5
  36. package/src/engine/ecs/foliage/ecs/InstancedMeshUtils.js +14 -1
  37. package/src/engine/ecs/gui/GUIElementSystem.d.ts +1 -1
  38. package/src/engine/ecs/sockets/serialization/AttachmentSocketsAssetLoader.js +2 -2
  39. package/src/engine/ecs/terrain/ecs/PromiseSamplerHeight.js +16 -9
  40. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +3 -21
  41. package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +16 -11
  42. package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.js +1 -1
  43. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionAssetLoader.js +18 -15
  44. package/src/engine/graphics/ecs/camera/pp/PerfectPanner.js +4 -2
  45. package/src/engine/graphics/ecs/mesh/MeshSystem.js +1 -1
  46. package/src/engine/graphics/ecs/path/tube/build/TubePathBuilder.js +6 -4
  47. package/src/engine/graphics/material/getTextureImmediate.js +5 -3
  48. package/src/engine/graphics/texture/3d/SingleChannelSampler3D.js +146 -0
  49. package/src/engine/graphics/texture/3d/scs3d_read_2d_slice.js +26 -0
  50. package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.js +1 -1
  51. package/src/engine/graphics/texture/sampler/Sampler2D.js +22 -13
  52. package/src/engine/graphics/texture/sampler/filter/box.js +3 -3
  53. package/src/engine/graphics/texture/sampler/filter/kaiser_bessel_window.js +2 -1
  54. package/src/engine/graphics/texture/sampler/genericResampleSampler2D.js +9 -8
  55. package/src/engine/graphics/texture/sampler/loadSampler2D.js +18 -16
  56. package/src/engine/graphics/texture/sampler/sampler2d_scale_down_linear.js +8 -11
  57. package/src/engine/graphics/texture/virtual/tile/TileLoader.js +1 -1
  58. package/src/engine/graphics/trail/x/RibbonXPlugin.js +5 -3
  59. package/src/engine/knowledge/database/StaticKnowledgeDataTable.js +1 -1
  60. package/src/engine/physics/fluid/FluidField.js +153 -1
  61. package/src/engine/physics/fluid/prototype.js +201 -0
  62. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +67 -0
  63. package/src/engine/sound/ecs/emitter/loadSoundTrackAsset.js +1 -1
  64. package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +17 -12
  65. package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +14 -10
  66. package/src/view/elements/MeshPreview.js +66 -64
  67. package/src/view/elements/image/SvgImageView.js +8 -6
  68. package/src/view/renderModel.js +1 -1
@@ -110,91 +110,93 @@ class MeshPreview extends View {
110
110
  const self = this;
111
111
 
112
112
  this.pContents = new Promise(function (resolve, reject) {
113
- assetManager.get(url, mimeType, function (asset) {
114
- const mesh = asset.create();
115
- const preview = makeMeshPreviewScene(mesh, size, {
116
- x0: 0,
117
- y0: 0,
118
- x1: 1,
119
- y1: 1
120
- });
121
- const camera = preview.camera;
122
- const scene = preview.scene;
123
-
124
-
125
- //wrap mesh so it stays centered relative to bb
126
- const group = new Group();
127
-
128
- const wrapAll = false;
129
- if (wrapAll) {
130
- const objects = scene.children.slice();
131
- scene.children = [];
132
-
133
- objects.forEach(function (o) {
134
- group.add(o);
113
+ assetManager.get({
114
+ path: url, type: mimeType, callback: function (asset) {
115
+ const mesh = asset.create();
116
+ const preview = makeMeshPreviewScene(mesh, size, {
117
+ x0: 0,
118
+ y0: 0,
119
+ x1: 1,
120
+ y1: 1
135
121
  });
136
- } else {
137
- scene.remove(mesh);
138
- group.add(mesh);
139
- }
140
-
122
+ const camera = preview.camera;
123
+ const scene = preview.scene;
141
124
 
142
- scene.add(group);
143
125
 
144
- self.camera = camera;
145
- self.scene = scene;
126
+ //wrap mesh so it stays centered relative to bb
127
+ const group = new Group();
146
128
 
129
+ const wrapAll = false;
130
+ if (wrapAll) {
131
+ const objects = scene.children.slice();
132
+ scene.children = [];
147
133
 
148
- if (hooks !== undefined) {
149
- if (typeof hooks.meshAdded === "function") {
150
- hooks.meshAdded(mesh);
134
+ objects.forEach(function (o) {
135
+ group.add(o);
136
+ });
137
+ } else {
138
+ scene.remove(mesh);
139
+ group.add(mesh);
151
140
  }
152
- if (typeof hooks.sceneConstructed === "function") {
153
- hooks.sceneConstructed(scene, mesh, camera, group);
141
+
142
+
143
+ scene.add(group);
144
+
145
+ self.camera = camera;
146
+ self.scene = scene;
147
+
148
+
149
+ if (hooks !== undefined) {
150
+ if (typeof hooks.meshAdded === "function") {
151
+ hooks.meshAdded(mesh);
152
+ }
153
+ if (typeof hooks.sceneConstructed === "function") {
154
+ hooks.sceneConstructed(scene, mesh, camera, group);
155
+ }
154
156
  }
155
- }
156
157
 
157
- mesh.rotation.y = -Math.PI / 6;
158
+ mesh.rotation.y = -Math.PI / 6;
158
159
 
159
- //
160
+ //
160
161
 
161
- function playAnimation(animationName) {
162
+ function playAnimation(animationName) {
162
163
 
163
- const mixer = new AnimationMixer(mesh);
164
+ const mixer = new AnimationMixer(mesh);
164
165
 
165
- let clipAction = null;
166
+ let clipAction = null;
166
167
 
167
- const animations = asset.animations;
168
- if (animations !== undefined) {
169
- self.__animationMixer = mixer;
170
- for (let i = 0; i < animations.length; i++) {
171
- const animation = animations[i];
172
- if (animation.name === animationName) {
173
- const root = null;
174
- clipAction = mixer.clipAction(animation, root);
175
- //bail, correct animation found
176
- break;
168
+ const animations = asset.animations;
169
+ if (animations !== undefined) {
170
+ self.__animationMixer = mixer;
171
+ for (let i = 0; i < animations.length; i++) {
172
+ const animation = animations[i];
173
+ if (animation.name === animationName) {
174
+ const root = null;
175
+ clipAction = mixer.clipAction(animation, root);
176
+ //bail, correct animation found
177
+ break;
178
+ }
177
179
  }
178
180
  }
179
- }
180
181
 
181
- if (clipAction !== null) {
182
- clipAction.play();
182
+ if (clipAction !== null) {
183
+ clipAction.play();
184
+ }
183
185
  }
184
- }
185
186
 
186
187
 
187
- if (animation !== null) {
188
- playAnimation(animation);
189
- }
188
+ if (animation !== null) {
189
+ playAnimation(animation);
190
+ }
190
191
 
191
- resolve({
192
- group
193
- });
192
+ resolve({
193
+ group
194
+ });
194
195
 
195
- }, function () {
196
- console.error(arguments);
197
- reject(arguments);
196
+ }, failure: function () {
197
+ console.error(arguments);
198
+ reject(arguments);
199
+ }
198
200
  });
199
201
  });
200
202
 
@@ -29,12 +29,14 @@ class SvgImageView extends View {
29
29
 
30
30
  const self = this;
31
31
 
32
- assetManager.get(url, "image/svg", function (asset) {
33
- const svgDom = asset.create();
34
- elIcon.appendChild(svgDom);
35
- resize(self.size.x, self.size.y);
36
- }, function (error) {
37
- console.error("Failed to load icon: " + url, error);
32
+ assetManager.get({
33
+ path: url, type: "image/svg", callback: function (asset) {
34
+ const svgDom = asset.create();
35
+ elIcon.appendChild(svgDom);
36
+ resize(self.size.x, self.size.y);
37
+ }, failure: function (error) {
38
+ console.error("Failed to load icon: " + url, error);
39
+ }
38
40
  });
39
41
 
40
42
  let currentScale = 1;
@@ -80,7 +80,7 @@ function makeModelView(url, assetManager, size, renderer, focus) {
80
80
 
81
81
  const assetType = guessAssetType(url);
82
82
 
83
- assetManager.get(url, assetType, success, reject);
83
+ assetManager.get({ path: url, type: assetType, callback: success, failure: reject });
84
84
  });
85
85
 
86
86
  const task = futureTask(dataURL, "Building Image URL");