mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 13:44:32 +02:00
Merge pull request #9786 from druiz17/tablet-scaling-fix
Tablet homebutton dimension and position now scales with tablet
This commit is contained in:
commit
a8ae693cef
2 changed files with 12 additions and 6 deletions
|
@ -151,12 +151,12 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
|
||||||
isAA: HMD.active
|
isAA: HMD.active
|
||||||
});
|
});
|
||||||
|
|
||||||
var HOME_BUTTON_Y_OFFSET = (this.height / 2) - 0.035;
|
var HOME_BUTTON_Y_OFFSET = (this.height / 2) - 0.009;
|
||||||
this.homeButtonEntity = Overlays.addOverlay("sphere", {
|
this.homeButtonEntity = Overlays.addOverlay("sphere", {
|
||||||
name: "homeButton",
|
name: "homeButton",
|
||||||
localPosition: {x: 0.0, y: -HOME_BUTTON_Y_OFFSET, z: -0.01},
|
localPosition: {x: -0.001, y: -HOME_BUTTON_Y_OFFSET, z: 0.0},
|
||||||
localRotation: Quat.angleAxis(0, Y_AXIS),
|
localRotation: Quat.angleAxis(0, Y_AXIS),
|
||||||
dimensions: { x: 0.04, y: 0.04, z: 0.02},
|
dimensions: { x: 4 * tabletScaleFactor, y: 4 * tabletScaleFactor, z: 4 * tabletScaleFactor},
|
||||||
alpha: 0.0,
|
alpha: 0.0,
|
||||||
visible: true,
|
visible: true,
|
||||||
drawInFront: false,
|
drawInFront: false,
|
||||||
|
|
|
@ -26,9 +26,15 @@
|
||||||
print("show tablet-ui");
|
print("show tablet-ui");
|
||||||
|
|
||||||
var DEFAULT_WIDTH = 0.4375;
|
var DEFAULT_WIDTH = 0.4375;
|
||||||
var DEFAULT_HMD_TABLET_SCALE = 100;
|
var DEFAULT_TABLET_SCALE = 100;
|
||||||
var HMD_TABLET_SCALE = Settings.getValue("hmdTabletScale") || DEFAULT_HMD_TABLET_SCALE;
|
var toolbarMode = Tablet.getTablet("com.highfidelity.interface.tablet.system").toolbarMode;
|
||||||
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", DEFAULT_WIDTH * (HMD_TABLET_SCALE / 100), null, activeHand, true);
|
var TABLET_SCALE = DEFAULT_TABLET_SCALE;
|
||||||
|
if (toolbarMode) {
|
||||||
|
TABLET_SCALE = Settings.getValue("desktopTabletScale") || DEFAULT_TABLET_SCALE;
|
||||||
|
} else {
|
||||||
|
TABLET_SCALE = Settings.getValue("hmdTabletScale") || DEFAULT_TABLET_SCALE;
|
||||||
|
}
|
||||||
|
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml", DEFAULT_WIDTH * (TABLET_SCALE / 100), null, activeHand, true);
|
||||||
UIWebTablet.register();
|
UIWebTablet.register();
|
||||||
HMD.tabletID = UIWebTablet.tabletEntityID;
|
HMD.tabletID = UIWebTablet.tabletEntityID;
|
||||||
HMD.homeButtonID = UIWebTablet.homeButtonEntity;
|
HMD.homeButtonID = UIWebTablet.homeButtonEntity;
|
||||||
|
|
Loading…
Reference in a new issue