@woosh/meep-engine 2.93.1 → 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.
- package/build/meep.cjs +9 -42
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +9 -42
- package/package.json +1 -1
- package/src/core/collection/map/HashMap.d.ts.map +1 -1
- package/src/core/collection/map/HashMap.js +8 -41
- package/src/core/collection/set/HashSet.spec.js +16 -0
- package/src/engine/animation/clip/ecd_bind_animation_curve.d.ts.map +1 -1
- package/src/engine/animation/clip/ecd_bind_animation_curve.js +7 -3
- package/src/engine/animation/curve/prototypeGLTF.js +15 -11
- package/src/engine/ecs/Entity.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +0 -14
- package/src/engine/ecs/computeComponentClassName.d.ts +2 -0
- package/src/engine/ecs/computeComponentClassName.d.ts.map +1 -0
- package/src/engine/ecs/computeComponentClassName.js +13 -0
package/build/meep.module.js
CHANGED
|
@@ -60511,54 +60511,21 @@ class HashMap {
|
|
|
60511
60511
|
*
|
|
60512
60512
|
* @returns {Iterator<V>}
|
|
60513
60513
|
*/
|
|
60514
|
-
values() {
|
|
60515
|
-
const entryIterator = this[Symbol.iterator]();
|
|
60516
|
-
|
|
60517
|
-
return {
|
|
60518
|
-
next() {
|
|
60519
|
-
const n = entryIterator.next();
|
|
60520
|
-
|
|
60521
|
-
if (n.done) {
|
|
60522
|
-
return {
|
|
60523
|
-
done: true,
|
|
60524
|
-
value: undefined
|
|
60525
|
-
};
|
|
60526
|
-
} else {
|
|
60527
|
-
return {
|
|
60528
|
-
done: false,
|
|
60529
|
-
value: n.value[1]
|
|
60530
|
-
};
|
|
60531
|
-
}
|
|
60514
|
+
* values() {
|
|
60532
60515
|
|
|
60533
|
-
|
|
60534
|
-
|
|
60516
|
+
for (const [k, v] of this) {
|
|
60517
|
+
yield v;
|
|
60518
|
+
}
|
|
60535
60519
|
}
|
|
60536
60520
|
|
|
60537
60521
|
/**
|
|
60538
60522
|
*
|
|
60539
60523
|
* @returns {Iterator<K>}
|
|
60540
60524
|
*/
|
|
60541
|
-
keys() {
|
|
60542
|
-
const
|
|
60543
|
-
|
|
60544
|
-
|
|
60545
|
-
next() {
|
|
60546
|
-
const n = entryIterator.next();
|
|
60547
|
-
|
|
60548
|
-
if (n.done) {
|
|
60549
|
-
return {
|
|
60550
|
-
done: true,
|
|
60551
|
-
value: undefined
|
|
60552
|
-
};
|
|
60553
|
-
} else {
|
|
60554
|
-
return {
|
|
60555
|
-
done: false,
|
|
60556
|
-
value: n.value[0]
|
|
60557
|
-
};
|
|
60558
|
-
}
|
|
60559
|
-
|
|
60560
|
-
}
|
|
60561
|
-
};
|
|
60525
|
+
* keys() {
|
|
60526
|
+
for (const [k, v] of this) {
|
|
60527
|
+
yield k;
|
|
60528
|
+
}
|
|
60562
60529
|
}
|
|
60563
60530
|
}
|
|
60564
60531
|
|
|
@@ -72659,7 +72626,7 @@ class Entity {
|
|
|
72659
72626
|
const component = this.getComponent(klass);
|
|
72660
72627
|
|
|
72661
72628
|
if (component === null) {
|
|
72662
|
-
throw new Error(`Component of given class not found`);
|
|
72629
|
+
throw new Error(`Component of given class '${computeComponentClassName(klass)}' not found`);
|
|
72663
72630
|
}
|
|
72664
72631
|
|
|
72665
72632
|
return component;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;GAYG;AACH,uFAIC;AAsHD;;;;;;;GAOG;AACH;IA2DI;;;;;;OAMG;IACH,4FALuB,MAAM,EAsC5B;IAlBG;;;;;OAKG;IACH,iCAAsC;IACtC;;;;;OAKG;IACH,qCAA8C;IAOlD,mBAEC;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA2HD;;;;OAIG;IACH,SAHW,CAAC,SACD,CAAC,QAoEX;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,CAAC,GAAC,SAAS,CA+BvB;IAED;;;;;;;;OAQG;IACH,kBALW,CAAC,kBACQ,CAAC,KAAE,CAAC,0BAEZ,CAAC,CAcZ;IAED;;;;;OAKG;IACH,cAJW,CAAC,SACD,CAAC,GACA,CAAC,CAYZ;IAuBD;;;;OAIG;IACH,YAHW,CAAC,GACC,OAAO,CA+CnB;IAED;;;;;OAKG;IACH,4CAFa,OAAO,CA+BnB;IAOD;;OAEG;IACH,gBAkDC;IAmBD,2CAwBC;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,OAAO,CAInB;IAED;;OAEG;IACH,cA6BC;IA+BD;;;OAGG;IACH,UAFa,SAAS,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;GAYG;AACH,uFAIC;AAsHD;;;;;;;GAOG;AACH;IA2DI;;;;;;OAMG;IACH,4FALuB,MAAM,EAsC5B;IAlBG;;;;;OAKG;IACH,iCAAsC;IACtC;;;;;OAKG;IACH,qCAA8C;IAOlD,mBAEC;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA2HD;;;;OAIG;IACH,SAHW,CAAC,SACD,CAAC,QAoEX;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,CAAC,GAAC,SAAS,CA+BvB;IAED;;;;;;;;OAQG;IACH,kBALW,CAAC,kBACQ,CAAC,KAAE,CAAC,0BAEZ,CAAC,CAcZ;IAED;;;;;OAKG;IACH,cAJW,CAAC,SACD,CAAC,GACA,CAAC,CAYZ;IAuBD;;;;OAIG;IACH,YAHW,CAAC,GACC,OAAO,CA+CnB;IAED;;;;;OAKG;IACH,4CAFa,OAAO,CA+BnB;IAOD;;OAEG;IACH,gBAkDC;IAmBD,2CAwBC;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,OAAO,CAInB;IAED;;OAEG;IACH,cA6BC;IA+BD;;;OAGG;IACH,UAFa,SAAS,CAAC,CAAC,CAOvB;IAED;;;OAGG;IACH,QAFa,SAAS,CAAC,CAAC,CAMvB;IAhDD,yDA2BC;;CAsBJ"}
|
|
@@ -831,53 +831,20 @@ export class HashMap {
|
|
|
831
831
|
*
|
|
832
832
|
* @returns {Iterator<V>}
|
|
833
833
|
*/
|
|
834
|
-
values() {
|
|
835
|
-
const entryIterator = this[Symbol.iterator]();
|
|
836
|
-
|
|
837
|
-
return {
|
|
838
|
-
next() {
|
|
839
|
-
const n = entryIterator.next();
|
|
840
|
-
|
|
841
|
-
if (n.done) {
|
|
842
|
-
return {
|
|
843
|
-
done: true,
|
|
844
|
-
value: undefined
|
|
845
|
-
};
|
|
846
|
-
} else {
|
|
847
|
-
return {
|
|
848
|
-
done: false,
|
|
849
|
-
value: n.value[1]
|
|
850
|
-
};
|
|
851
|
-
}
|
|
834
|
+
* values() {
|
|
852
835
|
|
|
853
|
-
|
|
854
|
-
|
|
836
|
+
for (const [k, v] of this) {
|
|
837
|
+
yield v;
|
|
838
|
+
}
|
|
855
839
|
}
|
|
856
840
|
|
|
857
841
|
/**
|
|
858
842
|
*
|
|
859
843
|
* @returns {Iterator<K>}
|
|
860
844
|
*/
|
|
861
|
-
keys() {
|
|
862
|
-
const
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
next() {
|
|
866
|
-
const n = entryIterator.next();
|
|
867
|
-
|
|
868
|
-
if (n.done) {
|
|
869
|
-
return {
|
|
870
|
-
done: true,
|
|
871
|
-
value: undefined
|
|
872
|
-
};
|
|
873
|
-
} else {
|
|
874
|
-
return {
|
|
875
|
-
done: false,
|
|
876
|
-
value: n.value[0]
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
}
|
|
881
|
-
};
|
|
845
|
+
* keys() {
|
|
846
|
+
for (const [k, v] of this) {
|
|
847
|
+
yield k;
|
|
848
|
+
}
|
|
882
849
|
}
|
|
883
850
|
}
|
|
@@ -20,4 +20,20 @@ test("add same element twice", () => {
|
|
|
20
20
|
set.add("a");
|
|
21
21
|
|
|
22
22
|
expect(set.size).toBe(1);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("iterator symbol",()=>{
|
|
26
|
+
|
|
27
|
+
const set = new HashSet({
|
|
28
|
+
keyHashFunction: computeStringHash,
|
|
29
|
+
keyEqualityFunction: strictEquals
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
set.add("a");
|
|
33
|
+
|
|
34
|
+
const iterator = set[Symbol.iterator]();
|
|
35
|
+
expect(iterator.next()).toEqual({
|
|
36
|
+
done:false,
|
|
37
|
+
value: "a"
|
|
38
|
+
});
|
|
23
39
|
});
|
|
@@ -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":"
|
|
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 {
|
|
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.
|
|
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
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
/**
|
package/src/engine/ecs/Entity.js
CHANGED
|
@@ -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 @@
|
|
|
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
|
+
}
|