Fix tablet showing up for a short time on launch

This commit is contained in:
Ryan Huffman 2017-05-09 15:12:12 -07:00
parent 713ddd5cef
commit 51db0cef98
2 changed files with 9 additions and 5 deletions

View file

@ -96,7 +96,7 @@ function calcSpawnInfo(hand, height) {
* @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.
*/
WebTablet = function (url, width, dpi, hand, clientOnly, location) {
WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) {
var _this = this;
@ -107,6 +107,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) {
this.depth = TABLET_NATURAL_DIMENSIONS.z * tabletScaleFactor;
this.landscape = false;
visible = visible === true;
if (dpi) {
this.dpi = dpi;
} else {
@ -125,7 +127,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) {
"grabbableKey": {"grabbable": true}
}),
dimensions: this.getDimensions(),
parentID: AVATAR_SELF_ID
parentID: AVATAR_SELF_ID,
visible: visible
};
// compute position, rotation & parentJointIndex of the tablet
@ -158,7 +161,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location) {
parentID: this.tabletEntityID,
parentJointIndex: -1,
showKeyboardFocusHighlight: false,
isAA: HMD.active
isAA: HMD.active,
visible: visible
});
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},
dimensions: { x: 4 * tabletScaleFactor, y: 4 * tabletScaleFactor, z: 4 * tabletScaleFactor},
alpha: 0.0,
visible: true,
visible: visible,
drawInFront: false,
parentID: this.tabletEntityID,
parentJointIndex: -1

View file

@ -92,7 +92,7 @@
tabletScalePercentage = getTabletScalePercentageFromSettings();
UIWebTablet = new WebTablet("qml/hifi/tablet/TabletRoot.qml",
DEFAULT_WIDTH * (tabletScalePercentage / 100),
null, activeHand, true);
null, activeHand, true, null, false);
UIWebTablet.register();
HMD.tabletID = UIWebTablet.tabletEntityID;
HMD.homeButtonID = UIWebTablet.homeButtonID;