Improved clicking so you can't click on objects too close to be
displayed
This commit is contained in:
parent
b1b64d73ba
commit
d37d2cc9e1
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue