mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 14:47:19 +02:00
make hand-controller ui work in third person
This commit is contained in:
parent
5629db9109
commit
e2fded846f
3 changed files with 4 additions and 5 deletions
|
@ -511,10 +511,6 @@ function update() {
|
|||
return off(); // Let them use mouse in peace.
|
||||
}
|
||||
|
||||
if (!Menu.isOptionChecked("First Person")) {
|
||||
return off(); // What to do? menus can be behind hand!
|
||||
}
|
||||
|
||||
if ((!Window.hasFocus() && !HMD.active) || !Reticle.allowMouseCapture) {
|
||||
// In desktop it's pretty clear when another app is on top. In that case we bail, because
|
||||
// hand controllers might be sputtering "valid" data and that will keep someone from deliberately
|
||||
|
|
|
@ -26,7 +26,7 @@ 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.
|
||||
// Disable them in hmd.
|
||||
var desktopOnlyViews = ['Third Person', 'Mirror', 'Independent Mode', 'Entity Mode'];
|
||||
var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode'];
|
||||
function onHmdChanged(isHmd) {
|
||||
button.writeProperty('buttonState', isHmd ? 0 : 1);
|
||||
button.writeProperty('defaultState', isHmd ? 0 : 1);
|
||||
|
|
|
@ -42,6 +42,9 @@ getControllerWorldLocation = function (handController, doOffset) {
|
|||
if (doOffset) {
|
||||
position = Vec3.sum(position, Vec3.multiplyQbyV(orientation, getGrabPointSphereOffset(handController)));
|
||||
}
|
||||
if (Menu.isOptionChecked("Third Person")) {
|
||||
position = Vec3.sum(position, Vec3.subtract(Camera.position, MyAvatar.getEyePosition()));
|
||||
}
|
||||
} else if (!HMD.isHandControllerAvailable()) {
|
||||
position = MyAvatar.getHeadPosition();
|
||||
orientation = Quat.multiply(MyAvatar.headOrientation, Quat.angleAxis(-90, { x: 1, y: 0, z: 0 }));
|
||||
|
|
Loading…
Reference in a new issue