mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:29:01 +02:00
Make 3D "x" button work
This commit is contained in:
parent
ef7ea0eaa6
commit
7d1cc1f20d
1 changed files with 9 additions and 3 deletions
|
@ -495,12 +495,18 @@ function onMuteStateChanged() {
|
||||||
|
|
||||||
// handles mouse clicks on buttons
|
// handles mouse clicks on buttons
|
||||||
function mousePressEvent(event) {
|
function mousePressEvent(event) {
|
||||||
var clickedOverlay,
|
var pickRay,
|
||||||
|
clickedOverlay,
|
||||||
i;
|
i;
|
||||||
|
|
||||||
clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y }); //identify which overlay was clicked
|
if (isOnHMD) {
|
||||||
|
pickRay = Camera.computePickRay(event.x, event.y);
|
||||||
|
clickedOverlay = Overlays.findRayIntersection(pickRay).overlayID;
|
||||||
|
} else {
|
||||||
|
clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y });
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < buttons.length; i += 1) { //if user clicked a button
|
for (i = 0; i < buttons.length; i += 1) {
|
||||||
if (clickedOverlay === buttons[i]) {
|
if (clickedOverlay === buttons[i]) {
|
||||||
deleteNotification(i);
|
deleteNotification(i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue