Revert "In js, we don't know how to test if something is undefined"

This reverts commit 7c138c3c27.
This commit is contained in:
Thomas FORGIONE
2015-04-07 12:04:59 +02:00
parent 7c138c3c27
commit 96db6d177f
4 changed files with 9 additions and 9 deletions

View File

@@ -197,7 +197,7 @@ function click(event) {
// Looking for cameras
for (i in intersects) {
if (typeof minDistance === 'undefined' || intersects[i].distance < minDistance) {
if (minDistance === undefined || intersects[i].distance < minDistance) {
// We will not consider a line as clickable
if (! (intersects[i].object instanceof THREE.Line)) {
minDistance = intersects[i].distance;
@@ -205,7 +205,7 @@ function click(event) {
}
}
}
if (typeof bestIndex !== 'undefined') {
if (bestIndex !== undefined) {
cameras.setById(intersects[bestIndex].object.id);
}