2018-01-12 11:19:14 +01:00
|
|
|
if (!this.entityLoaded) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-01-12 11:22:58 +01:00
|
|
|
if (!this.initialized) {
|
|
|
|
this.camera = this.entityLoaded.camera;
|
|
|
|
this.initialized = true;
|
|
|
|
}
|
|
|
|
|
2018-01-12 13:50:49 +01:00
|
|
|
this.camera.position.x = 0.2 * (window.innerWidth - (window.innerWidth / 2 + data.event.clientX));
|
|
|
|
this.camera.position.y = -0.2 * (window.innerHeight - (window.innerHeight / 2 + data.event.clientY));
|
|
|
|
this.camera.position.z = Math.cos(this.camera.position.y / 100) * Math.sin(this.camera.position.x / 100) * 100;
|
2018-01-12 13:09:51 +01:00
|
|
|
this.camera.updateInstance('position');
|
|
|
|
|
2018-01-12 13:50:49 +01:00
|
|
|
this.camera.lookAt.x = 32;
|
|
|
|
this.camera.lookAt.y = 32;
|
|
|
|
this.camera.lookAt.z = 0;
|
|
|
|
this.camera.updateInstance('lookAt');
|
|
|
|
|
2018-01-12 13:53:08 +01:00
|
|
|
//console.log('camera x:' + this.camera.position.x + ',y: ' + this.camera.position.y + ',z: ' + this.camera.position.z);
|
2018-01-12 11:22:58 +01:00
|
|
|
|
2018-01-12 11:19:14 +01:00
|
|
|
//@ sourceURL=mouseMove.js
|