Added transparent water in tutorial
This commit is contained in:
parent
00d3d8ce10
commit
e2edfcfbfc
|
@ -243,7 +243,8 @@ PointerCamera.prototype.isColliding = function(direction) {
|
||||||
var intersects = this.raycaster.intersectObjects(this.collidableObjects, true);
|
var intersects = this.raycaster.intersectObjects(this.collidableObjects, true);
|
||||||
|
|
||||||
for (var i in intersects) {
|
for (var i in intersects) {
|
||||||
if (intersects[i].distance < Tools.norm(direction) + this.speed * 300) {
|
if (intersects[i].distance < Tools.norm(direction) + this.speed * 300 &&
|
||||||
|
intersects[i].object.raycastable) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,8 @@ TutoCamera.prototype.isColliding = function(direction) {
|
||||||
var intersects = this.raycaster.intersectObjects(this.collidableObjects, true);
|
var intersects = this.raycaster.intersectObjects(this.collidableObjects, true);
|
||||||
|
|
||||||
for (var i in intersects) {
|
for (var i in intersects) {
|
||||||
if (intersects[i].distance < Tools.norm(direction) + this.speed * 300) {
|
if (intersects[i].distance < Tools.norm(direction) + this.speed * 300 &&
|
||||||
|
intersects[i].object.raycastable) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,11 @@ function initPeachCastle(scene, collidableObjects, loader, static_path) {
|
||||||
object.raycastable = true;
|
object.raycastable = true;
|
||||||
if (object.material.name === 'Material.103_princess_peaches_cast') {
|
if (object.material.name === 'Material.103_princess_peaches_cast') {
|
||||||
object.material.transparent = true;
|
object.material.transparent = true;
|
||||||
|
} else if (object.material.name === 'Material.136_princess_peaches_cast') {
|
||||||
|
object.material.transparent = true;
|
||||||
|
object.material.opacity = 0.5;
|
||||||
|
object.raycastable = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue