Update: CC - Mouse Move - Moorcow (5at8009mwh.js) 383 bytes modified

beta.r3js.org
-=yb4f310 2017-11-17 14:40:28 +01:00
parent d1c7754557
commit 1e8b24b3e9
1 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,8 @@ if (!this.initialized) {
this.cursor = this.entityLoaded.cursor;
this.thrower = this.entityLoaded.thrower;
this.throwerParticleEngine = this.entityLoaded.throwerParticleEngine;
this.throwerLight = this.entityLoaded.throwerLight;
this.initialized = true;
}
@ -18,7 +20,7 @@ this.mouse.y = -(data.event.offsetY / data.event.target.height) * 2 + 1;
this.camera.lookAt.x = this.mouse.x * 20;
this.camera.lookAt.y = this.mouse.y * 20;
this.camera.lookAt.z = Math.cos(this.mouse.x) + Math.sin(this.mouse.y);
this.camera.updateInstance();
this.camera.updateInstance('lookAt');
this.raycaster.setFromCamera(
this.mouse,
@ -52,6 +54,12 @@ this.throwerParticleEngine.position.y = this.thrower.position.y + this.raycaster
this.throwerParticleEngine.position.z = this.thrower.position.z + this.raycaster.direction.z * 10;
this.throwerParticleEngine.updateInstance('position');
this.throwerLight.position.x = this.thrower.position.x + this.raycaster.direction.x * 50;
this.throwerLight.position.y = this.thrower.position.y + this.raycaster.direction.y * 50;
this.throwerLight.position.z = this.thrower.position.z + this.raycaster.direction.z * 50;
this.throwerLight.updateInstance('position');
/*
this.scene.meshes.map(
function(mesh) {