Improved clicking so you can't click on objects too close to be

displayed
This commit is contained in:
Thomas FORGIONE 2015-04-08 11:47:47 +02:00
parent b1b64d73ba
commit d37d2cc9e1
1 changed files with 1 additions and 1 deletions

View File

@ -196,7 +196,7 @@ function click(event) {
// Looking for cameras // Looking for cameras
for (i in intersects) { for (i in intersects) {
if (minDistance === undefined || intersects[i].distance < minDistance) { if ((intersects[i].distance > 50 && minDistance === undefined) || (intersects[i].distance < minDistance )) {
// We will not consider a line as clickable // We will not consider a line as clickable
if (! (intersects[i].object instanceof THREE.Line)) { if (! (intersects[i].object instanceof THREE.Line)) {
minDistance = intersects[i].distance; minDistance = intersects[i].distance;