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