mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:07:52 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into dk/transactionHistoryDisplay
This commit is contained in:
commit
3955624e63
13 changed files with 83 additions and 82 deletions
10
interface/resources/qml/hifi/tablet/BlocksWebView.qml
Normal file
10
interface/resources/qml/hifi/tablet/BlocksWebView.qml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtWebEngine 1.2
|
||||||
|
|
||||||
|
import "../../controls" as Controls
|
||||||
|
|
||||||
|
Controls.TabletWebView {
|
||||||
|
profile: WebEngineProfile { httpUserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ Item {
|
||||||
|
|
||||||
function loadTabletWebBase() {
|
function loadTabletWebBase() {
|
||||||
loader.source = "";
|
loader.source = "";
|
||||||
loader.source = "../../controls/TabletWebView.qml";
|
loader.source = "./BlocksWebView.qml";
|
||||||
}
|
}
|
||||||
|
|
||||||
function returnToPreviousApp() {
|
function returnToPreviousApp() {
|
||||||
|
|
|
@ -44,7 +44,7 @@ Windows.ScrollingWindow {
|
||||||
|
|
||||||
function loadTabletWebBase() {
|
function loadTabletWebBase() {
|
||||||
loader.source = "";
|
loader.source = "";
|
||||||
loader.source = "../../controls/TabletWebView.qml";
|
loader.source = "./BlocksWebView.qml";
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadWebUrl(url, injectedJavaScriptUrl) {
|
function loadWebUrl(url, injectedJavaScriptUrl) {
|
||||||
|
|
|
@ -6457,7 +6457,7 @@ void Application::addAssetToWorldFromURL(QString url) {
|
||||||
}
|
}
|
||||||
if (url.contains("vr.google.com/downloads")) {
|
if (url.contains("vr.google.com/downloads")) {
|
||||||
filename = url.section('/', -1);
|
filename = url.section('/', -1);
|
||||||
filename.remove(".zip?noDownload=false");
|
filename.remove(".zip");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
|
if (!DependencyManager::get<NodeList>()->getThisNodeCanWriteAssets()) {
|
||||||
|
@ -6487,7 +6487,7 @@ void Application::addAssetToWorldFromURLRequestFinished() {
|
||||||
}
|
}
|
||||||
if (url.contains("vr.google.com/downloads")) {
|
if (url.contains("vr.google.com/downloads")) {
|
||||||
filename = url.section('/', -1);
|
filename = url.section('/', -1);
|
||||||
filename.remove(".zip?noDownload=false");
|
filename.remove(".zip");
|
||||||
isBlocks = true;
|
isBlocks = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6504,6 +6504,7 @@ void Application::addAssetToWorldFromURLRequestFinished() {
|
||||||
if (tempFile.open(QIODevice::WriteOnly)) {
|
if (tempFile.open(QIODevice::WriteOnly)) {
|
||||||
tempFile.write(request->getData());
|
tempFile.write(request->getData());
|
||||||
addAssetToWorldInfoClear(filename); // Remove message from list; next one added will have a different key.
|
addAssetToWorldInfoClear(filename); // Remove message from list; next one added will have a different key.
|
||||||
|
tempFile.close();
|
||||||
qApp->getFileDownloadInterface()->runUnzip(downloadPath, url, true, false, isBlocks);
|
qApp->getFileDownloadInterface()->runUnzip(downloadPath, url, true, false, isBlocks);
|
||||||
} else {
|
} else {
|
||||||
QString errorInfo = "Couldn't open temporary file for download";
|
QString errorInfo = "Couldn't open temporary file for download";
|
||||||
|
|
|
@ -26,8 +26,7 @@ Base3DOverlay::Base3DOverlay() :
|
||||||
_isSolid(DEFAULT_IS_SOLID),
|
_isSolid(DEFAULT_IS_SOLID),
|
||||||
_isDashedLine(DEFAULT_IS_DASHED_LINE),
|
_isDashedLine(DEFAULT_IS_DASHED_LINE),
|
||||||
_ignoreRayIntersection(false),
|
_ignoreRayIntersection(false),
|
||||||
_drawInFront(false),
|
_drawInFront(false)
|
||||||
_isAA(true)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +38,6 @@ Base3DOverlay::Base3DOverlay(const Base3DOverlay* base3DOverlay) :
|
||||||
_isDashedLine(base3DOverlay->_isDashedLine),
|
_isDashedLine(base3DOverlay->_isDashedLine),
|
||||||
_ignoreRayIntersection(base3DOverlay->_ignoreRayIntersection),
|
_ignoreRayIntersection(base3DOverlay->_ignoreRayIntersection),
|
||||||
_drawInFront(base3DOverlay->_drawInFront),
|
_drawInFront(base3DOverlay->_drawInFront),
|
||||||
_isAA(base3DOverlay->_isAA),
|
|
||||||
_isGrabbable(base3DOverlay->_isGrabbable)
|
_isGrabbable(base3DOverlay->_isGrabbable)
|
||||||
{
|
{
|
||||||
setTransform(base3DOverlay->getTransform());
|
setTransform(base3DOverlay->getTransform());
|
||||||
|
@ -191,13 +189,6 @@ void Base3DOverlay::setProperties(const QVariantMap& originalProperties) {
|
||||||
needRenderItemUpdate = true;
|
needRenderItemUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto isAA = properties["isAA"];
|
|
||||||
if (isAA.isValid()) {
|
|
||||||
bool value = isAA.toBool();
|
|
||||||
setIsAA(value);
|
|
||||||
needRenderItemUpdate = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Communicate changes to the renderItem if needed
|
// Communicate changes to the renderItem if needed
|
||||||
if (needRenderItemUpdate) {
|
if (needRenderItemUpdate) {
|
||||||
auto itemID = getRenderItemID();
|
auto itemID = getRenderItemID();
|
||||||
|
@ -253,9 +244,6 @@ QVariant Base3DOverlay::getProperty(const QString& property) {
|
||||||
if (property == "parentJointIndex") {
|
if (property == "parentJointIndex") {
|
||||||
return getParentJointIndex();
|
return getParentJointIndex();
|
||||||
}
|
}
|
||||||
if (property == "isAA") {
|
|
||||||
return _isAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Overlay::getProperty(property);
|
return Overlay::getProperty(property);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,14 +43,11 @@ public:
|
||||||
bool getDrawInFront() const { return _drawInFront; }
|
bool getDrawInFront() const { return _drawInFront; }
|
||||||
bool getIsGrabbable() const { return _isGrabbable; }
|
bool getIsGrabbable() const { return _isGrabbable; }
|
||||||
|
|
||||||
virtual bool isAA() const { return _isAA; }
|
|
||||||
|
|
||||||
void setLineWidth(float lineWidth) { _lineWidth = lineWidth; }
|
void setLineWidth(float lineWidth) { _lineWidth = lineWidth; }
|
||||||
void setIsSolid(bool isSolid) { _isSolid = isSolid; }
|
void setIsSolid(bool isSolid) { _isSolid = isSolid; }
|
||||||
void setIsDashedLine(bool isDashedLine) { _isDashedLine = isDashedLine; }
|
void setIsDashedLine(bool isDashedLine) { _isDashedLine = isDashedLine; }
|
||||||
void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; }
|
void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; }
|
||||||
void setDrawInFront(bool value) { _drawInFront = value; }
|
void setDrawInFront(bool value) { _drawInFront = value; }
|
||||||
void setIsAA(bool value) { _isAA = value; }
|
|
||||||
void setIsGrabbable(bool value) { _isGrabbable = value; }
|
void setIsGrabbable(bool value) { _isGrabbable = value; }
|
||||||
|
|
||||||
virtual AABox getBounds() const override = 0;
|
virtual AABox getBounds() const override = 0;
|
||||||
|
@ -75,7 +72,6 @@ protected:
|
||||||
bool _isDashedLine;
|
bool _isDashedLine;
|
||||||
bool _ignoreRayIntersection;
|
bool _ignoreRayIntersection;
|
||||||
bool _drawInFront;
|
bool _drawInFront;
|
||||||
bool _isAA;
|
|
||||||
bool _isGrabbable { false };
|
bool _isGrabbable { false };
|
||||||
|
|
||||||
QString _name;
|
QString _name;
|
||||||
|
|
|
@ -335,9 +335,9 @@ void Web3DOverlay::render(RenderArgs* args) {
|
||||||
batch.setModelTransform(transform);
|
batch.setModelTransform(transform);
|
||||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
if (color.a < OPAQUE_ALPHA_THRESHOLD) {
|
if (color.a < OPAQUE_ALPHA_THRESHOLD) {
|
||||||
geometryCache->bindTransparentWebBrowserProgram(batch, _isAA);
|
geometryCache->bindWebBrowserProgram(batch, true);
|
||||||
} else {
|
} else {
|
||||||
geometryCache->bindOpaqueWebBrowserProgram(batch, _isAA);
|
geometryCache->bindWebBrowserProgram(batch);
|
||||||
}
|
}
|
||||||
geometryCache->renderQuad(batch, halfSize * -1.0f, halfSize, vec2(0), vec2(1), color, _geometryId);
|
geometryCache->renderQuad(batch, halfSize * -1.0f, halfSize, vec2(0), vec2(1), color, _geometryId);
|
||||||
batch.setResourceTexture(0, nullptr); // restore default white color after me
|
batch.setResourceTexture(0, nullptr); // restore default white color after me
|
||||||
|
|
|
@ -182,11 +182,10 @@ void WebEntityRenderer::doRender(RenderArgs* args) {
|
||||||
float fadeRatio = _isFading ? Interpolate::calculateFadeRatio(_fadeStartTime) : 1.0f;
|
float fadeRatio = _isFading ? Interpolate::calculateFadeRatio(_fadeStartTime) : 1.0f;
|
||||||
batch._glColor4f(1.0f, 1.0f, 1.0f, fadeRatio);
|
batch._glColor4f(1.0f, 1.0f, 1.0f, fadeRatio);
|
||||||
|
|
||||||
const bool IS_AA = true;
|
|
||||||
if (fadeRatio < OPAQUE_ALPHA_THRESHOLD) {
|
if (fadeRatio < OPAQUE_ALPHA_THRESHOLD) {
|
||||||
DependencyManager::get<GeometryCache>()->bindTransparentWebBrowserProgram(batch, IS_AA);
|
DependencyManager::get<GeometryCache>()->bindWebBrowserProgram(batch, true);
|
||||||
} else {
|
} else {
|
||||||
DependencyManager::get<GeometryCache>()->bindOpaqueWebBrowserProgram(batch, IS_AA);
|
DependencyManager::get<GeometryCache>()->bindWebBrowserProgram(batch);
|
||||||
}
|
}
|
||||||
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texMin, texMax, glm::vec4(1.0f, 1.0f, 1.0f, fadeRatio), _geometryId);
|
DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texMin, texMax, glm::vec4(1.0f, 1.0f, 1.0f, fadeRatio), _geometryId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,10 +132,13 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
||||||
if (args.bitstreamVersion < VERSION_ENTITIES_ANIMATION_PROPERTIES_GROUP) {
|
if (args.bitstreamVersion < VERSION_ENTITIES_ANIMATION_PROPERTIES_GROUP) {
|
||||||
READ_ENTITY_PROPERTY(PROP_ANIMATION_SETTINGS, QString, setAnimationSettings);
|
READ_ENTITY_PROPERTY(PROP_ANIMATION_SETTINGS, QString, setAnimationSettings);
|
||||||
} else {
|
} else {
|
||||||
// Note: since we've associated our _animationProperties with our _animationLoop, the readEntitySubclassDataFromBuffer()
|
int bytesFromAnimation;
|
||||||
// will automatically read into the animation loop
|
withWriteLock([&] {
|
||||||
int bytesFromAnimation = _animationProperties.readEntitySubclassDataFromBuffer(dataAt, (bytesLeftToRead - bytesRead), args,
|
// Note: since we've associated our _animationProperties with our _animationLoop, the readEntitySubclassDataFromBuffer()
|
||||||
propertyFlags, overwriteLocalData, animationPropertiesChanged);
|
// will automatically read into the animation loop
|
||||||
|
bytesFromAnimation = _animationProperties.readEntitySubclassDataFromBuffer(dataAt, (bytesLeftToRead - bytesRead), args,
|
||||||
|
propertyFlags, overwriteLocalData, animationPropertiesChanged);
|
||||||
|
});
|
||||||
|
|
||||||
bytesRead += bytesFromAnimation;
|
bytesRead += bytesFromAnimation;
|
||||||
dataAt += bytesFromAnimation;
|
dataAt += bytesFromAnimation;
|
||||||
|
@ -188,8 +191,10 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
||||||
APPEND_ENTITY_PROPERTY(PROP_COMPOUND_SHAPE_URL, getCompoundShapeURL());
|
APPEND_ENTITY_PROPERTY(PROP_COMPOUND_SHAPE_URL, getCompoundShapeURL());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_TEXTURES, getTextures());
|
APPEND_ENTITY_PROPERTY(PROP_TEXTURES, getTextures());
|
||||||
|
|
||||||
_animationProperties.appendSubclassData(packetData, params, entityTreeElementExtraEncodeData, requestedProperties,
|
withReadLock([&] {
|
||||||
propertyFlags, propertiesDidntFit, propertyCount, appendState);
|
_animationProperties.appendSubclassData(packetData, params, entityTreeElementExtraEncodeData, requestedProperties,
|
||||||
|
propertyFlags, propertiesDidntFit, propertyCount, appendState);
|
||||||
|
});
|
||||||
|
|
||||||
APPEND_ENTITY_PROPERTY(PROP_SHAPE_TYPE, (uint32_t)getShapeType());
|
APPEND_ENTITY_PROPERTY(PROP_SHAPE_TYPE, (uint32_t)getShapeType());
|
||||||
|
|
||||||
|
@ -241,12 +246,14 @@ ShapeType ModelEntityItem::computeTrueShapeType() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelEntityItem::setModelURL(const QString& url) {
|
void ModelEntityItem::setModelURL(const QString& url) {
|
||||||
if (_modelURL != url) {
|
withWriteLock([&] {
|
||||||
_modelURL = url;
|
if (_modelURL != url) {
|
||||||
if (_shapeType == SHAPE_TYPE_STATIC_MESH) {
|
_modelURL = url;
|
||||||
_dirtyFlags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
if (_shapeType == SHAPE_TYPE_STATIC_MESH) {
|
||||||
|
_dirtyFlags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelEntityItem::setCompoundShapeURL(const QString& url) {
|
void ModelEntityItem::setCompoundShapeURL(const QString& url) {
|
||||||
|
@ -261,7 +268,9 @@ void ModelEntityItem::setCompoundShapeURL(const QString& url) {
|
||||||
|
|
||||||
void ModelEntityItem::setAnimationURL(const QString& url) {
|
void ModelEntityItem::setAnimationURL(const QString& url) {
|
||||||
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
_dirtyFlags |= Simulation::DIRTY_UPDATEABLE;
|
||||||
_animationProperties.setURL(url);
|
withWriteLock([&] {
|
||||||
|
_animationProperties.setURL(url);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelEntityItem::setAnimationSettings(const QString& value) {
|
void ModelEntityItem::setAnimationSettings(const QString& value) {
|
||||||
|
|
|
@ -1923,7 +1923,7 @@ inline bool operator==(const SimpleProgramKey& a, const SimpleProgramKey& b) {
|
||||||
return a.getRaw() == b.getRaw();
|
return a.getRaw() == b.getRaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void buildWebShader(const std::string& vertShaderText, const std::string& fragShaderText, bool blendEnable, bool isAA,
|
static void buildWebShader(const std::string& vertShaderText, const std::string& fragShaderText, bool blendEnable,
|
||||||
gpu::ShaderPointer& shaderPointerOut, gpu::PipelinePointer& pipelinePointerOut) {
|
gpu::ShaderPointer& shaderPointerOut, gpu::PipelinePointer& pipelinePointerOut) {
|
||||||
auto VS = gpu::Shader::createVertex(vertShaderText);
|
auto VS = gpu::Shader::createVertex(vertShaderText);
|
||||||
auto PS = gpu::Shader::createPixel(fragShaderText);
|
auto PS = gpu::Shader::createPixel(fragShaderText);
|
||||||
|
@ -1939,43 +1939,23 @@ static void buildWebShader(const std::string& vertShaderText, const std::string&
|
||||||
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
|
||||||
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
|
||||||
|
|
||||||
if (isAA) {
|
PrepareStencil::testMaskDrawShapeNoAA(*state);
|
||||||
blendEnable ? PrepareStencil::testMask(*state) : PrepareStencil::testMaskDrawShape(*state);
|
|
||||||
} else {
|
|
||||||
PrepareStencil::testMaskDrawShapeNoAA(*state);
|
|
||||||
}
|
|
||||||
|
|
||||||
pipelinePointerOut = gpu::Pipeline::create(shaderPointerOut, state);
|
pipelinePointerOut = gpu::Pipeline::create(shaderPointerOut, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryCache::bindOpaqueWebBrowserProgram(gpu::Batch& batch, bool isAA) {
|
void GeometryCache::bindWebBrowserProgram(gpu::Batch& batch, bool transparent) {
|
||||||
batch.setPipeline(getOpaqueWebBrowserProgram(isAA));
|
batch.setPipeline(getWebBrowserProgram(transparent));
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::PipelinePointer GeometryCache::getOpaqueWebBrowserProgram(bool isAA) {
|
gpu::PipelinePointer GeometryCache::getWebBrowserProgram(bool transparent) {
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [&]() {
|
std::call_once(once, [&]() {
|
||||||
const bool BLEND_ENABLE = false;
|
buildWebShader(simple_vert, simple_opaque_web_browser_frag, false, _simpleOpaqueWebBrowserShader, _simpleOpaqueWebBrowserPipelineNoAA);
|
||||||
buildWebShader(simple_vert, simple_opaque_web_browser_frag, BLEND_ENABLE, true, _simpleOpaqueWebBrowserShader, _simpleOpaqueWebBrowserPipeline);
|
buildWebShader(simple_vert, simple_transparent_web_browser_frag, true, _simpleTransparentWebBrowserShader, _simpleTransparentWebBrowserPipelineNoAA);
|
||||||
buildWebShader(simple_vert, simple_opaque_web_browser_frag, BLEND_ENABLE, false, _simpleOpaqueWebBrowserShader, _simpleOpaqueWebBrowserPipelineNoAA);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return isAA ? _simpleOpaqueWebBrowserPipeline : _simpleOpaqueWebBrowserPipelineNoAA;
|
return transparent ? _simpleTransparentWebBrowserPipelineNoAA : _simpleOpaqueWebBrowserPipelineNoAA;
|
||||||
}
|
|
||||||
|
|
||||||
void GeometryCache::bindTransparentWebBrowserProgram(gpu::Batch& batch, bool isAA) {
|
|
||||||
batch.setPipeline(getTransparentWebBrowserProgram(isAA));
|
|
||||||
}
|
|
||||||
|
|
||||||
gpu::PipelinePointer GeometryCache::getTransparentWebBrowserProgram(bool isAA) {
|
|
||||||
static std::once_flag once;
|
|
||||||
std::call_once(once, [&]() {
|
|
||||||
const bool BLEND_ENABLE = true;
|
|
||||||
buildWebShader(simple_vert, simple_transparent_web_browser_frag, BLEND_ENABLE, true, _simpleTransparentWebBrowserShader, _simpleTransparentWebBrowserPipeline);
|
|
||||||
buildWebShader(simple_vert, simple_transparent_web_browser_frag, BLEND_ENABLE, false, _simpleTransparentWebBrowserShader, _simpleTransparentWebBrowserPipelineNoAA);
|
|
||||||
});
|
|
||||||
|
|
||||||
return isAA ? _simpleTransparentWebBrowserPipeline : _simpleTransparentWebBrowserPipelineNoAA;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryCache::bindSimpleProgram(gpu::Batch& batch, bool textured, bool transparent, bool culled, bool unlit, bool depthBiased) {
|
void GeometryCache::bindSimpleProgram(gpu::Batch& batch, bool textured, bool transparent, bool culled, bool unlit, bool depthBiased) {
|
||||||
|
|
|
@ -166,11 +166,8 @@ public:
|
||||||
static gpu::PipelinePointer getSimplePipeline(bool textured = false, bool transparent = false, bool culled = true,
|
static gpu::PipelinePointer getSimplePipeline(bool textured = false, bool transparent = false, bool culled = true,
|
||||||
bool unlit = false, bool depthBias = false, bool fading = false);
|
bool unlit = false, bool depthBias = false, bool fading = false);
|
||||||
|
|
||||||
void bindOpaqueWebBrowserProgram(gpu::Batch& batch, bool isAA);
|
void bindWebBrowserProgram(gpu::Batch& batch, bool transparent = false);
|
||||||
gpu::PipelinePointer getOpaqueWebBrowserProgram(bool isAA);
|
gpu::PipelinePointer getWebBrowserProgram(bool transparent);
|
||||||
|
|
||||||
void bindTransparentWebBrowserProgram(gpu::Batch& batch, bool isAA);
|
|
||||||
gpu::PipelinePointer getTransparentWebBrowserProgram(bool isAA);
|
|
||||||
|
|
||||||
static void initializeShapePipelines();
|
static void initializeShapePipelines();
|
||||||
|
|
||||||
|
@ -459,10 +456,8 @@ private:
|
||||||
static QHash<SimpleProgramKey, gpu::PipelinePointer> _simplePrograms;
|
static QHash<SimpleProgramKey, gpu::PipelinePointer> _simplePrograms;
|
||||||
|
|
||||||
gpu::ShaderPointer _simpleOpaqueWebBrowserShader;
|
gpu::ShaderPointer _simpleOpaqueWebBrowserShader;
|
||||||
gpu::PipelinePointer _simpleOpaqueWebBrowserPipeline;
|
|
||||||
gpu::PipelinePointer _simpleOpaqueWebBrowserPipelineNoAA;
|
gpu::PipelinePointer _simpleOpaqueWebBrowserPipelineNoAA;
|
||||||
gpu::ShaderPointer _simpleTransparentWebBrowserShader;
|
gpu::ShaderPointer _simpleTransparentWebBrowserShader;
|
||||||
gpu::PipelinePointer _simpleTransparentWebBrowserPipeline;
|
|
||||||
gpu::PipelinePointer _simpleTransparentWebBrowserPipelineNoAA;
|
gpu::PipelinePointer _simpleTransparentWebBrowserPipelineNoAA;
|
||||||
|
|
||||||
static render::ShapePipelinePointer getShapePipeline(bool textured = false, bool transparent = false, bool culled = true,
|
static render::ShapePipelinePointer getShapePipeline(bool textured = false, bool transparent = false, bool culled = true,
|
||||||
|
|
|
@ -167,7 +167,6 @@ WebTablet = function (url, width, dpi, hand, clientOnly, location, visible) {
|
||||||
parentID: this.tabletEntityID,
|
parentID: this.tabletEntityID,
|
||||||
parentJointIndex: -1,
|
parentJointIndex: -1,
|
||||||
showKeyboardFocusHighlight: false,
|
showKeyboardFocusHighlight: false,
|
||||||
isAA: HMD.active,
|
|
||||||
visible: visible
|
visible: visible
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -453,10 +452,6 @@ WebTablet.prototype.onHmdChanged = function () {
|
||||||
this.calculateTabletAttachmentProperties(NO_HANDS, false, tabletProperties);
|
this.calculateTabletAttachmentProperties(NO_HANDS, false, tabletProperties);
|
||||||
// TODO -- is this still needed?
|
// TODO -- is this still needed?
|
||||||
// Entities.editEntity(this.tabletEntityID, tabletProperties);
|
// Entities.editEntity(this.tabletEntityID, tabletProperties);
|
||||||
|
|
||||||
// Full scene FXAA should be disabled on the overlay when the tablet in desktop mode.
|
|
||||||
// This should make the text more readable.
|
|
||||||
Overlays.editOverlay(this.webOverlayID, { isAA: HMD.active });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
WebTablet.prototype.pickle = function () {
|
WebTablet.prototype.pickle = function () {
|
||||||
|
|
|
@ -15,28 +15,56 @@
|
||||||
(function () {
|
(function () {
|
||||||
var APP_NAME = "BLOCKS";
|
var APP_NAME = "BLOCKS";
|
||||||
var APP_URL = "https://vr.google.com/objects/";
|
var APP_URL = "https://vr.google.com/objects/";
|
||||||
|
var APP_OUTDATED_URL = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/updateToBlocks.html";
|
||||||
var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg";
|
var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg";
|
||||||
|
var APP_ICON_ACTIVE = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-a.svg";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
print("Current Interface version: " + Window.checkVersion());
|
print("Current Interface version: " + Window.checkVersion());
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
print("Outdated Interface version does not support Blocks");
|
print("Outdated Interface version does not support Blocks");
|
||||||
APP_URL = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/updateToBlocks.html";
|
APP_URL = APP_OUTDATED_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
icon: APP_ICON,
|
icon: APP_ICON,
|
||||||
|
activeIcon: APP_ICON_ACTIVE,
|
||||||
text: APP_NAME
|
text: APP_NAME
|
||||||
});
|
});
|
||||||
|
|
||||||
function onClicked() {
|
function onClicked() {
|
||||||
tablet.gotoWebScreen(APP_URL, "", true);
|
if (!shown) {
|
||||||
|
tablet.gotoWebScreen(APP_URL, "", true);
|
||||||
|
} else {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
|
|
||||||
|
var shown = false;
|
||||||
|
|
||||||
|
function checkIfBlocks(url) {
|
||||||
|
if (url.indexOf("google") !== -1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onScreenChanged(type, url) {
|
||||||
|
if ((type === 'Web' && checkIfBlocks(url)) || url === APP_OUTDATED_URL) {
|
||||||
|
button.editProperties({ isActive: true });
|
||||||
|
shown = true;
|
||||||
|
} else {
|
||||||
|
button.editProperties({ isActive: false });
|
||||||
|
shown = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tablet.screenChanged.connect(onScreenChanged);
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
||||||
|
|
Loading…
Reference in a new issue