mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:17:45 +02:00
Disable grab.js picks when in HMD
This commit is contained in:
parent
fcaa64b9ef
commit
79d09f68fd
1 changed files with 19 additions and 0 deletions
|
@ -221,6 +221,20 @@ function Grabber() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Grabber.prototype.setPicksEnabled = function(enabled) {
|
||||||
|
if (enabled) {
|
||||||
|
Picks.enablePick(this.mouseRayOverlays);
|
||||||
|
Pointers.enablePointer(this.mouseRayEntities);
|
||||||
|
} else {
|
||||||
|
Picks.disablePick(this.mouseRayOverlays);
|
||||||
|
Pointers.disablePointer(this.mouseRayEntities);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Grabber.prototype.displayModeChanged = function(isHMDMode) {
|
||||||
|
this.setPicksEnabled(!isHMDMode);
|
||||||
|
}
|
||||||
|
|
||||||
Grabber.prototype.computeNewGrabPlane = function() {
|
Grabber.prototype.computeNewGrabPlane = function() {
|
||||||
if (!this.isGrabbing) {
|
if (!this.isGrabbing) {
|
||||||
return;
|
return;
|
||||||
|
@ -488,6 +502,10 @@ Grabber.prototype.cleanup = function() {
|
||||||
|
|
||||||
var grabber = new Grabber();
|
var grabber = new Grabber();
|
||||||
|
|
||||||
|
function displayModeChanged(isHMDMode) {
|
||||||
|
grabber.displayModeChanged(isHMDMode);
|
||||||
|
}
|
||||||
|
|
||||||
function pressEvent(event) {
|
function pressEvent(event) {
|
||||||
grabber.pressEvent(event);
|
grabber.pressEvent(event);
|
||||||
}
|
}
|
||||||
|
@ -517,6 +535,7 @@ Controller.mouseMoveEvent.connect(moveEvent);
|
||||||
Controller.mouseReleaseEvent.connect(releaseEvent);
|
Controller.mouseReleaseEvent.connect(releaseEvent);
|
||||||
Controller.keyPressEvent.connect(keyPressEvent);
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||||
|
HMD.displayModeChanged.connect(displayModeChanged);
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
||||||
|
|
||||||
}()); // END LOCAL_SCOPE
|
}()); // END LOCAL_SCOPE
|
||||||
|
|
Loading…
Reference in a new issue