fix list of tablet IDs ray cast checks in edit.js

This commit is contained in:
David Back 2018-03-16 16:57:54 -07:00 committed by Zach Fox
parent 0934a7d467
commit 3f2a49d243

View file

@ -776,9 +776,12 @@ function findClickedEntity(event) {
} }
var pickRay = Camera.computePickRay(event.x, event.y); var pickRay = Camera.computePickRay(event.x, event.y);
var overlayResult = Overlays.findRayIntersection(pickRay, true, getMainTabletIDs()); var tabletIDs = getMainTabletIDs();
if (overlayResult.intersects) { if (tabletIDs.length > 0) {
return null; var overlayResult = Overlays.findRayIntersection(pickRay, true, tabletIDs);
if (overlayResult.intersects) {
return null;
}
} }
var entityResult = Entities.findRayIntersection(pickRay, true); // want precision picking var entityResult = Entities.findRayIntersection(pickRay, true); // want precision picking
@ -967,8 +970,13 @@ function mouseReleaseEvent(event) {
function wasTabletClicked(event) { function wasTabletClicked(event) {
var rayPick = Camera.computePickRay(event.x, event.y); var rayPick = Camera.computePickRay(event.x, event.y);
var result = Overlays.findRayIntersection(rayPick, true, getMainTabletIDs()); var tabletIDs = getMainTabletIDs();
return result.intersects; if (tabletIDs.length === 0) {
return false;
} else {
var result = Overlays.findRayIntersection(rayPick, true, getMainTabletIDs());
return result.intersects;
}
} }
function mouseClickEvent(event) { function mouseClickEvent(event) {