Update: CC - Mouse Move - Moorcow (8a0m30eevi.js) 208 bytes modified
parent
f5d175cb48
commit
430297c466
|
@ -3,6 +3,7 @@ if (!this.entityLoaded) {
|
|||
}
|
||||
|
||||
if (!this.initialized) {
|
||||
this.mouseIsDown = false; //gets set from MouseDown
|
||||
this.mouse = this.entityLoaded.mouse;
|
||||
this.raycaster = this.entityLoaded.raycaster;
|
||||
this.camera = this.entityLoaded.camera;
|
||||
|
@ -53,11 +54,9 @@ this.throwerParticleEngine.position.y = this.thrower.position.y + this.raycaster
|
|||
this.throwerParticleEngine.position.z = this.thrower.position.z + this.raycaster.direction.z * 6;
|
||||
this.throwerParticleEngine.updateInstance('position');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
this.scene.meshes.map(
|
||||
function(mesh) {
|
||||
|
||||
if (mesh.instance.material instanceof Array) {
|
||||
mesh.instance.material.map(
|
||||
function(material) {
|
||||
|
@ -69,6 +68,7 @@ this.scene.meshes.map(
|
|||
}
|
||||
}
|
||||
);
|
||||
*/
|
||||
|
||||
var intersects = this.raycaster.getIntersectedObjects(this.scene.meshes);
|
||||
intersects.map(
|
||||
|
@ -84,18 +84,21 @@ intersects.map(
|
|||
mesh.name.indexOf('Stone') === -1 //stones
|
||||
) {
|
||||
|
||||
if (this.mouseIsDown)
|
||||
|
||||
if (this.mouseIsDown) {
|
||||
if (mesh.instance.material instanceof Array) {
|
||||
mesh.instance.material.map(
|
||||
function(material) {
|
||||
material.color.setHex(0xff0000);
|
||||
material.color.r -= 0.01;
|
||||
material.color.g -= 0.01;
|
||||
material.color.b -= 0.01;
|
||||
}
|
||||
);
|
||||
} else {
|
||||
mesh.instance.material.color.setHex(0xff0000);
|
||||
mesh.instance.material.color.r -= 0.01;
|
||||
mesh.instance.material.color.g -= 0.01;
|
||||
mesh.instance.material.color.b -= 0.01;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue