From 4ec9299930c18495108da1125d66cdb89ec654ab Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Sat, 8 Oct 2016 14:31:30 -0700 Subject: [PATCH 1/5] fix reticle depth when not moving mouse, but moving head relative to HUD --- scripts/system/controllers/handControllerPointer.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/system/controllers/handControllerPointer.js b/scripts/system/controllers/handControllerPointer.js index f96e117d26..5bb8ea8a90 100644 --- a/scripts/system/controllers/handControllerPointer.js +++ b/scripts/system/controllers/handControllerPointer.js @@ -308,6 +308,17 @@ function hudReticleDistance() { // 3d distance from camera to the reticle positi var reticlePositionOnHUD = HMD.worldPointFromOverlay(Reticle.position); return Vec3.distance(reticlePositionOnHUD, HMD.position); } + +function maybeAdjustReticleDepth() { + if (HMD.active) { // set depth + if (isPointingAtOverlay()) { + Reticle.depth = hudReticleDistance(); + } + } +} +var ADJUST_RETICLE_DEPTH_INTERVAL = 50; // 20hz +Script.setInterval(maybeAdjustReticleDepth,ADJUST_RETICLE_DEPTH_INTERVAL); + function onMouseMove() { // Display cursor at correct depth (as in depthReticle.js), and updateMouseActivity. if (ignoreMouseActivity()) { From db5edb530a20b5bfb4787d2afd663b1f633a4e1d Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Sun, 9 Oct 2016 15:22:35 -0700 Subject: [PATCH 2/5] fix skybox changing when going between zones --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 2ef2beb274..e0fc03897a 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -478,7 +478,8 @@ bool EntityTreeRenderer::applySkyboxAndHasAmbient() { } } - if (_pendingSkyboxTexture && !_skyboxTexture) { + if (_pendingSkyboxTexture && + (!_skyboxTexture || (_skyboxTexture->getURL() != _skyboxTextureURL))) { _skyboxTexture = textureCache->getTexture(_skyboxTextureURL, NetworkTexture::CUBE_TEXTURE); } if (_skyboxTexture && _skyboxTexture->isLoaded()) { From 1051c068e145272d1612aabd4680d40ff124a96a Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Mon, 10 Oct 2016 13:47:08 -0700 Subject: [PATCH 3/5] kick by hand controller --- scripts/system/mod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/mod.js b/scripts/system/mod.js index 1a7b3b401e..ea9355e376 100644 --- a/scripts/system/mod.js +++ b/scripts/system/mod.js @@ -193,7 +193,7 @@ var triggerMapping = Controller.newMapping(Script.resolvePath('') + '-click'); function controllerComputePickRay(hand) { var controllerPose = getControllerWorldLocation(hand, true); if (controllerPose.valid) { - return { origin: controllerPose.position, direction: controllerPose.orientation }; + return { origin: controllerPose.position, direction: Quat.getUp(controllerPose.orientation) }; } } From e76a7fc577a0478d30cef5feb86464cca2b9aa51 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Mon, 10 Oct 2016 13:57:54 -0700 Subject: [PATCH 4/5] Crash fix for RenderableWebEntityItem::buildWebSurface Gracefully handle the absence of a gl context. We will continue to retry every render call. --- libraries/entities-renderer/src/RenderableWebEntityItem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp index 0b36e9db8b..021edde2c2 100644 --- a/libraries/entities-renderer/src/RenderableWebEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableWebEntityItem.cpp @@ -83,6 +83,9 @@ bool RenderableWebEntityItem::buildWebSurface(EntityTreeRenderer* renderer) { ++_currentWebCount; // Save the original GL context, because creating a QML surface will create a new context QOpenGLContext * currentContext = QOpenGLContext::currentContext(); + if (!currentContext) { + return false; + } QSurface * currentSurface = currentContext->surface(); auto deleter = [](OffscreenQmlSurface* webSurface) { From 333ec388a86fe8c6703cd73816ac6c9f657ca919 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Mon, 10 Oct 2016 14:30:47 -0700 Subject: [PATCH 5/5] make marketplace button state match whether tablet being shown --- scripts/system/marketplaces/marketplace.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/system/marketplaces/marketplace.js b/scripts/system/marketplaces/marketplace.js index 349c3f70e1..563a5289fc 100644 --- a/scripts/system/marketplaces/marketplace.js +++ b/scripts/system/marketplaces/marketplace.js @@ -39,6 +39,7 @@ function shouldShowWebTablet() { function showMarketplace(marketplaceID) { if (shouldShowWebTablet()) { + updateButtonState(true); marketplaceWebTablet = new WebTablet("https://metaverse.highfidelity.com/marketplace"); } else { var url = MARKETPLACE_URL; @@ -58,6 +59,7 @@ function hideMarketplace() { marketplaceWindow.setVisible(false); marketplaceWindow.setURL("about:blank"); } else if (marketplaceWebTablet) { + updateButtonState(false); marketplaceWebTablet.destroy(); marketplaceWebTablet = null; } @@ -83,10 +85,13 @@ var browseExamplesButton = toolBar.addButton({ alpha: 0.9 }); +function updateButtonState(visible) { + browseExamplesButton.writeProperty('buttonState', visible ? 0 : 1); + browseExamplesButton.writeProperty('defaultState', visible ? 0 : 1); + browseExamplesButton.writeProperty('hoverState', visible ? 2 : 3); +} function onMarketplaceWindowVisibilityChanged() { - browseExamplesButton.writeProperty('buttonState', marketplaceWindow.visible ? 0 : 1); - browseExamplesButton.writeProperty('defaultState', marketplaceWindow.visible ? 0 : 1); - browseExamplesButton.writeProperty('hoverState', marketplaceWindow.visible ? 2 : 3); + updateButtonState(marketplaceWindow.visible); marketplaceVisible = marketplaceWindow.visible; }