mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 10:02:12 +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 button;
|
||||
// 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) {
|
||||
Menu.setMenuEnabled("View>" + view, !isHmd);
|
||||
});
|
||||
updateControllerDisplay();
|
||||
}
|
||||
function onClicked(){
|
||||
var isDesktop = Menu.isOptionChecked(desktopMenuItemName);
|
||||
|
@ -52,11 +66,13 @@ if (headset) {
|
|||
|
||||
button.clicked.connect(onClicked);
|
||||
HMD.displayModeChanged.connect(onHmdChanged);
|
||||
Camera.modeUpdated.connect(updateControllerDisplay);
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
toolBar.removeButton("hmdToggle");
|
||||
button.clicked.disconnect(onClicked);
|
||||
HMD.displayModeChanged.disconnect(onHmdChanged);
|
||||
Camera.modeUpdated.disconnect(updateControllerDisplay);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue