don't mouse-grab things through an overlay

This commit is contained in:
Seth Alves 2016-05-18 16:16:31 -07:00
parent 1c5e1bb5ea
commit b4df7cada7

View file

@ -320,6 +320,11 @@ Grabber.prototype.pressEvent = function(event) {
return; return;
} }
if (Overlays.getOverlayAtPoint(Reticle.position) > 0) {
// the mouse is pointing at an overlay; don't look for entities underneath the overlay.
return;
}
var pickRay = Camera.computePickRay(event.x, event.y); var pickRay = Camera.computePickRay(event.x, event.y);
var pickResults = Entities.findRayIntersection(pickRay, true); // accurate picking var pickResults = Entities.findRayIntersection(pickRay, true); // accurate picking
if (!pickResults.intersects) { if (!pickResults.intersects) {