@woosh/meep-engine 2.92.12 → 2.92.13
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/package.json +1 -1
- package/src/engine/animation/curve/EntityNodeAnimationClip.d.ts.map +1 -1
- package/src/engine/animation/curve/EntityNodeAnimationClip.js +9 -2
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts +3 -0
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.js +22 -3
- package/src/engine/graphics/geometry/bvh/buffered/bvh32_from_unindexed_geometry.spec.js +3 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityNodeAnimationClip.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/EntityNodeAnimationClip.js"],"names":[],"mappings":"AAAA;IACI,aAAS;IACT;;;OAGG;IACH,QAFU,sBAAsB,CAErB;IACX,iBAAY;IAEZ,
|
|
1
|
+
{"version":3,"file":"EntityNodeAnimationClip.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/EntityNodeAnimationClip.js"],"names":[],"mappings":"AAAA;IACI,aAAS;IACT;;;OAGG;IACH,QAFU,sBAAsB,CAErB;IACX,iBAAY;IAEZ;;;OAGG;IACH,cAFW,MAAM,QAWhB;CACJ"}
|
|
@@ -7,9 +7,16 @@ export class EntityNodeAnimationClip {
|
|
|
7
7
|
tracks = []
|
|
8
8
|
duration = 0
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {number} time time in seconds
|
|
13
|
+
*/
|
|
10
14
|
writeAt(time) {
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
const tracks = this.tracks;
|
|
16
|
+
const track_count = tracks.length;
|
|
17
|
+
|
|
18
|
+
for (let i = 0; i < track_count; i++) {
|
|
19
|
+
const track = tracks[i];
|
|
13
20
|
|
|
14
21
|
track.writeAt(time);
|
|
15
22
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import Signal from "../../../../../core/events/signal/Signal";
|
|
1
2
|
import {System} from "../../../../ecs/System";
|
|
2
3
|
import Engine from "../../../../Engine";
|
|
3
4
|
import {SGMesh} from "./SGMesh";
|
|
4
5
|
import {SGMeshAnimationController} from "./SGMeshAnimationController";
|
|
5
6
|
|
|
6
7
|
export class SGMeshAnimationControllerSystem extends System<SGMeshAnimationController,SGMesh>{
|
|
8
|
+
readonly onWorkDone: Signal<void>
|
|
9
|
+
|
|
7
10
|
constructor(engine:Engine)
|
|
8
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SGMeshAnimationControllerSystem.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SGMeshAnimationControllerSystem.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.js"],"names":[],"mappings":"AASA;IA0BI;;;OAGG;IACH,4BAeC;IAhCD;;;;OAIG;IACH,qBAFU,MAAM,CAES;IAerB,eAAoB;IAEpB,mEAGC;IAED,gIAGC;IAyCL;;;;;OAKG;IACH,WAJW,yBAAyB,QACzB,MAAM,UACN,MAAM,iBAUhB;IA+CD,sBAyBC;;CACJ;uBAhLsB,2BAA2B;mBAJ/B,6CAA6C;uBAMzC,aAAa;0CACM,gCAAgC;4CAL9B,0DAA0D"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Signal from "../../../../../core/events/signal/Signal.js";
|
|
1
2
|
import { ResourceAccessKind } from "../../../../../core/model/ResourceAccessKind.js";
|
|
2
3
|
import { ResourceAccessSpecification } from "../../../../../core/model/ResourceAccessSpecification.js";
|
|
3
4
|
import { convert_three_clip } from "../../../../animation/curve/ecd_bind_animation_curve.js";
|
|
@@ -19,6 +20,19 @@ export class SGMeshAnimationControllerSystem extends System {
|
|
|
19
20
|
*/
|
|
20
21
|
#queue = [];
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Fires when one or more animation clips are currently playing and are updated
|
|
25
|
+
* @readonly
|
|
26
|
+
* @type {Signal}
|
|
27
|
+
*/
|
|
28
|
+
onWorkDone = new Signal()
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* How many clips were updated during last tick
|
|
32
|
+
* @type {number}
|
|
33
|
+
*/
|
|
34
|
+
#cycle_clip_advance_count = 0;
|
|
35
|
+
|
|
22
36
|
/**
|
|
23
37
|
*
|
|
24
38
|
* @param {Engine} engine
|
|
@@ -67,8 +81,6 @@ export class SGMeshAnimationControllerSystem extends System {
|
|
|
67
81
|
const controller = ecd.getComponent(entity, SGMeshAnimationController);
|
|
68
82
|
|
|
69
83
|
controller.bound = animations;
|
|
70
|
-
|
|
71
|
-
console.log(asset, animations);
|
|
72
84
|
}
|
|
73
85
|
|
|
74
86
|
/**
|
|
@@ -125,7 +137,7 @@ export class SGMeshAnimationControllerSystem extends System {
|
|
|
125
137
|
} else {
|
|
126
138
|
t = clip.duration;
|
|
127
139
|
|
|
128
|
-
// remove active
|
|
140
|
+
// playback finished, remove active
|
|
129
141
|
active.splice(i, 1);
|
|
130
142
|
|
|
131
143
|
i--;
|
|
@@ -135,10 +147,13 @@ export class SGMeshAnimationControllerSystem extends System {
|
|
|
135
147
|
|
|
136
148
|
clip.writeAt(t);
|
|
137
149
|
|
|
150
|
+
// mark clip update
|
|
151
|
+
this.#cycle_clip_advance_count++;
|
|
138
152
|
}
|
|
139
153
|
}
|
|
140
154
|
|
|
141
155
|
update(td) {
|
|
156
|
+
this.#cycle_clip_advance_count = 0;
|
|
142
157
|
this.#time_delta = td;
|
|
143
158
|
|
|
144
159
|
for (let i = 0; i < 1000; i++) {
|
|
@@ -158,5 +173,9 @@ export class SGMeshAnimationControllerSystem extends System {
|
|
|
158
173
|
}
|
|
159
174
|
|
|
160
175
|
ecd.traverseComponents(SGMeshAnimationController, this.#visit_entity, this);
|
|
176
|
+
|
|
177
|
+
if (this.#cycle_clip_advance_count > 0) {
|
|
178
|
+
this.onWorkDone.send0();
|
|
179
|
+
}
|
|
161
180
|
}
|
|
162
181
|
}
|