From b75e22905f5ddcf54477ca02523978aa68a03229 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 31 Oct 2017 12:56:28 +0100 Subject: [PATCH] Initial Commit: Custom Code - BK Flame - Mouse Move (1cs8fm87ty.js) --- 1cs8fm87ty.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 1cs8fm87ty.js diff --git a/1cs8fm87ty.js b/1cs8fm87ty.js new file mode 100644 index 0000000..6c559ef --- /dev/null +++ b/1cs8fm87ty.js @@ -0,0 +1,28 @@ +//console.log(data); + +this.camera = GameLib.EntityManager.Instance.findComponentById('yv62w8sx9r'); + +var vector = new THREE.Vector3(); + +vector.set( + ( event.clientX / window.innerWidth ) * 2 - 1, + - ( event.clientY / window.innerHeight ) * 2 + 1, + 0.5 ); + +vector.unproject( this.camera.instance ); + +vector.x = -1 * ((window.innerWidth / 2) - (data.event.clientX)); +vector.y = 1 * ((window.innerHeight / 2) - (data.event.clientY)); +vector.z = 0; + +this.camera.lookAt.x = vector.x; +this.camera.lookAt.y = vector.y; +this.camera.lookAt.z = vector.z; + +this.camera.updateInstance(); + +//console.log(vector.x); + +return null; + +//@ sourceURL=mouseMove.js \ No newline at end of file