From f3b5ca3bd803df3fb3aa654cf59482124be44684 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Mon, 6 Nov 2017 20:52:14 +0100 Subject: [PATCH] Update: CC - Mouse Move - Moorcow (fsilsam72g.js) 499 bytes modified --- fsilsam72g.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/fsilsam72g.js b/fsilsam72g.js index ff09475..20b13a2 100644 --- a/fsilsam72g.js +++ b/fsilsam72g.js @@ -1,13 +1,29 @@ -console.log(data); +//console.log(data); var camera = GameLib.EntityManager.Instance.findComponentById('knwkksjc7n'); -camera.lookAt.x -= data.event.movementX * 0.01; -camera.lookAt.y -= data.event.movementY * 0.01; +camera.lookAt.x = data.event.x * 0.01;//(window.clientWidth/ 2) + data.event.x; +camera.lookAt.y = data.event.y * 0.01; -if (camera.lookAt.x < -0.5) { - camera.lookAt.x = -0.5; -} +//if (camera.lookAt.x < -0.5) { +// camera.lookAt.x = -0.5; +//} +//var vector = new THREE.Vector3(); +/ +//vector.set( +// ( data.event.clientX / window.innerWidth ) * 2 - 1, +// - ( data.event.clientY / window.innerHeight ) * 2 + 1, +// 0.5 ); + +//vector.unproject( camera.instance ); + +//vector.x = -1 * ((window.innerWidth / 2) - (data.event.clientX)); +//vector.y = 1 * ((window.innerHeight / 2) - (data.event.clientY)); +//vector.z = 0; + +//camera.lookAt.x = vector.x; +//camera.lookAt.y = vector.y; +//camera.lookAt.z = vector.z; camera.updateInstance();