mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 13:04:07 +02:00
handle click event on overlays only when in ignore mode
This commit is contained in:
parent
946c7d4644
commit
aa433e7233
1 changed files with 13 additions and 11 deletions
|
@ -134,20 +134,22 @@ function handleSelectedOverlay(clickedOverlay) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Controller.mousePressEvent.connect(function(event){
|
Controller.mousePressEvent.connect(function(event){
|
||||||
// handle click events so we can detect when our overlays are clicked
|
if (isShowingOverlays) {
|
||||||
|
// handle click events so we can detect when our overlays are clicked
|
||||||
|
|
||||||
if (!event.isLeftButton) {
|
if (!event.isLeftButton) {
|
||||||
// if another mouse button than left is pressed ignore it
|
// if another mouse button than left is pressed ignore it
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute the pick ray from the event
|
// compute the pick ray from the event
|
||||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
|
|
||||||
// grab the clicked overlay for the given pick ray
|
// grab the clicked overlay for the given pick ray
|
||||||
var clickedOverlay = Overlays.findRayIntersection(pickRay);
|
var clickedOverlay = Overlays.findRayIntersection(pickRay);
|
||||||
if (clickedOverlay.intersects) {
|
if (clickedOverlay.intersects) {
|
||||||
handleSelectedOverlay(clickedOverlay);
|
handleSelectedOverlay(clickedOverlay);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue