mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 15:47:02 +02:00
Fix tablet showing up for a short time on launch
This commit is contained in:
parent
713ddd5cef
commit
51db0cef98
2 changed files with 9 additions and 5 deletions
|
@ -96,7 +96,7 @@ function calcSpawnInfo(hand, height) {
|
||||||
* @param hand [number] -1 indicates no hand, Controller.Standard.RightHand or Controller.Standard.LeftHand
|
* @param hand [number] -1 indicates no hand, Controller.Standard.RightHand or Controller.Standard.LeftHand
|
||||||
* @param clientOnly [bool] true indicates tablet model is only visible to client.
|
* @param clientOnly [bool] true indicates tablet model is only visible to client.
|
||||||
*/
|
*/
|
||||||
WebTablet = function (url, width, dpi, hand, clientOnly, location) {
|
WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) {
|
||||||
|
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
|
@ -107,6 +107,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) {
|
||||||
this.depth = TABLET_NATURAL_DIMENSIONS.z * tabletScaleFactor;
|
this.depth = TABLET_NATURAL_DIMENSIONS.z * tabletScaleFactor;
|
||||||
this.landscape = false;
|
this.landscape = false;
|
||||||
|
|
||||||
|
visible = visible === true;
|
||||||
|
|
||||||
if (dpi) {
|
if (dpi) {
|
||||||
this.dpi = dpi;
|
this.dpi = dpi;
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,7 +127,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) {
|
||||||
"grabbableKey": {"grabbable": true}
|
"grabbableKey": {"grabbable": true}
|
||||||
}),
|
}),
|
||||||
dimensions: this.getDimensions(),
|
dimensions: this.getDimensions(),
|
||||||
parentID: AVATAR_SELF_ID
|
parentID: AVATAR_SELF_ID,
|
||||||
|
visible: visible
|
||||||
};
|
};
|
||||||
|
|
||||||
// compute position, rotation & parentJointIndex of the tablet
|
// compute position, rotation & parentJointIndex of the tablet
|
||||||
|
@ -158,7 +161,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) {
|
||||||
parentID: this.tabletEntityID,
|
parentID: this.tabletEntityID,
|
||||||
parentJointIndex: -1,
|
parentJointIndex: -1,
|
||||||
showKeyboardFocusHighlight: false,
|
showKeyboardFocusHighlight: false,
|
||||||
isAA: HMD.active
|
isAA: HMD.active,
|
||||||
|
visible: visible
|
||||||
});
|
});
|
||||||
|
|
||||||
var HOME_BUTTON_Y_OFFSET = (this.height / 2) - (this.height / 20);
|
var HOME_BUTTON_Y_OFFSET = (this.height / 2) - (this.height / 20);
|
||||||
|
@ -168,7 +172,7 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) {
|
||||||
localRotation: {x: 0, y: 1, z: 0, w: 0},
|
localRotation: {x: 0, y: 1, z: 0, w: 0},
|
||||||
dimensions: { x: 4 * tabletScaleFactor, y: 4 * tabletScaleFactor, z: 4 * tabletScaleFactor},
|
dimensions: { x: 4 * tabletScaleFactor, y: 4 * tabletScaleFactor, z: 4 * tabletScaleFactor},
|
||||||
alpha: 0.0,
|
alpha: 0.0,
|
||||||
visible: true,
|
visible: visible,
|
||||||
drawInFront: false,
|
drawInFront: false,
|
||||||
parentID: this.tabletEntityID,
|
parentID: this.tabletEntityID,
|
||||||
parentJointIndex: -1
|
parentJointIndex: -1
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
tabletScalePercentage = getTabletScalePercentageFromSettings();
|
tabletScalePercentage = getTabletScalePercentageFromSettings();
|
||||||
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml",
|
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml",
|
||||||
DEFAULT_WIDTH * (tabletScalePercentage / 100),
|
DEFAULT_WIDTH * (tabletScalePercentage / 100),
|
||||||
null, activeHand, true);
|
null, activeHand, true, null, false);
|
||||||
UIWebTablet.register();
|
UIWebTablet.register();
|
||||||
HMD.tabletID = UIWebTablet.tabletEntityID;
|
HMD.tabletID = UIWebTablet.tabletEntityID;
|
||||||
HMD.homeButtonID = UIWebTablet.homeButtonID;
|
HMD.homeButtonID = UIWebTablet.homeButtonID;
|
||||||
|
|
Loading…
Reference in a new issue