Update: CC - Mouse Move - Moorcow (5at8009mwh.js) 383 bytes modified
parent
d1c7754557
commit
1e8b24b3e9
|
@ -9,6 +9,8 @@ if (!this.initialized) {
|
||||||
this.cursor = this.entityLoaded.cursor;
|
this.cursor = this.entityLoaded.cursor;
|
||||||
this.thrower = this.entityLoaded.thrower;
|
this.thrower = this.entityLoaded.thrower;
|
||||||
this.throwerParticleEngine = this.entityLoaded.throwerParticleEngine;
|
this.throwerParticleEngine = this.entityLoaded.throwerParticleEngine;
|
||||||
|
this.throwerLight = this.entityLoaded.throwerLight;
|
||||||
|
|
||||||
this.initialized = true;
|
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.x = this.mouse.x * 20;
|
||||||
this.camera.lookAt.y = this.mouse.y * 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.lookAt.z = Math.cos(this.mouse.x) + Math.sin(this.mouse.y);
|
||||||
this.camera.updateInstance();
|
this.camera.updateInstance('lookAt');
|
||||||
|
|
||||||
this.raycaster.setFromCamera(
|
this.raycaster.setFromCamera(
|
||||||
this.mouse,
|
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.position.z = this.thrower.position.z + this.raycaster.direction.z * 10;
|
||||||
this.throwerParticleEngine.updateInstance('position');
|
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(
|
this.scene.meshes.map(
|
||||||
function(mesh) {
|
function(mesh) {
|
||||||
|
|
Loading…
Reference in New Issue