@woosh/meep-engine 2.93.2 → 2.93.3

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.
@@ -72626,7 +72626,7 @@ class Entity {
72626
72626
  const component = this.getComponent(klass);
72627
72627
 
72628
72628
  if (component === null) {
72629
- throw new Error(`Component of given class not found`);
72629
+ throw new Error(`Component of given class '${computeComponentClassName(klass)}' not found`);
72630
72630
  }
72631
72631
 
72632
72632
  return component;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.93.2",
8
+ "version": "2.93.3",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"ecd_bind_animation_curve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/ecd_bind_animation_curve.js"],"names":[],"mappings":"AAmUA;;;;GAIG;AACH,2DAFW,mBAAmB,wBA6B7B;8BA5V6B,oBAAoB;qCACb,2BAA2B"}
1
+ {"version":3,"file":"ecd_bind_animation_curve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/clip/ecd_bind_animation_curve.js"],"names":[],"mappings":"AAuUA;;;;GAIG;AACH,2DAFW,mBAAmB,wBA6B7B;8BAhW6B,oBAAoB;qCACb,2BAA2B"}
@@ -14,13 +14,17 @@ import { AnimationTrackBinding } from "./AnimationTrackBinding.js";
14
14
  /**
15
15
  *
16
16
  * @param {EntityNode} node
17
- * @returns {String}
17
+ * @returns {string|undefined}
18
18
  */
19
19
  function get_node_name(node) {
20
20
  /**
21
21
  * @type {Name}
22
22
  */
23
- const name = node.entity.getComponentSafe(Name);
23
+ const name = node.entity.getComponent(Name);
24
+
25
+ if (name === null) {
26
+ return undefined;
27
+ }
24
28
 
25
29
  return name.getValue();
26
30
  }
@@ -348,7 +352,7 @@ export function convert_three_clip(node, clip) {
348
352
  meep_clip.tracks.push(meep_track);
349
353
  clip_binding.tracks.push(AnimationTrackBinding.from(writer, meep_track));
350
354
  } catch (e) {
351
- logger.error(`Failed to parse track[${i}]: ${e.message}`);
355
+ logger.error(`Failed to parse track[${i}]: ${e}`);
352
356
  }
353
357
  }
354
358
 
@@ -38,17 +38,17 @@ async function main(engine) {
38
38
  yaw: 3.123185307179593,
39
39
  });
40
40
  //
41
- make_sample('data/models/samples/InterpolationTest.glb',[
42
- 'Step Scale',
43
- 'Linear Scale',
44
- 'CubicSpline Scale',
45
- 'Step Rotation',
46
- 'CubicSpline Rotation',
47
- 'Linear Rotation',
48
- 'Step Translation',
49
- 'CubicSpline Translation',
50
- 'Linear Translation'
51
- ],engine.entityManager.dataset);
41
+ // make_sample('data/models/samples/InterpolationTest.glb',[
42
+ // 'Step Scale',
43
+ // 'Linear Scale',
44
+ // 'CubicSpline Scale',
45
+ // 'Step Rotation',
46
+ // 'CubicSpline Rotation',
47
+ // 'Linear Rotation',
48
+ // 'Step Translation',
49
+ // 'CubicSpline Translation',
50
+ // 'Linear Translation'
51
+ // ],engine.entityManager.dataset);
52
52
 
53
53
  // make_sample('data/models/samples/BoxAnimated.glb',[
54
54
  // 'animation_0'
@@ -57,6 +57,10 @@ async function main(engine) {
57
57
  // make_sample('data/models/samples/animatedbox1.gltf', [
58
58
  // 'All Animations'
59
59
  // ], engine.entityManager.dataset);
60
+
61
+ make_sample('moicon/Separated_Cardboard-Box-800x600x400_Roughness0/V1 Cardboard B.gltf', [
62
+ 'All Animations'
63
+ ], engine.entityManager.dataset);
60
64
  }
61
65
 
62
66
  /**
@@ -193,7 +193,7 @@ class Entity {
193
193
  const component = this.getComponent(klass);
194
194
 
195
195
  if (component === null) {
196
- throw new Error(`Component of given class not found`);
196
+ throw new Error(`Component of given class '${computeComponentClassName(klass)}' not found`);
197
197
  }
198
198
 
199
199
  return component;
@@ -1868,20 +1868,6 @@ function stringifyComponent(c) {
1868
1868
  }
1869
1869
  }
1870
1870
 
1871
- function computeComponentClassName(klass) {
1872
- if (klass === undefined) {
1873
- return "undefined";
1874
- } else if (klass === null) {
1875
- return "null";
1876
- } else if (typeof klass.type === "string") {
1877
- return klass.type;
1878
- } else if (typeof klass === "function") {
1879
- return klass.name;
1880
- } else {
1881
- return "$UNKNOWN"
1882
- }
1883
- }
1884
-
1885
1871
 
1886
1872
  /**
1887
1873
  *
@@ -0,0 +1,2 @@
1
+ declare function computeComponentClassName(klass: any): any;
2
+ //# sourceMappingURL=computeComponentClassName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeComponentClassName.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/computeComponentClassName.js"],"names":[],"mappings":"AAAA,4DAYC"}
@@ -0,0 +1,13 @@
1
+ function computeComponentClassName(klass) {
2
+ if (klass === undefined) {
3
+ return "undefined";
4
+ } else if (klass === null) {
5
+ return "null";
6
+ } else if (typeof klass.type === "string") {
7
+ return klass.type;
8
+ } else if (typeof klass === "function") {
9
+ return klass.name;
10
+ } else {
11
+ return "$UNKNOWN"
12
+ }
13
+ }