diff --git a/src/elements/a-gltf-entity.js b/src/elements/a-gltf-entity.js index 1335770ac9994794e32d257702c192802645ad1a..3903447c23354a6c23007fb837552c69b0220529 100644 --- a/src/elements/a-gltf-entity.js +++ b/src/elements/a-gltf-entity.js @@ -1,6 +1,7 @@ const GLTFCache = {}; AFRAME.AGLTFEntity = { + quality: "low", defaultInflator(el, componentName, componentData) { if (AFRAME.components[componentName].multiple && Array.isArray(componentData)) { for (let i = 0; i < componentData.length; i++) { @@ -159,9 +160,9 @@ AFRAME.registerElement("a-gltf-entity", { const highSrc = assetEl.getAttribute("high-src"); const lowSrc = assetEl.getAttribute("low-src"); - if (highSrc && AFRAME.quality === "high") { + if (highSrc && AFRAME.AGLTFEntity.quality === "high") { src = highSrc; - } else if (lowSrc && AFRAME.quality === "low") { + } else if (lowSrc && AFRAME.AGLTFEntity.quality === "low") { src = lowSrc; } else { src = fallbackSrc; diff --git a/src/elements/a-progressive-asset.js b/src/elements/a-progressive-asset.js index d34cd0022273da0e3a81e23dfb178a8b6b00c234..e6deeea752c62ae797934592ce26b94492182f86 100644 --- a/src/elements/a-progressive-asset.js +++ b/src/elements/a-progressive-asset.js @@ -22,9 +22,9 @@ AFRAME.registerElement("a-progressive-asset", { let src = fallbackSrc; - if (AFRAME.quality === "high") { + if (AFRAME.AGLTFEntity.quality === "high") { src = highSrc; - } else if (AFRAME.quality === "low") { + } else if (AFRAME.AGLTFEntity.quality === "low") { src = lowSrc; } diff --git a/src/room.js b/src/room.js index 4c595b350a3e49a9cfe9b9226293fba29b1ec4b9..eebb4ad0978a1a15bf5cb2548d171b9ae46a170f 100644 --- a/src/room.js +++ b/src/room.js @@ -47,9 +47,9 @@ const qs = queryString.parse(location.search); const isMobile = AFRAME.utils.device.isMobile(); if (qs.quality) { - AFRAME.quality = qs.quality; + AFRAME.AGLTFEntity.quality = qs.quality; } else { - AFRAME.quality = isMobile ? "low" : "high"; + AFRAME.AGLTFEntity.quality = isMobile ? "low" : "high"; } import "./elements/a-progressive-asset";