From dfb1d41439abba63e89139112020c5737aa9a242 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sat, 11 Nov 2017 15:09:44 +0100 Subject: [PATCH] Update: CC - Mouse Move - Moorcow (ud33b2z225.js) 273 bytes modified --- ud33b2z225.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/ud33b2z225.js b/ud33b2z225.js index 604e59e..a3c0c67 100644 --- a/ud33b2z225.js +++ b/ud33b2z225.js @@ -18,11 +18,8 @@ this.raycaster.instance.setFromCamera( this.camera.instance ); -var intersects = this.raycaster.getIntersectedObjects(this.scene.meshes); - this.cursor.position.x = this.mouse.x; this.cursor.position.y = this.mouse.y; -this.cursor.position.z = 40; this.cursor.updateInstance(); this.thrower.instance.lookAt( @@ -33,4 +30,22 @@ this.thrower.instance.lookAt( ) ); +var intersects = this.raycaster.getIntersectedObjects(this.scene.meshes); +intersects.map( + function(intersect) { + + var mesh = intersect.mesh; + + if (mesh.instance.material instanceof Array) { + mesh.instance.material.map( + function(material) { + material.color.setHex(0xff0000); + } + ); + } else { + mesh.instance.material.color.setHex(0xff0000); + } + } +); + //@ sourceURL=mouseMove.js \ No newline at end of file