Update: CC - Mouse Move - Moorcow (fsilsam72g.js) 2 bytes modified
parent
5089dbf9d1
commit
521e4676b0
|
@ -37,7 +37,7 @@ thrower.instance.lookAt(
|
|||
/**
|
||||
* First we find our crosshair
|
||||
*/
|
||||
var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv');
|
||||
//var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv');
|
||||
var sphere = GameLib.EntityManager.Instance.findComponentById('dpol2u3xbm');
|
||||
|
||||
/**
|
||||
|
@ -46,9 +46,14 @@ var sphere = GameLib.EntityManager.Instance.findComponentById('dpol2u3xbm');
|
|||
var target = new THREE.Vector3(
|
||||
(-1 * (window.innerWidth / 2 - data.event.x)) ,
|
||||
(window.innerHeight / 2 - data.event.y) ,
|
||||
0.5
|
||||
0
|
||||
);
|
||||
|
||||
sphere.instance.position.copy(target);//instance.applyMatrix4( mInverse );
|
||||
sphere.position.x = sphere.instance.position.x;
|
||||
sphere.position.y = sphere.instance.position.y;
|
||||
sphere.position.z = sphere.instance.position.z;
|
||||
|
||||
/**
|
||||
* Now we get the position of the crosshair, in our world scene space
|
||||
*/
|
||||
|
@ -100,10 +105,7 @@ if (intersects.length > 0) {
|
|||
* We need the x/y/z position of an imaginary object, at target position, in the game scene
|
||||
*/
|
||||
//var mInverse = new THREE.Matrix4().getInverse( crosshair.instance.matrixWorld );
|
||||
sphere.instance.position.copy(target);//instance.applyMatrix4( mInverse );
|
||||
sphere.position.x = sphere.instance.position.x;
|
||||
sphere.position.y = sphere.instance.position.y;
|
||||
sphere.position.z = sphere.instance.position.z;
|
||||
|
||||
|
||||
|
||||
//@ sourceURL=mouseMove.js
|
Loading…
Reference in New Issue