mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:30:42 +02:00
show the hand controllers when in third-person+hmd, but currently, they're
at avatar hands instead of physical hand, which is not what we want!
This commit is contained in:
parent
06a6da3931
commit
47bef18bd4
1 changed files with 16 additions and 0 deletions
|
@ -22,6 +22,19 @@ var desktopMenuItemName = "Desktop";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var controllerDisplay = false;
|
||||||
|
function updateControllerDisplay() {
|
||||||
|
if (HMD.active && Menu.isOptionChecked("Third Person")) {
|
||||||
|
if (!controllerDisplay) {
|
||||||
|
HMD.requestShowHandControllers();
|
||||||
|
controllerDisplay = true;
|
||||||
|
}
|
||||||
|
} else if (controllerDisplay) {
|
||||||
|
HMD.requestHideHandControllers();
|
||||||
|
controllerDisplay = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
var button;
|
var button;
|
||||||
// Independent and Entity mode make people sick. Third Person and Mirror have traps that we need to work through.
|
// Independent and Entity mode make people sick. Third Person and Mirror have traps that we need to work through.
|
||||||
|
@ -34,6 +47,7 @@ function onHmdChanged(isHmd) {
|
||||||
desktopOnlyViews.forEach(function (view) {
|
desktopOnlyViews.forEach(function (view) {
|
||||||
Menu.setMenuEnabled("View>" + view, !isHmd);
|
Menu.setMenuEnabled("View>" + view, !isHmd);
|
||||||
});
|
});
|
||||||
|
updateControllerDisplay();
|
||||||
}
|
}
|
||||||
function onClicked(){
|
function onClicked(){
|
||||||
var isDesktop = Menu.isOptionChecked(desktopMenuItemName);
|
var isDesktop = Menu.isOptionChecked(desktopMenuItemName);
|
||||||
|
@ -52,11 +66,13 @@ if (headset) {
|
||||||
|
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
HMD.displayModeChanged.connect(onHmdChanged);
|
HMD.displayModeChanged.connect(onHmdChanged);
|
||||||
|
Camera.modeUpdated.connect(updateControllerDisplay);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
toolBar.removeButton("hmdToggle");
|
toolBar.removeButton("hmdToggle");
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
HMD.displayModeChanged.disconnect(onHmdChanged);
|
HMD.displayModeChanged.disconnect(onHmdChanged);
|
||||||
|
Camera.modeUpdated.disconnect(updateControllerDisplay);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue