mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Merge pull request #10426 from huffman/fix/tablet-invisible-by-default
Fix tablet showing up for a short period of time on launch
This commit is contained in:
commit
0a3a2705af
3 changed files with 13 additions and 9 deletions
|
@ -225,10 +225,6 @@ void Web3DOverlay::setMaxFPS(uint8_t maxFPS) {
|
|||
}
|
||||
|
||||
void Web3DOverlay::render(RenderArgs* args) {
|
||||
if (!_visible || !getParentVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
|
||||
QSurface * currentSurface = currentContext->surface();
|
||||
if (!_webSurface) {
|
||||
|
@ -282,6 +278,10 @@ void Web3DOverlay::render(RenderArgs* args) {
|
|||
_webSurface->resize(QSize(_resolution.x, _resolution.y));
|
||||
}
|
||||
|
||||
if (!_visible || !getParentVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
vec2 halfSize = getSize() / 2.0f;
|
||||
vec4 color(toGlm(getColor()), getAlpha());
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue