2018-02-12 15:15:47 +01:00
|
|
|
if (!this.entityLoaded) {
|
2018-02-16 11:39:37 +01:00
|
|
|
return;
|
2018-02-12 15:15:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.initialized) {
|
2018-02-16 11:39:37 +01:00
|
|
|
|
2018-02-16 12:15:28 +01:00
|
|
|
/**
|
|
|
|
* attributeData hols the new attribute data we want to animate to
|
|
|
|
*/
|
2018-02-16 12:22:41 +01:00
|
|
|
this.startAnimation = false;
|
2018-02-16 11:39:37 +01:00
|
|
|
this.animate = false;
|
2018-02-16 12:15:28 +01:00
|
|
|
this.attributeData = null;
|
|
|
|
|
2018-02-16 11:39:37 +01:00
|
|
|
this.camera = this.entityLoaded.camera;
|
|
|
|
|
2018-02-21 09:54:42 +01:00
|
|
|
this.mouseMove = this.entityLoaded.mouseMove;
|
|
|
|
|
|
|
|
this.lookAtTarget = this.entityLoaded.lookAtTarget;
|
|
|
|
|
|
|
|
this.meshImageGrid = this.entityLoaded.meshImageGrid;
|
|
|
|
|
2018-02-16 12:15:28 +01:00
|
|
|
this.update = [];
|
|
|
|
|
2018-02-16 11:42:12 +01:00
|
|
|
this.time = 0;
|
|
|
|
|
2018-02-16 11:39:37 +01:00
|
|
|
this.initialized = true;
|
2018-02-12 15:15:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
this.time += 0.1 * data.delta;
|
|
|
|
|
2018-02-21 09:54:42 +01:00
|
|
|
this.lookAtTarget = this.entityLoaded.lookAtTarget;
|
|
|
|
|
|
|
|
if (this.lookAtTarget) {
|
|
|
|
|
|
|
|
var current = this.meshImageGrid.lookAt.instance;
|
|
|
|
|
|
|
|
var newLookAt = current.lerp(this.lookAtTarget, 0.1 * data.delta);
|
|
|
|
|
|
|
|
this.meshImageGrid.instance.lookAt(newLookAt);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-16 12:22:41 +01:00
|
|
|
if (this.startAnimation) {
|
2018-02-16 12:35:34 +01:00
|
|
|
this.time = 0;
|
|
|
|
this.animate = true;
|
2018-02-16 12:22:41 +01:00
|
|
|
this.startAnimation = false;
|
2018-02-16 12:19:15 +01:00
|
|
|
}
|
|
|
|
|
2018-02-16 12:22:41 +01:00
|
|
|
if (this.animate) {
|
|
|
|
if (this.time < 1) {
|
|
|
|
this.updateAttributeArrays(this.time);
|
|
|
|
} else {
|
2018-02-16 12:19:15 +01:00
|
|
|
this.updateAttributeArrays(1);
|
|
|
|
this.animate = false;
|
2018-02-16 12:22:41 +01:00
|
|
|
}
|
2018-02-16 12:15:28 +01:00
|
|
|
}
|
|
|
|
|
2018-02-16 12:22:41 +01:00
|
|
|
|
2018-02-16 12:15:28 +01:00
|
|
|
//this.camera.position.x = 10;Math.sin(this.time) * 4;// * (window.innerWidth - (window.innerWidth / 2));
|
|
|
|
//this.camera.position.y = 10;Math.sin(this.time / 2) * 4;//Math.cos(this.time) * (window.innerHeight - (window.innerHeight / 2));
|
|
|
|
//this.camera.position.z = 10;-Math.sin(this.time) * 5;//Math.sin(this.camera.position.y) * Math.cos(this.camera.position.x);
|
|
|
|
//this.camera.updateInstance('position');
|
2018-02-12 15:15:47 +01:00
|
|
|
|
2018-02-16 12:15:28 +01:00
|
|
|
//this.camera.lookAt.x = 0;
|
|
|
|
//this.camera.lookAt.y = 0;
|
|
|
|
//this.camera.lookAt.z = 0;
|
|
|
|
//this.camera.updateInstance('lookAt');
|
2018-02-12 15:15:47 +01:00
|
|
|
|
2018-02-16 11:39:37 +01:00
|
|
|
// if (this.audioDrone.volume < 0.1) {
|
|
|
|
// this.audioDrone.volume += 0.001;
|
|
|
|
// this.audioDrone.updateInstance('volume');
|
|
|
|
// }
|
2018-02-12 15:15:47 +01:00
|
|
|
|
2018-02-16 11:39:37 +01:00
|
|
|
//@ sourceURL=beforeRender.js
|