Merge branch 'master' of https://github.com/highfidelity/hifi into hdr

This commit is contained in:
samcake 2016-10-10 15:56:37 -07:00
commit 5bb26fdb7f
5 changed files with 25 additions and 5 deletions

View file

@ -478,7 +478,8 @@ bool EntityTreeRenderer::applySkyboxAndHasAmbient() {
} }
} }
if (_pendingSkyboxTexture && !_skyboxTexture) { if (_pendingSkyboxTexture &&
(!_skyboxTexture || (_skyboxTexture->getURL() != _skyboxTextureURL))) {
_skyboxTexture = textureCache->getTexture(_skyboxTextureURL, NetworkTexture::CUBE_TEXTURE); _skyboxTexture = textureCache->getTexture(_skyboxTextureURL, NetworkTexture::CUBE_TEXTURE);
} }
if (_skyboxTexture && _skyboxTexture->isLoaded()) { if (_skyboxTexture && _skyboxTexture->isLoaded()) {

View file

@ -83,6 +83,9 @@ bool RenderableWebEntityItem::buildWebSurface(EntityTreeRenderer* renderer) {
++_currentWebCount; ++_currentWebCount;
// Save the original GL context, because creating a QML surface will create a new context // Save the original GL context, because creating a QML surface will create a new context
QOpenGLContext * currentContext = QOpenGLContext::currentContext(); QOpenGLContext * currentContext = QOpenGLContext::currentContext();
if (!currentContext) {
return false;
}
QSurface * currentSurface = currentContext->surface(); QSurface * currentSurface = currentContext->surface();
auto deleter = [](OffscreenQmlSurface* webSurface) { auto deleter = [](OffscreenQmlSurface* webSurface) {

View file

@ -308,6 +308,17 @@ function hudReticleDistance() { // 3d distance from camera to the reticle positi
var reticlePositionOnHUD = HMD.worldPointFromOverlay(Reticle.position); var reticlePositionOnHUD = HMD.worldPointFromOverlay(Reticle.position);
return Vec3.distance(reticlePositionOnHUD, HMD.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() { function onMouseMove() {
// Display cursor at correct depth (as in depthReticle.js), and updateMouseActivity. // Display cursor at correct depth (as in depthReticle.js), and updateMouseActivity.
if (ignoreMouseActivity()) { if (ignoreMouseActivity()) {

View file

@ -39,6 +39,7 @@ function shouldShowWebTablet() {
function showMarketplace(marketplaceID) { function showMarketplace(marketplaceID) {
if (shouldShowWebTablet()) { if (shouldShowWebTablet()) {
updateButtonState(true);
marketplaceWebTablet = new WebTablet("https://metaverse.highfidelity.com/marketplace"); marketplaceWebTablet = new WebTablet("https://metaverse.highfidelity.com/marketplace");
} else { } else {
var url = MARKETPLACE_URL; var url = MARKETPLACE_URL;
@ -58,6 +59,7 @@ function hideMarketplace() {
marketplaceWindow.setVisible(false); marketplaceWindow.setVisible(false);
marketplaceWindow.setURL("about:blank"); marketplaceWindow.setURL("about:blank");
} else if (marketplaceWebTablet) { } else if (marketplaceWebTablet) {
updateButtonState(false);
marketplaceWebTablet.destroy(); marketplaceWebTablet.destroy();
marketplaceWebTablet = null; marketplaceWebTablet = null;
} }
@ -83,10 +85,13 @@ var browseExamplesButton = toolBar.addButton({
alpha: 0.9 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() { function onMarketplaceWindowVisibilityChanged() {
browseExamplesButton.writeProperty('buttonState', marketplaceWindow.visible ? 0 : 1); updateButtonState(marketplaceWindow.visible);
browseExamplesButton.writeProperty('defaultState', marketplaceWindow.visible ? 0 : 1);
browseExamplesButton.writeProperty('hoverState', marketplaceWindow.visible ? 2 : 3);
marketplaceVisible = marketplaceWindow.visible; marketplaceVisible = marketplaceWindow.visible;
} }

View file

@ -193,7 +193,7 @@ var triggerMapping = Controller.newMapping(Script.resolvePath('') + '-click');
function controllerComputePickRay(hand) { function controllerComputePickRay(hand) {
var controllerPose = getControllerWorldLocation(hand, true); var controllerPose = getControllerWorldLocation(hand, true);
if (controllerPose.valid) { if (controllerPose.valid) {
return { origin: controllerPose.position, direction: controllerPose.orientation }; return { origin: controllerPose.position, direction: Quat.getUp(controllerPose.orientation) };
} }
} }