mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Fix disabling mouse look when switching to VR mode
This commit is contained in:
parent
3fe3284258
commit
89f826fa5c
1 changed files with 5 additions and 7 deletions
|
@ -6,7 +6,7 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon)
|
|||
|
||||
var away;
|
||||
|
||||
var hmd;
|
||||
var hmd = HMD.active;
|
||||
|
||||
var mouseLookEnabled = Camera.getMouseLook();
|
||||
|
||||
|
@ -16,8 +16,6 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon)
|
|||
|
||||
var tempOff = false;
|
||||
|
||||
hmd = AvatarInputs.isHMD;
|
||||
|
||||
Camera.mouseLookChanged.connect(onMouseLookChanged);
|
||||
|
||||
function onMouseLookChanged(newMouseLook) {
|
||||
|
@ -112,11 +110,11 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon)
|
|||
}
|
||||
}
|
||||
|
||||
AvatarInputs.isHMDChanged.connect(onIsHMDChanged);
|
||||
HMD.displayModeChanged.connect(onDisplayModeChanged);
|
||||
|
||||
function onIsHMDChanged() {
|
||||
function onDisplayModeChanged() {
|
||||
if (mouseLookEnabled) {
|
||||
if (AvatarInputs.isHMD) {
|
||||
if (HMD.active) {
|
||||
hmd = true;
|
||||
mouseLookOff();
|
||||
} else {
|
||||
|
@ -149,7 +147,7 @@ by rampa3 (https://github.com/rampa3) and vegaslon (https://github.com/vegaslon)
|
|||
tablet.tabletShownChanged.disconnect(onTabletShownChanged);
|
||||
MyAvatar.wentAway.disconnect(onWentAway);
|
||||
MyAvatar.wentActive.disconnect(onWentActive);
|
||||
AvatarInputs.isHMDChanged.disconnect(onIsHMDChanged);
|
||||
HMD.displayModeChanged.disconnect(onDisplayModeChanged);
|
||||
Camera.modeUpdated.disconnect(onCameraModeUpdated);
|
||||
Script.scriptEnding.disconnect(onScriptEnding);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue