diff --git a/5at8009mwh.js b/5at8009mwh.js index 900db27..aa75e0a 100644 --- a/5at8009mwh.js +++ b/5at8009mwh.js @@ -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) {