|
@@ -48,44 +48,33 @@ this.setupTransport = function () {
|
|
|
this.animationLoop = true;
|
|
|
this.animationDuration = 1;
|
|
|
this.animationRate = 1;
|
|
|
+ this.animationTPS = 30;
|
|
|
//this.animationPlay(0,1);
|
|
|
}
|
|
|
|
|
|
this.animationUpdate = function (time, duration) {
|
|
|
- //let sceneID = this.find("/")[0].id
|
|
|
- let rate = this.animationTPS / this.animationRate; // 60/1 by default
|
|
|
-
|
|
|
- var b = this.beat;
|
|
|
-
|
|
|
- //console.log('time: ' + time + ' b: ' + this.beat + ' simTime: ' + this.time);
|
|
|
-
|
|
|
- if (b == rate + 1) { //time == 1 &&
|
|
|
- this.beat = 0;
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- this.doGlobalBeat(time, duration, b);
|
|
|
- //vwf_view.kernel.fireEvent(this.id, "transportTick", [time, duration, this.beat]);
|
|
|
-
|
|
|
- if (b / rate == 0) {
|
|
|
- this.vis.material.color = "white";
|
|
|
- } else if (b / rate == 1 / 2) {
|
|
|
- this.vis.material.color = "red";
|
|
|
- }
|
|
|
-
|
|
|
- this.beat = this.beat + 1;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ //let sceneID = this.find("/")[0].id
|
|
|
+ let rate = this.animationTPS / this.animationRate; // 60/1 by default
|
|
|
+
|
|
|
+ var b = this.beat;
|
|
|
+ //console.log('b: ' + this.beat + ' t: ' + time + ' ta: ' + this.time);
|
|
|
+
|
|
|
+ if (time == this.animationDuration) { //time == 1 &&
|
|
|
+ this.beat = 0;
|
|
|
+ //this.doGlobalBeat(time, duration, b);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.doGlobalBeat(time, duration, b);
|
|
|
+ this.beat = this.beat + 1;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
this.doGlobalBeat = function (time, duration, beat) {
|
|
|
|
|
|
- let allChilds = this.find("//element(*,'http://vwf.example.com/aframe/aentity.vwf')");
|
|
|
- allChilds.forEach(el => {
|
|
|
+ let allChilds = this.find("//element(*,'http://vwf.example.com/aframe/aentity.vwf')"); //this.children
|
|
|
+ allChilds.forEach(el => {
|
|
|
if (el.globalBeat) {
|
|
|
let obj = {
|
|
|
name: this.name,
|