From 3b794bc66d8a1e64bcb556a428427a340ade7249 Mon Sep 17 00:00:00 2001 From: kalwalt Date: Tue, 12 Oct 2021 12:18:59 +0200 Subject: [PATCH 01/11] raw code --- dist/ARnftThreejs.js | 4781 +++++++++++++++++++++- src/filters/ARnftFilter.ts | 126 + src/filters/DelayableSignalFilter.ts | 40 + src/filters/OneEuroFilter.ts | 194 + src/utils/Utils.ts | 3 + types/filters/ARnftFilter.d.ts | 18 + types/filters/DelayableSignalFilter.d.ts | 8 + types/filters/OneEuroFilter.d.ts | 42 + types/utils/Utils.d.ts | 1 + 9 files changed, 5211 insertions(+), 2 deletions(-) create mode 100644 src/filters/ARnftFilter.ts create mode 100644 src/filters/DelayableSignalFilter.ts create mode 100644 src/filters/OneEuroFilter.ts create mode 100644 types/filters/ARnftFilter.d.ts create mode 100644 types/filters/DelayableSignalFilter.d.ts create mode 100644 types/filters/OneEuroFilter.d.ts diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index 7a0e1af..dd43957 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -1,2 +1,4779 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):"object"==typeof exports?exports.ARnftThreejs=t(require("three")):e.ARnftThreejs=t(e.THREE)}(this,(function(e){return(()=>{"use strict";var t={381:t=>{t.exports=e}},s={};function n(e){var r=s[e];if(void 0!==r)return r.exports;var i=s[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var s=0;sY});var i=n(381),a=function(){function t(){e(this,t)}return s(t,null,[{key:"interpolate",value:function(e){for(var t=0;t<16;t++)this.trackedMatrix.delta[t]=e[t]-this.trackedMatrix.interpolated[t],this.trackedMatrix.interpolated[t]=this.trackedMatrix.interpolated[t]+this.trackedMatrix.delta[t]/24;return this.trackedMatrix.interpolated}},{key:"isMobile",value:function(){return/Android|mobile|iPad|iPhone/i.test(navigator.userAgent)}},{key:"setMatrix",value:function(e,t){var s=[];for(var n in t)s[n]=t[n];"function"==typeof e.elements.set?e.elements.set(s):e.elements=[].slice.call(s)}}]),t}();a.trackedMatrix={delta:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],interpolated:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};var o=function(){function t(s,r,a,o){e(this,t),this.configData=s,this.uuid=a,this.target=window||n.g,this.renderer=new i.WebGLRenderer({canvas:r,context:s.renderer.context,alpha:s.renderer.alpha,premultipliedAlpha:s.renderer.premultipliedAlpha,antialias:s.renderer.antialias,stencil:s.renderer.stencil,precision:s.renderer.precision,depth:s.renderer.depth,logarithmicDepthBuffer:s.renderer.logarithmicDepthBuffer}),this.renderer.setPixelRatio(window.devicePixelRatio),this.scene=new i.Scene,t.globalScene=this.scene,this.camera=!0===o?new i.PerspectiveCamera(s.camera.fov,s.camera.ratio,s.camera.near,s.camera.far):new i.Camera,this.version="0.3.0",console.log("ARnftThreejs version: ",this.version)}return s(t,[{key:"initRenderer",value:function(){var e=this;this.camera.matrixAutoUpdate=!1,this.target.addEventListener("getProjectionMatrix",(function(t){a.setMatrix(e.camera.projectionMatrix,t.detail.proj)})),this.scene.add(this.camera);var t=new i.AmbientLight(16777215);this.scene.add(t),this.target.addEventListener("getWindowSize",(function(t){e.renderer.setSize(t.detail.sw,t.detail.sh)}));var s=new CustomEvent("onInitThreejsRendering",{detail:{renderer:this.renderer,scene:this.scene,camera:this.camera}});this.target.dispatchEvent(s)}},{key:"draw",value:function(){this.renderer.render(this.scene,this.camera)}},{key:"getRenderer",value:function(){return this.renderer}},{key:"getScene",value:function(){return this.scene}},{key:"getCamera",value:function(){return this.camera}},{key:"setRenderer",value:function(e){this.renderer=e}},{key:"setScene",value:function(e){this.scene=e}},{key:"setCamera",value:function(e){this.camera=e}}],[{key:"getGlobalScene",value:function(){return t.globalScene}}]),t}();class l extends i.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new p(e)})),this.register((function(e){return new v(e)})),this.register((function(e){return new T(e)})),this.register((function(e){return new m(e)})),this.register((function(e){return new f(e)})),this.register((function(e){return new g(e)})),this.register((function(e){return new x(e)})),this.register((function(e){return new h(e)})),this.register((function(e){return new M(e)}))}load(e,t,s,n){const r=this;let a;a=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:i.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);const o=function(t){n?n(t):console.error(t),r.manager.itemError(e),r.manager.itemEnd(e)},l=new i.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,(function(s){try{r.parse(s,a,(function(s){t(s),r.manager.itemEnd(e)}),o)}catch(e){o(e)}}),s,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){let r;const a={},o={};if("string"==typeof e)r=e;else if(i.LoaderUtils.decodeText(new Uint8Array(e,0,4))===R){try{a[u.KHR_BINARY_GLTF]=new y(e)}catch(e){return void(n&&n(e))}r=a[u.KHR_BINARY_GLTF].content}else r=i.LoaderUtils.decodeText(new Uint8Array(e));const l=JSON.parse(r);if(void 0===l.asset||l.asset.version[0]<2)return void(n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const c=new X(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}c.setExtensions(a),c.setPlugins(o),c.parse(s,n)}}function c(){let e={};return{get:function(t){return e[t]},add:function(t,s){e[t]=s},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const u={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class h{constructor(e){this.parser=e,this.name=u.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i,a)}}class T{constructor(e){this.parser=e,this.name=u.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,r=n.textures[e];if(!r.extensions||!r.extensions[t])return null;const i=r.extensions[t],a=n.images[i.source];let o=s.textureLoader;if(a.uri){const e=s.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(r){if(r)return s.loadTextureImage(e,a,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class M{constructor(e){this.name=u.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const e=s.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([n,r.ready]).then((function(t){const s=e.byteOffset||0,n=e.byteLength||0,i=e.count,a=e.byteStride,o=new ArrayBuffer(i*a),l=new Uint8Array(t[0],s,n);return r.decodeGltfBuffer(new Uint8Array(o),i,a,l,e.mode,e.filter),o}))}return null}}const R="glTF";class y{constructor(e){this.name=u.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:i.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==R)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-12,n=new DataView(e,12);let r=0;for(;r",t).replace("#include ",s).replace("#include ",n).replace("#include ",r).replace("#include ",a)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class A{constructor(){this.name=u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return L}extendParams(e,t,s){const n=t.extensions[this.name];e.color=new i.Color(1,1,1),e.opacity=1;const r=[];if(Array.isArray(n.diffuseFactor)){const t=n.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==n.diffuseTexture&&r.push(s.assignTexture(e,"map",n.diffuseTexture)),e.emissive=new i.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new i.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){const t=n.specularGlossinessTexture;r.push(s.assignTexture(e,"glossinessMap",t)),r.push(s.assignTexture(e,"specularMap",t))}return Promise.all(r)}createMaterial(e){const t=new L(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=i.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class E{constructor(){this.name=u.KHR_MESH_QUANTIZATION}}class _ extends i.Interpolant{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,r=e*n*3+n;for(let e=0;e!==n;e++)t[e]=s[r+e];return t}}_.prototype.beforeStart_=_.prototype.copySampleValue_,_.prototype.afterEnd_=_.prototype.copySampleValue_,_.prototype.interpolate_=function(e,t,s,n){const r=this.resultBuffer,i=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,c=n-t,u=(s-t)/c,h=u*u,d=h*u,p=e*l,m=p-l,f=-2*d+3*h,g=d-h,x=1-f,v=g-h+u;for(let e=0;e!==a;e++){const t=i[m+e+a],s=i[m+e+o]*c,n=i[p+e+a],l=i[p+e]*c;r[e]=x*t+v*s+f*n+g*l}return r};const b=new i.Quaternion;class P extends _{interpolate_(e,t,s,n){const r=super.interpolate_(e,t,s,n);return b.fromArray(r).normalize().toArray(r),r}}const I={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},C={9728:i.NearestFilter,9729:i.LinearFilter,9984:i.NearestMipmapNearestFilter,9985:i.LinearMipmapNearestFilter,9986:i.NearestMipmapLinearFilter,9987:i.LinearMipmapLinearFilter},O={33071:i.ClampToEdgeWrapping,33648:i.MirroredRepeatWrapping,10497:i.RepeatWrapping},N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},H={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},F={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},k={CUBICSPLINE:void 0,LINEAR:i.InterpolateLinear,STEP:i.InterpolateDiscrete};function U(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function D(e,t,s){for(const n in s.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=s.extensions[n])}function G(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function j(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let s=0,n=t.weights.length;s{const s=this.associations.get(e);null!=s&&this.associations.set(t,s);for(const[s,n]of e.children.entries())r(n,t.children[s])};return r(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&m.setY(t,h[e*a+1]),a>=3&&m.setZ(t,h[e*a+2]),a>=4&&m.setW(t,h[e*a+3]),a>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m}))}loadTexture(e){const t=this.json,s=this.options,n=t.textures[e],r=t.images[n.source];let i=this.textureLoader;if(r.uri){const e=s.manager.getHandler(r.uri);null!==e&&(i=e)}return this.loadTextureImage(e,r,i)}loadTextureImage(e,t,s){const n=this,r=this.json,a=this.options,o=r.textures[e],l=(t.uri||t.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=self.URL||self.webkitURL;let u=t.uri||"",h=!1;if(void 0!==t.bufferView)u=n.getDependency("bufferView",t.bufferView).then((function(e){h=!0;const s=new Blob([e],{type:t.mimeType});return u=c.createObjectURL(s),u}));else if(void 0===t.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(u).then((function(e){return new Promise((function(t,n){let r=t;!0===s.isImageBitmapLoader&&(r=function(e){const s=new i.Texture(e);s.needsUpdate=!0,t(s)}),s.load(U(e,a.path),r,void 0,n)}))})).then((function(t){!0===h&&c.revokeObjectURL(u),t.flipY=!1,o.name&&(t.name=o.name);const s=(r.samplers||{})[o.sampler]||{};return t.magFilter=C[s.magFilter]||i.LinearFilter,t.minFilter=C[s.minFilter]||i.LinearMipmapLinearFilter,t.wrapS=O[s.wrapS]||i.RepeatWrapping,t.wrapT=O[s.wrapT]||i.RepeatWrapping,n.associations.set(t,{textures:e}),t})).catch((function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null}));return this.textureCache[l]=d,d}assignTexture(e,t,s){const n=this;return this.getDependency("texture",s.index).then((function(r){if(void 0===s.texCoord||0==s.texCoord||"aoMap"===t&&1==s.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+s.texCoord+" for texture "+t+" not yet supported."),n.extensions[u.KHR_TEXTURE_TRANSFORM]){const e=void 0!==s.extensions?s.extensions[u.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=n.associations.get(r);r=n.extensions[u.KHR_TEXTURE_TRANSFORM].extendTexture(r,e),n.associations.set(r,t)}}return e[t]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const n=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new i.PointsMaterial,i.Material.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,t.sizeAttenuation=!1,this.cache.add(e,t)),s=t}else if(e.isLine){const e="LineBasicMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new i.LineBasicMaterial,i.Material.prototype.copy.call(t,s),t.color.copy(s.color),this.cache.add(e,t)),s=t}if(n||r||a){let e="ClonedMaterial:"+s.uuid+":";s.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),n&&(e+="derivative-tangents:"),r&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=s.clone(),r&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(s))),s=t}s.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=s}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(e){const t=this,s=this.json,n=this.extensions,r=s.materials[e];let a;const o={},l=r.extensions||{},c=[];if(l[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=n[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];a=e.getMaterialType(),c.push(e.extendParams(o,r,t))}else if(l[u.KHR_MATERIALS_UNLIT]){const e=n[u.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,r,t))}else{const s=r.pbrMetallicRoughness||{};if(o.color=new i.Color(1,1,1),o.opacity=1,Array.isArray(s.baseColorFactor)){const e=s.baseColorFactor;o.color.fromArray(e),o.opacity=e[3]}void 0!==s.baseColorTexture&&c.push(t.assignTexture(o,"map",s.baseColorTexture)),o.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,o.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(c.push(t.assignTexture(o,"metalnessMap",s.metallicRoughnessTexture)),c.push(t.assignTexture(o,"roughnessMap",s.metallicRoughnessTexture))),a=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===r.doubleSided&&(o.side=i.DoubleSide);const h=r.alphaMode||"OPAQUE";if("BLEND"===h?(o.transparent=!0,o.depthWrite=!1):(o.format=i.RGBFormat,o.transparent=!1,"MASK"===h&&(o.alphaTest=void 0!==r.alphaCutoff?r.alphaCutoff:.5)),void 0!==r.normalTexture&&a!==i.MeshBasicMaterial&&(c.push(t.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new i.Vector2(1,1),void 0!==r.normalTexture.scale)){const e=r.normalTexture.scale;o.normalScale.set(e,e)}return void 0!==r.occlusionTexture&&a!==i.MeshBasicMaterial&&(c.push(t.assignTexture(o,"aoMap",r.occlusionTexture)),void 0!==r.occlusionTexture.strength&&(o.aoMapIntensity=r.occlusionTexture.strength)),void 0!==r.emissiveFactor&&a!==i.MeshBasicMaterial&&(o.emissive=(new i.Color).fromArray(r.emissiveFactor)),void 0!==r.emissiveTexture&&a!==i.MeshBasicMaterial&&c.push(t.assignTexture(o,"emissiveMap",r.emissiveTexture)),Promise.all(c).then((function(){let s;return s=a===L?n[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new a(o),r.name&&(s.name=r.name),s.map&&(s.map.encoding=i.sRGBEncoding),s.emissiveMap&&(s.emissiveMap.encoding=i.sRGBEncoding),G(s,r),t.associations.set(s,{materials:e}),r.extensions&&D(n,s,r),s}))}createUniqueName(e){const t=i.PropertyBinding.sanitizeNodeName(e||"");let s=t;for(let e=1;this.nodeNamesUsed[s];++e)s=t+"_"+e;return this.nodeNamesUsed[s]=!0,s}loadGeometries(e){const t=this,s=this.extensions,n=this.primitiveCache;function r(e){return s[u.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(s){return z(s,e,t)}))}const a=[];for(let s=0,o=e.length;s0&&j(d,r),d.name=t.createUniqueName(r.name||"mesh_"+e),G(d,r),h.extensions&&D(n,d,h),t.assignFinalMaterial(d),c.push(d)}for(let s=0,n=c.length;s1?new i.Group:1===t.length?t[0]:new i.Object3D,o!==t[0])for(let e=0,s=t.length;e{const t=new Map;for(const[e,s]of r.associations)(e instanceof i.Material||e instanceof i.Texture)&&t.set(e,s);return e.traverse((e=>{const s=r.associations.get(e);null!=s&&t.set(e,s)})),t})(a),a}))}}function q(e,t,s,n){const r=s.nodes[e];return n.getDependency("node",e).then((function(e){if(void 0===r.skin)return e;let t;return n.getDependency("skin",r.skin).then((function(e){t=e;const s=[];for(let e=0,r=t.joints.length;e { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./src/SceneRendererTJS.ts": +/*!*********************************!*\ + !*** ./src/SceneRendererTJS.ts ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ SceneRendererTJS) +/* harmony export */ }); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); +/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three */ "three"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/Utils */ "./src/utils/Utils.ts"); + + + + + +var SceneRendererTJS = /*#__PURE__*/function () { + function SceneRendererTJS(configData, canvasDraw, uuid, cameraBool) { + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, SceneRendererTJS); + + this.configData = configData; + this.uuid = uuid; + this.target = window || __webpack_require__.g; + this.renderer = new three__WEBPACK_IMPORTED_MODULE_2__.WebGLRenderer({ + canvas: canvasDraw, + context: configData.renderer.context, + alpha: configData.renderer.alpha, + premultipliedAlpha: configData.renderer.premultipliedAlpha, + antialias: configData.renderer.antialias, + stencil: configData.renderer.stencil, + precision: configData.renderer.precision, + depth: configData.renderer.depth, + logarithmicDepthBuffer: configData.renderer.logarithmicDepthBuffer + }); + this.renderer.setPixelRatio(window.devicePixelRatio); + this.scene = new three__WEBPACK_IMPORTED_MODULE_2__.Scene(); + SceneRendererTJS.globalScene = this.scene; + + if (cameraBool === true) { + this.camera = new three__WEBPACK_IMPORTED_MODULE_2__.PerspectiveCamera(configData.camera.fov, configData.camera.ratio, configData.camera.near, configData.camera.far); + } else { + this.camera = new three__WEBPACK_IMPORTED_MODULE_2__.Camera(); + } + + this.version = "0.3.0"; + console.log("ARnftThreejs version: ", this.version); + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(SceneRendererTJS, [{ + key: "initRenderer", + value: function initRenderer() { + var _this = this; + + this.camera.matrixAutoUpdate = false; + this.target.addEventListener("getProjectionMatrix", function (ev) { + _utils_Utils__WEBPACK_IMPORTED_MODULE_3__.Utils.setMatrix(_this.camera.projectionMatrix, ev.detail.proj); + }); + this.scene.add(this.camera); + var light = new three__WEBPACK_IMPORTED_MODULE_2__.AmbientLight(0xffffff); + this.scene.add(light); + this.target.addEventListener("getWindowSize", function (_ev) { + _this.renderer.setSize(_ev.detail.sw, _ev.detail.sh); + }); + var setInitRendererEvent = new CustomEvent("onInitThreejsRendering", { + detail: { + renderer: this.renderer, + scene: this.scene, + camera: this.camera + } + }); + this.target.dispatchEvent(setInitRendererEvent); + } + }, { + key: "draw", + value: function draw() { + this.renderer.render(this.scene, this.camera); + } + }, { + key: "getRenderer", + value: function getRenderer() { + return this.renderer; + } + }, { + key: "getScene", + value: function getScene() { + return this.scene; + } + }, { + key: "getCamera", + value: function getCamera() { + return this.camera; + } + }, { + key: "setRenderer", + value: function setRenderer(renderer) { + this.renderer = renderer; + } + }, { + key: "setScene", + value: function setScene(scene) { + this.scene = scene; + } + }, { + key: "setCamera", + value: function setCamera(camera) { + this.camera = camera; + } + }], [{ + key: "getGlobalScene", + value: function getGlobalScene() { + return SceneRendererTJS.globalScene; + } + }]); + + return SceneRendererTJS; +}(); + + + +/***/ }), + +/***/ "./src/markermedia/NFTaddTJS.ts": +/*!**************************************!*\ + !*** ./src/markermedia/NFTaddTJS.ts ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ NFTaddTJS) +/* harmony export */ }); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); +/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three */ "three"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader */ "./node_modules/three/examples/jsm/loaders/GLTFLoader.js"); +/* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/Utils */ "./src/utils/Utils.ts"); +/* harmony import */ var _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../SceneRendererTJS */ "./src/SceneRendererTJS.ts"); + + + + + + + +var NFTaddTJS = /*#__PURE__*/function () { + function NFTaddTJS(uuid) { + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, NFTaddTJS); + + this.entities = []; + this.scene = _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_5__["default"].getGlobalScene(); + this.target = window || __webpack_require__.g; + this.uuid = uuid; + this.names = []; + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(NFTaddTJS, [{ + key: "add", + value: function add(mesh, name, objVisibility) { + this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { + var msg = ev.detail; + mesh.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; + mesh.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; + }); + var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); + root.name = "root-" + name; + root.matrixAutoUpdate = false; + this.scene.add(root); + root.add(mesh); + this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { + root.visible = true; + mesh.visible = true; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + }); + this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { + root.visible = objVisibility; + mesh.visible = objVisibility; + }); + this.names.push(name); + this.entities.push({ + name: name, + mesh: mesh + }); + } + }, { + key: "addModel", + value: function addModel(url, name, x, y, z, scale, objVisibility) { + var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); + root.name = "root-" + name; + root.matrixAutoUpdate = false; + this.scene.add(root); + var model; + var threeGLTFLoader = new three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__.GLTFLoader(); + threeGLTFLoader.load(url, function (gltf) { + model = gltf.scene; + model.scale.set(scale, scale, scale); + model.rotation.x = Math.PI / 2; + model.position.x = x; + model.position.y = y; + model.position.z = z; + root.add(model); + }); + this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { + root.visible = true; + model.visible = true; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + }); + this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { + root.visible = objVisibility; + model.visible = objVisibility; + }); + this.names.push(name); + } + }, { + key: "addImage", + value: function addImage(imageUrl, name, color, scale, objVisibility) { + var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); + root.name = "root-" + name; + root.matrixAutoUpdate = false; + this.scene.add(root); + var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(1, 1, 1, 1); + var texture = new three__WEBPACK_IMPORTED_MODULE_2__.TextureLoader().load(imageUrl); + var material = new three__WEBPACK_IMPORTED_MODULE_2__.MeshStandardMaterial({ + color: color, + map: texture + }); + var plane = new three__WEBPACK_IMPORTED_MODULE_2__.Mesh(planeGeom, material); + plane.scale.set(scale, scale, scale); + this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { + var msg = ev.detail; + plane.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; + plane.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; + }); + root.add(plane); + this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { + root.visible = true; + plane.visible = true; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + }); + this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { + root.visible = objVisibility; + plane.visible = objVisibility; + }); + this.names.push(name); + } + }, { + key: "addVideo", + value: function addVideo(id, name, scale, objVisibility) { + var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); + root.name = "root-" + name; + root.matrixAutoUpdate = false; + this.scene.add(root); + var ARVideo = document.getElementById(id); + var texture = new three__WEBPACK_IMPORTED_MODULE_2__.VideoTexture(ARVideo); + var mat = new three__WEBPACK_IMPORTED_MODULE_2__.MeshStandardMaterial({ + color: 0xbbbbff, + map: texture + }); + ARVideo.play(); + var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(1, 1, 1, 1); + var plane = new three__WEBPACK_IMPORTED_MODULE_2__.Mesh(planeGeom, mat); + plane.scale.set(scale, scale, scale); + this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { + var msg = ev.detail; + plane.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; + plane.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; + }); + root.add(plane); + this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { + root.visible = true; + plane.visible = true; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + }); + this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { + root.visible = objVisibility; + plane.visible = objVisibility; + }); + this.names.push(name); + } + }, { + key: "getNames", + value: function getNames() { + return this.names; + } + }]); + + return NFTaddTJS; +}(); + + + +/***/ }), + +/***/ "./src/utils/Utils.ts": +/*!****************************!*\ + !*** ./src/utils/Utils.ts ***! + \****************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getTime": () => (/* binding */ getTime), +/* harmony export */ "Utils": () => (/* binding */ Utils) +/* harmony export */ }); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); +/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); + + +function getTime() { + return Math.floor(Date.now() / 1000); +} +var Utils = /*#__PURE__*/function () { + function Utils() { + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Utils); + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Utils, null, [{ + key: "interpolate", + value: function interpolate(world) { + var interpolationFactor = 24; + + for (var i = 0; i < 16; i++) { + this.trackedMatrix.delta[i] = world[i] - this.trackedMatrix.interpolated[i]; + this.trackedMatrix.interpolated[i] = this.trackedMatrix.interpolated[i] + this.trackedMatrix.delta[i] / interpolationFactor; + } + + return this.trackedMatrix.interpolated; + } + }, { + key: "isMobile", + value: function isMobile() { + return /Android|mobile|iPad|iPhone/i.test(navigator.userAgent); + } + }, { + key: "setMatrix", + value: function setMatrix(matrix, value) { + var array = []; + + for (var key in value) { + array[key] = value[key]; + } + + if (typeof matrix.elements.set === "function") { + matrix.elements.set(array); + } else { + matrix.elements = [].slice.call(array); + } + } + }]); + + return Utils; +}(); +Utils.trackedMatrix = { + delta: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + interpolated: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +}; + +/***/ }), + +/***/ "three": +/*!**************************************************************************************!*\ + !*** external {"commonjs":"three","commonjs2":"three","amd":"three","root":"THREE"} ***! + \**************************************************************************************/ +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_MODULE_three__; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ _classCallCheck) +/* harmony export */ }); +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js": +/*!****************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***! + \****************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ _createClass) +/* harmony export */ }); +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +/***/ }), + +/***/ "./node_modules/three/examples/jsm/loaders/GLTFLoader.js": +/*!***************************************************************!*\ + !*** ./node_modules/three/examples/jsm/loaders/GLTFLoader.js ***! + \***************************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "GLTFLoader": () => (/* binding */ GLTFLoader) +/* harmony export */ }); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ "three"); + + +class GLTFLoader extends three__WEBPACK_IMPORTED_MODULE_0__.Loader { + + constructor( manager ) { + + super( manager ); + + this.dracoLoader = null; + this.ktx2Loader = null; + this.meshoptDecoder = null; + + this.pluginCallbacks = []; + + this.register( function ( parser ) { + + return new GLTFMaterialsClearcoatExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFTextureBasisUExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFTextureWebPExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFMaterialsTransmissionExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFMaterialsVolumeExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFMaterialsIorExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFMaterialsSpecularExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFLightsExtension( parser ); + + } ); + + this.register( function ( parser ) { + + return new GLTFMeshoptCompression( parser ); + + } ); + + } + + load( url, onLoad, onProgress, onError ) { + + const scope = this; + + let resourcePath; + + if ( this.resourcePath !== '' ) { + + resourcePath = this.resourcePath; + + } else if ( this.path !== '' ) { + + resourcePath = this.path; + + } else { + + resourcePath = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.extractUrlBase( url ); + + } + + // Tells the LoadingManager to track an extra item, which resolves after + // the model is fully loaded. This means the count of items loaded will + // be incorrect, but ensures manager.onLoad() does not fire early. + this.manager.itemStart( url ); + + const _onError = function ( e ) { + + if ( onError ) { + + onError( e ); + + } else { + + console.error( e ); + + } + + scope.manager.itemError( url ); + scope.manager.itemEnd( url ); + + }; + + const loader = new three__WEBPACK_IMPORTED_MODULE_0__.FileLoader( this.manager ); + + loader.setPath( this.path ); + loader.setResponseType( 'arraybuffer' ); + loader.setRequestHeader( this.requestHeader ); + loader.setWithCredentials( this.withCredentials ); + + loader.load( url, function ( data ) { + + try { + + scope.parse( data, resourcePath, function ( gltf ) { + + onLoad( gltf ); + + scope.manager.itemEnd( url ); + + }, _onError ); + + } catch ( e ) { + + _onError( e ); + + } + + }, onProgress, _onError ); + + } + + setDRACOLoader( dracoLoader ) { + + this.dracoLoader = dracoLoader; + return this; + + } + + setDDSLoader() { + + throw new Error( + + 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' + + ); + + } + + setKTX2Loader( ktx2Loader ) { + + this.ktx2Loader = ktx2Loader; + return this; + + } + + setMeshoptDecoder( meshoptDecoder ) { + + this.meshoptDecoder = meshoptDecoder; + return this; + + } + + register( callback ) { + + if ( this.pluginCallbacks.indexOf( callback ) === - 1 ) { + + this.pluginCallbacks.push( callback ); + + } + + return this; + + } + + unregister( callback ) { + + if ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) { + + this.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 ); + + } + + return this; + + } + + parse( data, path, onLoad, onError ) { + + let content; + const extensions = {}; + const plugins = {}; + + if ( typeof data === 'string' ) { + + content = data; + + } else { + + const magic = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) ); + + if ( magic === BINARY_EXTENSION_HEADER_MAGIC ) { + + try { + + extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data ); + + } catch ( error ) { + + if ( onError ) onError( error ); + return; + + } + + content = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content; + + } else { + + content = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( new Uint8Array( data ) ); + + } + + } + + const json = JSON.parse( content ); + + if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) { + + if ( onError ) onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) ); + return; + + } + + const parser = new GLTFParser( json, { + + path: path || this.resourcePath || '', + crossOrigin: this.crossOrigin, + requestHeader: this.requestHeader, + manager: this.manager, + ktx2Loader: this.ktx2Loader, + meshoptDecoder: this.meshoptDecoder + + } ); + + parser.fileLoader.setRequestHeader( this.requestHeader ); + + for ( let i = 0; i < this.pluginCallbacks.length; i ++ ) { + + const plugin = this.pluginCallbacks[ i ]( parser ); + plugins[ plugin.name ] = plugin; + + // Workaround to avoid determining as unknown extension + // in addUnknownExtensionsToUserData(). + // Remove this workaround if we move all the existing + // extension handlers to plugin system + extensions[ plugin.name ] = true; + + } + + if ( json.extensionsUsed ) { + + for ( let i = 0; i < json.extensionsUsed.length; ++ i ) { + + const extensionName = json.extensionsUsed[ i ]; + const extensionsRequired = json.extensionsRequired || []; + + switch ( extensionName ) { + + case EXTENSIONS.KHR_MATERIALS_UNLIT: + extensions[ extensionName ] = new GLTFMaterialsUnlitExtension(); + break; + + case EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: + extensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension(); + break; + + case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION: + extensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader ); + break; + + case EXTENSIONS.KHR_TEXTURE_TRANSFORM: + extensions[ extensionName ] = new GLTFTextureTransformExtension(); + break; + + case EXTENSIONS.KHR_MESH_QUANTIZATION: + extensions[ extensionName ] = new GLTFMeshQuantizationExtension(); + break; + + default: + + if ( extensionsRequired.indexOf( extensionName ) >= 0 && plugins[ extensionName ] === undefined ) { + + console.warn( 'THREE.GLTFLoader: Unknown extension "' + extensionName + '".' ); + + } + + } + + } + + } + + parser.setExtensions( extensions ); + parser.setPlugins( plugins ); + parser.parse( onLoad, onError ); + + } + +} + +/* GLTFREGISTRY */ + +function GLTFRegistry() { + + let objects = {}; + + return { + + get: function ( key ) { + + return objects[ key ]; + + }, + + add: function ( key, object ) { + + objects[ key ] = object; + + }, + + remove: function ( key ) { + + delete objects[ key ]; + + }, + + removeAll: function () { + + objects = {}; + + } + + }; + +} + +/*********************************/ +/********** EXTENSIONS ***********/ +/*********************************/ + +const EXTENSIONS = { + KHR_BINARY_GLTF: 'KHR_binary_glTF', + KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression', + KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual', + KHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat', + KHR_MATERIALS_IOR: 'KHR_materials_ior', + KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness', + KHR_MATERIALS_SPECULAR: 'KHR_materials_specular', + KHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission', + KHR_MATERIALS_UNLIT: 'KHR_materials_unlit', + KHR_MATERIALS_VOLUME: 'KHR_materials_volume', + KHR_TEXTURE_BASISU: 'KHR_texture_basisu', + KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', + KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization', + EXT_TEXTURE_WEBP: 'EXT_texture_webp', + EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression' +}; + +/** + * Punctual Lights Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual + */ +class GLTFLightsExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL; + + // Object3D instance caches + this.cache = { refs: {}, uses: {} }; + + } + + _markDefs() { + + const parser = this.parser; + const nodeDefs = this.parser.json.nodes || []; + + for ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) { + + const nodeDef = nodeDefs[ nodeIndex ]; + + if ( nodeDef.extensions + && nodeDef.extensions[ this.name ] + && nodeDef.extensions[ this.name ].light !== undefined ) { + + parser._addNodeRef( this.cache, nodeDef.extensions[ this.name ].light ); + + } + + } + + } + + _loadLight( lightIndex ) { + + const parser = this.parser; + const cacheKey = 'light:' + lightIndex; + let dependency = parser.cache.get( cacheKey ); + + if ( dependency ) return dependency; + + const json = parser.json; + const extensions = ( json.extensions && json.extensions[ this.name ] ) || {}; + const lightDefs = extensions.lights || []; + const lightDef = lightDefs[ lightIndex ]; + let lightNode; + + const color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 0xffffff ); + + if ( lightDef.color !== undefined ) color.fromArray( lightDef.color ); + + const range = lightDef.range !== undefined ? lightDef.range : 0; + + switch ( lightDef.type ) { + + case 'directional': + lightNode = new three__WEBPACK_IMPORTED_MODULE_0__.DirectionalLight( color ); + lightNode.target.position.set( 0, 0, - 1 ); + lightNode.add( lightNode.target ); + break; + + case 'point': + lightNode = new three__WEBPACK_IMPORTED_MODULE_0__.PointLight( color ); + lightNode.distance = range; + break; + + case 'spot': + lightNode = new three__WEBPACK_IMPORTED_MODULE_0__.SpotLight( color ); + lightNode.distance = range; + // Handle spotlight properties. + lightDef.spot = lightDef.spot || {}; + lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0; + lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0; + lightNode.angle = lightDef.spot.outerConeAngle; + lightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle; + lightNode.target.position.set( 0, 0, - 1 ); + lightNode.add( lightNode.target ); + break; + + default: + throw new Error( 'THREE.GLTFLoader: Unexpected light type: ' + lightDef.type ); + + } + + // Some lights (e.g. spot) default to a position other than the origin. Reset the position + // here, because node-level parsing will only override position if explicitly specified. + lightNode.position.set( 0, 0, 0 ); + + lightNode.decay = 2; + + if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity; + + lightNode.name = parser.createUniqueName( lightDef.name || ( 'light_' + lightIndex ) ); + + dependency = Promise.resolve( lightNode ); + + parser.cache.add( cacheKey, dependency ); + + return dependency; + + } + + createNodeAttachment( nodeIndex ) { + + const self = this; + const parser = this.parser; + const json = parser.json; + const nodeDef = json.nodes[ nodeIndex ]; + const lightDef = ( nodeDef.extensions && nodeDef.extensions[ this.name ] ) || {}; + const lightIndex = lightDef.light; + + if ( lightIndex === undefined ) return null; + + return this._loadLight( lightIndex ).then( function ( light ) { + + return parser._getNodeRef( self.cache, lightIndex, light ); + + } ); + + } + +} + +/** + * Unlit Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit + */ +class GLTFMaterialsUnlitExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_MATERIALS_UNLIT; + + } + + getMaterialType() { + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial; + + } + + extendParams( materialParams, materialDef, parser ) { + + const pending = []; + + materialParams.color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + + const metallicRoughness = materialDef.pbrMetallicRoughness; + + if ( metallicRoughness ) { + + if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { + + const array = metallicRoughness.baseColorFactor; + + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( metallicRoughness.baseColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) ); + + } + + } + + return Promise.all( pending ); + + } + +} + +/** + * Clearcoat Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat + */ +class GLTFMaterialsClearcoatExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_CLEARCOAT; + + } + + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; + + } + + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + + const extension = materialDef.extensions[ this.name ]; + + if ( extension.clearcoatFactor !== undefined ) { + + materialParams.clearcoat = extension.clearcoatFactor; + + } + + if ( extension.clearcoatTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) ); + + } + + if ( extension.clearcoatRoughnessFactor !== undefined ) { + + materialParams.clearcoatRoughness = extension.clearcoatRoughnessFactor; + + } + + if ( extension.clearcoatRoughnessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) ); + + } + + if ( extension.clearcoatNormalTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) ); + + if ( extension.clearcoatNormalTexture.scale !== undefined ) { + + const scale = extension.clearcoatNormalTexture.scale; + + materialParams.clearcoatNormalScale = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2( scale, scale ); + + } + + } + + return Promise.all( pending ); + + } + +} + +/** + * Transmission Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission + * Draft: https://github.com/KhronosGroup/glTF/pull/1698 + */ +class GLTFMaterialsTransmissionExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_TRANSMISSION; + + } + + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; + + } + + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + + const extension = materialDef.extensions[ this.name ]; + + if ( extension.transmissionFactor !== undefined ) { + + materialParams.transmission = extension.transmissionFactor; + + } + + if ( extension.transmissionTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) ); + + } + + return Promise.all( pending ); + + } + +} + +/** + * Materials Volume Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume + */ +class GLTFMaterialsVolumeExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_VOLUME; + + } + + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; + + } + + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + + const extension = materialDef.extensions[ this.name ]; + + materialParams.thickness = extension.thicknessFactor !== undefined ? extension.thicknessFactor : 0; + + if ( extension.thicknessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) ); + + } + + materialParams.attenuationDistance = extension.attenuationDistance || 0; + + const colorArray = extension.attenuationColor || [ 1, 1, 1 ]; + materialParams.attenuationTint = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); + + return Promise.all( pending ); + + } + +} + +/** + * Materials ior Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior + */ +class GLTFMaterialsIorExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_IOR; + + } + + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; + + } + + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const extension = materialDef.extensions[ this.name ]; + + materialParams.ior = extension.ior !== undefined ? extension.ior : 1.5; + + return Promise.resolve(); + + } + +} + +/** + * Materials specular Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular + */ +class GLTFMaterialsSpecularExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_SPECULAR; + + } + + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; + + } + + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + + const extension = materialDef.extensions[ this.name ]; + + materialParams.specularIntensity = extension.specularFactor !== undefined ? extension.specularFactor : 1.0; + + if ( extension.specularTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) ); + + } + + const colorArray = extension.specularColorFactor || [ 1, 1, 1 ]; + materialParams.specularTint = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); + + if ( extension.specularColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'specularTintMap', extension.specularColorTexture ).then( function ( texture ) { + + texture.encoding = three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding; + + } ) ); + + } + + return Promise.all( pending ); + + } + +} + +/** + * BasisU Texture Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu + */ +class GLTFTextureBasisUExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_TEXTURE_BASISU; + + } + + loadTexture( textureIndex ) { + + const parser = this.parser; + const json = parser.json; + + const textureDef = json.textures[ textureIndex ]; + + if ( ! textureDef.extensions || ! textureDef.extensions[ this.name ] ) { + + return null; + + } + + const extension = textureDef.extensions[ this.name ]; + const source = json.images[ extension.source ]; + const loader = parser.options.ktx2Loader; + + if ( ! loader ) { + + if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) { + + throw new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' ); + + } else { + + // Assumes that the extension is optional and that a fallback texture is present + return null; + + } + + } + + return parser.loadTextureImage( textureIndex, source, loader ); + + } + +} + +/** + * WebP Texture Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp + */ +class GLTFTextureWebPExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.EXT_TEXTURE_WEBP; + this.isSupported = null; + + } + + loadTexture( textureIndex ) { + + const name = this.name; + const parser = this.parser; + const json = parser.json; + + const textureDef = json.textures[ textureIndex ]; + + if ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) { + + return null; + + } + + const extension = textureDef.extensions[ name ]; + const source = json.images[ extension.source ]; + + let loader = parser.textureLoader; + if ( source.uri ) { + + const handler = parser.options.manager.getHandler( source.uri ); + if ( handler !== null ) loader = handler; + + } + + return this.detectSupport().then( function ( isSupported ) { + + if ( isSupported ) return parser.loadTextureImage( textureIndex, source, loader ); + + if ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) { + + throw new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' ); + + } + + // Fall back to PNG or JPEG. + return parser.loadTexture( textureIndex ); + + } ); + + } + + detectSupport() { + + if ( ! this.isSupported ) { + + this.isSupported = new Promise( function ( resolve ) { + + const image = new Image(); + + // Lossy test image. Support for lossy images doesn't guarantee support for all + // WebP images, unfortunately. + image.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'; + + image.onload = image.onerror = function () { + + resolve( image.height === 1 ); + + }; + + } ); + + } + + return this.isSupported; + + } + +} + +/** + * meshopt BufferView Compression Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression + */ +class GLTFMeshoptCompression { + + constructor( parser ) { + + this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION; + this.parser = parser; + + } + + loadBufferView( index ) { + + const json = this.parser.json; + const bufferView = json.bufferViews[ index ]; + + if ( bufferView.extensions && bufferView.extensions[ this.name ] ) { + + const extensionDef = bufferView.extensions[ this.name ]; + + const buffer = this.parser.getDependency( 'buffer', extensionDef.buffer ); + const decoder = this.parser.options.meshoptDecoder; + + if ( ! decoder || ! decoder.supported ) { + + if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) { + + throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' ); + + } else { + + // Assumes that the extension is optional and that fallback buffer data is present + return null; + + } + + } + + return Promise.all( [ buffer, decoder.ready ] ).then( function ( res ) { + + const byteOffset = extensionDef.byteOffset || 0; + const byteLength = extensionDef.byteLength || 0; + + const count = extensionDef.count; + const stride = extensionDef.byteStride; + + const result = new ArrayBuffer( count * stride ); + const source = new Uint8Array( res[ 0 ], byteOffset, byteLength ); + + decoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter ); + return result; + + } ); + + } else { + + return null; + + } + + } + +} + +/* BINARY EXTENSION */ +const BINARY_EXTENSION_HEADER_MAGIC = 'glTF'; +const BINARY_EXTENSION_HEADER_LENGTH = 12; +const BINARY_EXTENSION_CHUNK_TYPES = { JSON: 0x4E4F534A, BIN: 0x004E4942 }; + +class GLTFBinaryExtension { + + constructor( data ) { + + this.name = EXTENSIONS.KHR_BINARY_GLTF; + this.content = null; + this.body = null; + + const headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH ); + + this.header = { + magic: three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ), + version: headerView.getUint32( 4, true ), + length: headerView.getUint32( 8, true ) + }; + + if ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) { + + throw new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' ); + + } else if ( this.header.version < 2.0 ) { + + throw new Error( 'THREE.GLTFLoader: Legacy binary file detected.' ); + + } + + const chunkContentsLength = this.header.length - BINARY_EXTENSION_HEADER_LENGTH; + const chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH ); + let chunkIndex = 0; + + while ( chunkIndex < chunkContentsLength ) { + + const chunkLength = chunkView.getUint32( chunkIndex, true ); + chunkIndex += 4; + + const chunkType = chunkView.getUint32( chunkIndex, true ); + chunkIndex += 4; + + if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) { + + const contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength ); + this.content = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( contentArray ); + + } else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) { + + const byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex; + this.body = data.slice( byteOffset, byteOffset + chunkLength ); + + } + + // Clients must ignore chunks with unknown types. + + chunkIndex += chunkLength; + + } + + if ( this.content === null ) { + + throw new Error( 'THREE.GLTFLoader: JSON content not found.' ); + + } + + } + +} + +/** + * DRACO Mesh Compression Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression + */ +class GLTFDracoMeshCompressionExtension { + + constructor( json, dracoLoader ) { + + if ( ! dracoLoader ) { + + throw new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' ); + + } + + this.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION; + this.json = json; + this.dracoLoader = dracoLoader; + this.dracoLoader.preload(); + + } + + decodePrimitive( primitive, parser ) { + + const json = this.json; + const dracoLoader = this.dracoLoader; + const bufferViewIndex = primitive.extensions[ this.name ].bufferView; + const gltfAttributeMap = primitive.extensions[ this.name ].attributes; + const threeAttributeMap = {}; + const attributeNormalizedMap = {}; + const attributeTypeMap = {}; + + for ( const attributeName in gltfAttributeMap ) { + + const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); + + threeAttributeMap[ threeAttributeName ] = gltfAttributeMap[ attributeName ]; + + } + + for ( const attributeName in primitive.attributes ) { + + const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); + + if ( gltfAttributeMap[ attributeName ] !== undefined ) { + + const accessorDef = json.accessors[ primitive.attributes[ attributeName ] ]; + const componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; + + attributeTypeMap[ threeAttributeName ] = componentType; + attributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true; + + } + + } + + return parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) { + + return new Promise( function ( resolve ) { + + dracoLoader.decodeDracoFile( bufferView, function ( geometry ) { + + for ( const attributeName in geometry.attributes ) { + + const attribute = geometry.attributes[ attributeName ]; + const normalized = attributeNormalizedMap[ attributeName ]; + + if ( normalized !== undefined ) attribute.normalized = normalized; + + } + + resolve( geometry ); + + }, threeAttributeMap, attributeTypeMap ); + + } ); + + } ); + + } + +} + +/** + * Texture Transform Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform + */ +class GLTFTextureTransformExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM; + + } + + extendTexture( texture, transform ) { + + if ( transform.texCoord !== undefined ) { + + console.warn( 'THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.' ); + + } + + if ( transform.offset === undefined && transform.rotation === undefined && transform.scale === undefined ) { + + // See https://github.com/mrdoob/three.js/issues/21819. + return texture; + + } + + texture = texture.clone(); + + if ( transform.offset !== undefined ) { + + texture.offset.fromArray( transform.offset ); + + } + + if ( transform.rotation !== undefined ) { + + texture.rotation = transform.rotation; + + } + + if ( transform.scale !== undefined ) { + + texture.repeat.fromArray( transform.scale ); + + } + + texture.needsUpdate = true; + + return texture; + + } + +} + +/** + * Specular-Glossiness Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness + */ + +/** + * A sub class of StandardMaterial with some of the functionality + * changed via the `onBeforeCompile` callback + * @pailhead + */ +class GLTFMeshStandardSGMaterial extends three__WEBPACK_IMPORTED_MODULE_0__.MeshStandardMaterial { + + constructor( params ) { + + super(); + + this.isGLTFSpecularGlossinessMaterial = true; + + //various chunks that need replacing + const specularMapParsFragmentChunk = [ + '#ifdef USE_SPECULARMAP', + ' uniform sampler2D specularMap;', + '#endif' + ].join( '\n' ); + + const glossinessMapParsFragmentChunk = [ + '#ifdef USE_GLOSSINESSMAP', + ' uniform sampler2D glossinessMap;', + '#endif' + ].join( '\n' ); + + const specularMapFragmentChunk = [ + 'vec3 specularFactor = specular;', + '#ifdef USE_SPECULARMAP', + ' vec4 texelSpecular = texture2D( specularMap, vUv );', + ' texelSpecular = sRGBToLinear( texelSpecular );', + ' // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture', + ' specularFactor *= texelSpecular.rgb;', + '#endif' + ].join( '\n' ); + + const glossinessMapFragmentChunk = [ + 'float glossinessFactor = glossiness;', + '#ifdef USE_GLOSSINESSMAP', + ' vec4 texelGlossiness = texture2D( glossinessMap, vUv );', + ' // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture', + ' glossinessFactor *= texelGlossiness.a;', + '#endif' + ].join( '\n' ); + + const lightPhysicalFragmentChunk = [ + 'PhysicalMaterial material;', + 'material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );', + 'vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );', + 'float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );', + 'material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.', + 'material.roughness += geometryRoughness;', + 'material.roughness = min( material.roughness, 1.0 );', + 'material.specularColor = specularFactor;', + ].join( '\n' ); + + const uniforms = { + specular: { value: new three__WEBPACK_IMPORTED_MODULE_0__.Color().setHex( 0xffffff ) }, + glossiness: { value: 1 }, + specularMap: { value: null }, + glossinessMap: { value: null } + }; + + this._extraUniforms = uniforms; + + this.onBeforeCompile = function ( shader ) { + + for ( const uniformName in uniforms ) { + + shader.uniforms[ uniformName ] = uniforms[ uniformName ]; + + } + + shader.fragmentShader = shader.fragmentShader + .replace( 'uniform float roughness;', 'uniform vec3 specular;' ) + .replace( 'uniform float metalness;', 'uniform float glossiness;' ) + .replace( '#include ', specularMapParsFragmentChunk ) + .replace( '#include ', glossinessMapParsFragmentChunk ) + .replace( '#include ', specularMapFragmentChunk ) + .replace( '#include ', glossinessMapFragmentChunk ) + .replace( '#include ', lightPhysicalFragmentChunk ); + + }; + + Object.defineProperties( this, { + + specular: { + get: function () { + + return uniforms.specular.value; + + }, + set: function ( v ) { + + uniforms.specular.value = v; + + } + }, + + specularMap: { + get: function () { + + return uniforms.specularMap.value; + + }, + set: function ( v ) { + + uniforms.specularMap.value = v; + + if ( v ) { + + this.defines.USE_SPECULARMAP = ''; // USE_UV is set by the renderer for specular maps + + } else { + + delete this.defines.USE_SPECULARMAP; + + } + + } + }, + + glossiness: { + get: function () { + + return uniforms.glossiness.value; + + }, + set: function ( v ) { + + uniforms.glossiness.value = v; + + } + }, + + glossinessMap: { + get: function () { + + return uniforms.glossinessMap.value; + + }, + set: function ( v ) { + + uniforms.glossinessMap.value = v; + + if ( v ) { + + this.defines.USE_GLOSSINESSMAP = ''; + this.defines.USE_UV = ''; + + } else { + + delete this.defines.USE_GLOSSINESSMAP; + delete this.defines.USE_UV; + + } + + } + } + + } ); + + delete this.metalness; + delete this.roughness; + delete this.metalnessMap; + delete this.roughnessMap; + + this.setValues( params ); + + } + + copy( source ) { + + super.copy( source ); + + this.specularMap = source.specularMap; + this.specular.copy( source.specular ); + this.glossinessMap = source.glossinessMap; + this.glossiness = source.glossiness; + delete this.metalness; + delete this.roughness; + delete this.metalnessMap; + delete this.roughnessMap; + return this; + + } + +} + + +class GLTFMaterialsPbrSpecularGlossinessExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS; + + this.specularGlossinessParams = [ + 'color', + 'map', + 'lightMap', + 'lightMapIntensity', + 'aoMap', + 'aoMapIntensity', + 'emissive', + 'emissiveIntensity', + 'emissiveMap', + 'bumpMap', + 'bumpScale', + 'normalMap', + 'normalMapType', + 'displacementMap', + 'displacementScale', + 'displacementBias', + 'specularMap', + 'specular', + 'glossinessMap', + 'glossiness', + 'alphaMap', + 'envMap', + 'envMapIntensity', + 'refractionRatio', + ]; + + } + + getMaterialType() { + + return GLTFMeshStandardSGMaterial; + + } + + extendParams( materialParams, materialDef, parser ) { + + const pbrSpecularGlossiness = materialDef.extensions[ this.name ]; + + materialParams.color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + + const pending = []; + + if ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) { + + const array = pbrSpecularGlossiness.diffuseFactor; + + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( pbrSpecularGlossiness.diffuseTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', pbrSpecularGlossiness.diffuseTexture ) ); + + } + + materialParams.emissive = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 0.0, 0.0, 0.0 ); + materialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0; + materialParams.specular = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); + + if ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) { + + materialParams.specular.fromArray( pbrSpecularGlossiness.specularFactor ); + + } + + if ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) { + + const specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture; + pending.push( parser.assignTexture( materialParams, 'glossinessMap', specGlossMapDef ) ); + pending.push( parser.assignTexture( materialParams, 'specularMap', specGlossMapDef ) ); + + } + + return Promise.all( pending ); + + } + + createMaterial( materialParams ) { + + const material = new GLTFMeshStandardSGMaterial( materialParams ); + material.fog = true; + + material.color = materialParams.color; + + material.map = materialParams.map === undefined ? null : materialParams.map; + + material.lightMap = null; + material.lightMapIntensity = 1.0; + + material.aoMap = materialParams.aoMap === undefined ? null : materialParams.aoMap; + material.aoMapIntensity = 1.0; + + material.emissive = materialParams.emissive; + material.emissiveIntensity = 1.0; + material.emissiveMap = materialParams.emissiveMap === undefined ? null : materialParams.emissiveMap; + + material.bumpMap = materialParams.bumpMap === undefined ? null : materialParams.bumpMap; + material.bumpScale = 1; + + material.normalMap = materialParams.normalMap === undefined ? null : materialParams.normalMap; + material.normalMapType = three__WEBPACK_IMPORTED_MODULE_0__.TangentSpaceNormalMap; + + if ( materialParams.normalScale ) material.normalScale = materialParams.normalScale; + + material.displacementMap = null; + material.displacementScale = 1; + material.displacementBias = 0; + + material.specularMap = materialParams.specularMap === undefined ? null : materialParams.specularMap; + material.specular = materialParams.specular; + + material.glossinessMap = materialParams.glossinessMap === undefined ? null : materialParams.glossinessMap; + material.glossiness = materialParams.glossiness; + + material.alphaMap = null; + + material.envMap = materialParams.envMap === undefined ? null : materialParams.envMap; + material.envMapIntensity = 1.0; + + material.refractionRatio = 0.98; + + return material; + + } + +} + +/** + * Mesh Quantization Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization + */ +class GLTFMeshQuantizationExtension { + + constructor() { + + this.name = EXTENSIONS.KHR_MESH_QUANTIZATION; + + } + +} + +/*********************************/ +/********** INTERPOLATION ********/ +/*********************************/ + +// Spline Interpolation +// Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation +class GLTFCubicSplineInterpolant extends three__WEBPACK_IMPORTED_MODULE_0__.Interpolant { + + constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { + + super( parameterPositions, sampleValues, sampleSize, resultBuffer ); + + } + + copySampleValue_( index ) { + + // Copies a sample value to the result buffer. See description of glTF + // CUBICSPLINE values layout in interpolate_() function below. + + const result = this.resultBuffer, + values = this.sampleValues, + valueSize = this.valueSize, + offset = index * valueSize * 3 + valueSize; + + for ( let i = 0; i !== valueSize; i ++ ) { + + result[ i ] = values[ offset + i ]; + + } + + return result; + + } + +} + +GLTFCubicSplineInterpolant.prototype.beforeStart_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_; + +GLTFCubicSplineInterpolant.prototype.afterEnd_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_; + +GLTFCubicSplineInterpolant.prototype.interpolate_ = function ( i1, t0, t, t1 ) { + + const result = this.resultBuffer; + const values = this.sampleValues; + const stride = this.valueSize; + + const stride2 = stride * 2; + const stride3 = stride * 3; + + const td = t1 - t0; + + const p = ( t - t0 ) / td; + const pp = p * p; + const ppp = pp * p; + + const offset1 = i1 * stride3; + const offset0 = offset1 - stride3; + + const s2 = - 2 * ppp + 3 * pp; + const s3 = ppp - pp; + const s0 = 1 - s2; + const s1 = s3 - pp + p; + + // Layout of keyframe output values for CUBICSPLINE animations: + // [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ] + for ( let i = 0; i !== stride; i ++ ) { + + const p0 = values[ offset0 + i + stride ]; // splineVertex_k + const m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k) + const p1 = values[ offset1 + i + stride ]; // splineVertex_k+1 + const m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k) + + result[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1; + + } + + return result; + +}; + +const _q = new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion(); + +class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant { + + interpolate_( i1, t0, t, t1 ) { + + const result = super.interpolate_( i1, t0, t, t1 ); + + _q.fromArray( result ).normalize().toArray( result ); + + return result; + + } + +} + + +/*********************************/ +/********** INTERNALS ************/ +/*********************************/ + +/* CONSTANTS */ + +const WEBGL_CONSTANTS = { + FLOAT: 5126, + //FLOAT_MAT2: 35674, + FLOAT_MAT3: 35675, + FLOAT_MAT4: 35676, + FLOAT_VEC2: 35664, + FLOAT_VEC3: 35665, + FLOAT_VEC4: 35666, + LINEAR: 9729, + REPEAT: 10497, + SAMPLER_2D: 35678, + POINTS: 0, + LINES: 1, + LINE_LOOP: 2, + LINE_STRIP: 3, + TRIANGLES: 4, + TRIANGLE_STRIP: 5, + TRIANGLE_FAN: 6, + UNSIGNED_BYTE: 5121, + UNSIGNED_SHORT: 5123 +}; + +const WEBGL_COMPONENT_TYPES = { + 5120: Int8Array, + 5121: Uint8Array, + 5122: Int16Array, + 5123: Uint16Array, + 5125: Uint32Array, + 5126: Float32Array +}; + +const WEBGL_FILTERS = { + 9728: three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter, + 9729: three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter, + 9984: three__WEBPACK_IMPORTED_MODULE_0__.NearestMipmapNearestFilter, + 9985: three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapNearestFilter, + 9986: three__WEBPACK_IMPORTED_MODULE_0__.NearestMipmapLinearFilter, + 9987: three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapLinearFilter +}; + +const WEBGL_WRAPPINGS = { + 33071: three__WEBPACK_IMPORTED_MODULE_0__.ClampToEdgeWrapping, + 33648: three__WEBPACK_IMPORTED_MODULE_0__.MirroredRepeatWrapping, + 10497: three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping +}; + +const WEBGL_TYPE_SIZES = { + 'SCALAR': 1, + 'VEC2': 2, + 'VEC3': 3, + 'VEC4': 4, + 'MAT2': 4, + 'MAT3': 9, + 'MAT4': 16 +}; + +const ATTRIBUTES = { + POSITION: 'position', + NORMAL: 'normal', + TANGENT: 'tangent', + TEXCOORD_0: 'uv', + TEXCOORD_1: 'uv2', + COLOR_0: 'color', + WEIGHTS_0: 'skinWeight', + JOINTS_0: 'skinIndex', +}; + +const PATH_PROPERTIES = { + scale: 'scale', + translation: 'position', + rotation: 'quaternion', + weights: 'morphTargetInfluences' +}; + +const INTERPOLATION = { + CUBICSPLINE: undefined, // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each + // keyframe track will be initialized with a default interpolation type, then modified. + LINEAR: three__WEBPACK_IMPORTED_MODULE_0__.InterpolateLinear, + STEP: three__WEBPACK_IMPORTED_MODULE_0__.InterpolateDiscrete +}; + +const ALPHA_MODES = { + OPAQUE: 'OPAQUE', + MASK: 'MASK', + BLEND: 'BLEND' +}; + +/* UTILITY FUNCTIONS */ + +function resolveURL( url, path ) { + + // Invalid URL + if ( typeof url !== 'string' || url === '' ) return ''; + + // Host Relative URL + if ( /^https?:\/\//i.test( path ) && /^\//.test( url ) ) { + + path = path.replace( /(^https?:\/\/[^\/]+).*/i, '$1' ); + + } + + // Absolute URL http://,https://,// + if ( /^(https?:)?\/\//i.test( url ) ) return url; + + // Data URI + if ( /^data:.*,.*$/i.test( url ) ) return url; + + // Blob URL + if ( /^blob:.*$/i.test( url ) ) return url; + + // Relative URL + return path + url; + +} + +/** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material + */ +function createDefaultMaterial( cache ) { + + if ( cache[ 'DefaultMaterial' ] === undefined ) { + + cache[ 'DefaultMaterial' ] = new three__WEBPACK_IMPORTED_MODULE_0__.MeshStandardMaterial( { + color: 0xFFFFFF, + emissive: 0x000000, + metalness: 1, + roughness: 1, + transparent: false, + depthTest: true, + side: three__WEBPACK_IMPORTED_MODULE_0__.FrontSide + } ); + + } + + return cache[ 'DefaultMaterial' ]; + +} + +function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) { + + // Add unknown glTF extensions to an object's userData. + + for ( const name in objectDef.extensions ) { + + if ( knownExtensions[ name ] === undefined ) { + + object.userData.gltfExtensions = object.userData.gltfExtensions || {}; + object.userData.gltfExtensions[ name ] = objectDef.extensions[ name ]; + + } + + } + +} + +/** + * @param {Object3D|Material|BufferGeometry} object + * @param {GLTF.definition} gltfDef + */ +function assignExtrasToUserData( object, gltfDef ) { + + if ( gltfDef.extras !== undefined ) { + + if ( typeof gltfDef.extras === 'object' ) { + + Object.assign( object.userData, gltfDef.extras ); + + } else { + + console.warn( 'THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras ); + + } + + } + +} + +/** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets + * + * @param {BufferGeometry} geometry + * @param {Array} targets + * @param {GLTFParser} parser + * @return {Promise} + */ +function addMorphTargets( geometry, targets, parser ) { + + let hasMorphPosition = false; + let hasMorphNormal = false; + + for ( let i = 0, il = targets.length; i < il; i ++ ) { + + const target = targets[ i ]; + + if ( target.POSITION !== undefined ) hasMorphPosition = true; + if ( target.NORMAL !== undefined ) hasMorphNormal = true; + + if ( hasMorphPosition && hasMorphNormal ) break; + + } + + if ( ! hasMorphPosition && ! hasMorphNormal ) return Promise.resolve( geometry ); + + const pendingPositionAccessors = []; + const pendingNormalAccessors = []; + + for ( let i = 0, il = targets.length; i < il; i ++ ) { + + const target = targets[ i ]; + + if ( hasMorphPosition ) { + + const pendingAccessor = target.POSITION !== undefined + ? parser.getDependency( 'accessor', target.POSITION ) + : geometry.attributes.position; + + pendingPositionAccessors.push( pendingAccessor ); + + } + + if ( hasMorphNormal ) { + + const pendingAccessor = target.NORMAL !== undefined + ? parser.getDependency( 'accessor', target.NORMAL ) + : geometry.attributes.normal; + + pendingNormalAccessors.push( pendingAccessor ); + + } + + } + + return Promise.all( [ + Promise.all( pendingPositionAccessors ), + Promise.all( pendingNormalAccessors ) + ] ).then( function ( accessors ) { + + const morphPositions = accessors[ 0 ]; + const morphNormals = accessors[ 1 ]; + + if ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions; + if ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals; + geometry.morphTargetsRelative = true; + + return geometry; + + } ); + +} + +/** + * @param {Mesh} mesh + * @param {GLTF.Mesh} meshDef + */ +function updateMorphTargets( mesh, meshDef ) { + + mesh.updateMorphTargets(); + + if ( meshDef.weights !== undefined ) { + + for ( let i = 0, il = meshDef.weights.length; i < il; i ++ ) { + + mesh.morphTargetInfluences[ i ] = meshDef.weights[ i ]; + + } + + } + + // .extras has user-defined data, so check that .extras.targetNames is an array. + if ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) { + + const targetNames = meshDef.extras.targetNames; + + if ( mesh.morphTargetInfluences.length === targetNames.length ) { + + mesh.morphTargetDictionary = {}; + + for ( let i = 0, il = targetNames.length; i < il; i ++ ) { + + mesh.morphTargetDictionary[ targetNames[ i ] ] = i; + + } + + } else { + + console.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' ); + + } + + } + +} + +function createPrimitiveKey( primitiveDef ) { + + const dracoExtension = primitiveDef.extensions && primitiveDef.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ]; + let geometryKey; + + if ( dracoExtension ) { + + geometryKey = 'draco:' + dracoExtension.bufferView + + ':' + dracoExtension.indices + + ':' + createAttributesKey( dracoExtension.attributes ); + + } else { + + geometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + ':' + primitiveDef.mode; + + } + + return geometryKey; + +} + +function createAttributesKey( attributes ) { + + let attributesKey = ''; + + const keys = Object.keys( attributes ).sort(); + + for ( let i = 0, il = keys.length; i < il; i ++ ) { + + attributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';'; + + } + + return attributesKey; + +} + +function getNormalizedComponentScale( constructor ) { + + // Reference: + // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data + + switch ( constructor ) { + + case Int8Array: + return 1 / 127; + + case Uint8Array: + return 1 / 255; + + case Int16Array: + return 1 / 32767; + + case Uint16Array: + return 1 / 65535; + + default: + throw new Error( 'THREE.GLTFLoader: Unsupported normalized accessor component type.' ); + + } + +} + +/* GLTF PARSER */ + +class GLTFParser { + + constructor( json = {}, options = {} ) { + + this.json = json; + this.extensions = {}; + this.plugins = {}; + this.options = options; + + // loader object cache + this.cache = new GLTFRegistry(); + + // associations between Three.js objects and glTF elements + this.associations = new Map(); + + // BufferGeometry caching + this.primitiveCache = {}; + + // Object3D instance caches + this.meshCache = { refs: {}, uses: {} }; + this.cameraCache = { refs: {}, uses: {} }; + this.lightCache = { refs: {}, uses: {} }; + + this.textureCache = {}; + + // Track node names, to ensure no duplicates + this.nodeNamesUsed = {}; + + // Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the + // expensive work of uploading a texture to the GPU off the main thread. + if ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) { + + this.textureLoader = new three__WEBPACK_IMPORTED_MODULE_0__.ImageBitmapLoader( this.options.manager ); + + } else { + + this.textureLoader = new three__WEBPACK_IMPORTED_MODULE_0__.TextureLoader( this.options.manager ); + + } + + this.textureLoader.setCrossOrigin( this.options.crossOrigin ); + this.textureLoader.setRequestHeader( this.options.requestHeader ); + + this.fileLoader = new three__WEBPACK_IMPORTED_MODULE_0__.FileLoader( this.options.manager ); + this.fileLoader.setResponseType( 'arraybuffer' ); + + if ( this.options.crossOrigin === 'use-credentials' ) { + + this.fileLoader.setWithCredentials( true ); + + } + + } + + setExtensions( extensions ) { + + this.extensions = extensions; + + } + + setPlugins( plugins ) { + + this.plugins = plugins; + + } + + parse( onLoad, onError ) { + + const parser = this; + const json = this.json; + const extensions = this.extensions; + + // Clear the loader cache + this.cache.removeAll(); + + // Mark the special nodes/meshes in json for efficient parse + this._invokeAll( function ( ext ) { + + return ext._markDefs && ext._markDefs(); + + } ); + + Promise.all( this._invokeAll( function ( ext ) { + + return ext.beforeRoot && ext.beforeRoot(); + + } ) ).then( function () { + + return Promise.all( [ + + parser.getDependencies( 'scene' ), + parser.getDependencies( 'animation' ), + parser.getDependencies( 'camera' ), + + ] ); + + } ).then( function ( dependencies ) { + + const result = { + scene: dependencies[ 0 ][ json.scene || 0 ], + scenes: dependencies[ 0 ], + animations: dependencies[ 1 ], + cameras: dependencies[ 2 ], + asset: json.asset, + parser: parser, + userData: {} + }; + + addUnknownExtensionsToUserData( extensions, result, json ); + + assignExtrasToUserData( result, json ); + + Promise.all( parser._invokeAll( function ( ext ) { + + return ext.afterRoot && ext.afterRoot( result ); + + } ) ).then( function () { + + onLoad( result ); + + } ); + + } ).catch( onError ); + + } + + /** + * Marks the special nodes/meshes in json for efficient parse. + */ + _markDefs() { + + const nodeDefs = this.json.nodes || []; + const skinDefs = this.json.skins || []; + const meshDefs = this.json.meshes || []; + + // Nothing in the node definition indicates whether it is a Bone or an + // Object3D. Use the skins' joint references to mark bones. + for ( let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) { + + const joints = skinDefs[ skinIndex ].joints; + + for ( let i = 0, il = joints.length; i < il; i ++ ) { + + nodeDefs[ joints[ i ] ].isBone = true; + + } + + } + + // Iterate over all nodes, marking references to shared resources, + // as well as skeleton joints. + for ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) { + + const nodeDef = nodeDefs[ nodeIndex ]; + + if ( nodeDef.mesh !== undefined ) { + + this._addNodeRef( this.meshCache, nodeDef.mesh ); + + // Nothing in the mesh definition indicates whether it is + // a SkinnedMesh or Mesh. Use the node's mesh reference + // to mark SkinnedMesh if node has skin. + if ( nodeDef.skin !== undefined ) { + + meshDefs[ nodeDef.mesh ].isSkinnedMesh = true; + + } + + } + + if ( nodeDef.camera !== undefined ) { + + this._addNodeRef( this.cameraCache, nodeDef.camera ); + + } + + } + + } + + /** + * Counts references to shared node / Object3D resources. These resources + * can be reused, or "instantiated", at multiple nodes in the scene + * hierarchy. Mesh, Camera, and Light instances are instantiated and must + * be marked. Non-scenegraph resources (like Materials, Geometries, and + * Textures) can be reused directly and are not marked here. + * + * Example: CesiumMilkTruck sample model reuses "Wheel" meshes. + */ + _addNodeRef( cache, index ) { + + if ( index === undefined ) return; + + if ( cache.refs[ index ] === undefined ) { + + cache.refs[ index ] = cache.uses[ index ] = 0; + + } + + cache.refs[ index ] ++; + + } + + /** Returns a reference to a shared resource, cloning it if necessary. */ + _getNodeRef( cache, index, object ) { + + if ( cache.refs[ index ] <= 1 ) return object; + + const ref = object.clone(); + + // Propagates mappings to the cloned object, prevents mappings on the + // original object from being lost. + const updateMappings = ( original, clone ) => { + + const mappings = this.associations.get( original ); + if ( mappings != null ) { + + this.associations.set( clone, mappings ); + + } + + for ( const [ i, child ] of original.children.entries() ) { + + updateMappings( child, clone.children[ i ] ); + + } + + }; + + updateMappings( object, ref ); + + ref.name += '_instance_' + ( cache.uses[ index ] ++ ); + + return ref; + + } + + _invokeOne( func ) { + + const extensions = Object.values( this.plugins ); + extensions.push( this ); + + for ( let i = 0; i < extensions.length; i ++ ) { + + const result = func( extensions[ i ] ); + + if ( result ) return result; + + } + + return null; + + } + + _invokeAll( func ) { + + const extensions = Object.values( this.plugins ); + extensions.unshift( this ); + + const pending = []; + + for ( let i = 0; i < extensions.length; i ++ ) { + + const result = func( extensions[ i ] ); + + if ( result ) pending.push( result ); + + } + + return pending; + + } + + /** + * Requests the specified dependency asynchronously, with caching. + * @param {string} type + * @param {number} index + * @return {Promise} + */ + getDependency( type, index ) { + + const cacheKey = type + ':' + index; + let dependency = this.cache.get( cacheKey ); + + if ( ! dependency ) { + + switch ( type ) { + + case 'scene': + dependency = this.loadScene( index ); + break; + + case 'node': + dependency = this.loadNode( index ); + break; + + case 'mesh': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadMesh && ext.loadMesh( index ); + + } ); + break; + + case 'accessor': + dependency = this.loadAccessor( index ); + break; + + case 'bufferView': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadBufferView && ext.loadBufferView( index ); + + } ); + break; + + case 'buffer': + dependency = this.loadBuffer( index ); + break; + + case 'material': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadMaterial && ext.loadMaterial( index ); + + } ); + break; + + case 'texture': + dependency = this._invokeOne( function ( ext ) { + + return ext.loadTexture && ext.loadTexture( index ); + + } ); + break; + + case 'skin': + dependency = this.loadSkin( index ); + break; + + case 'animation': + dependency = this.loadAnimation( index ); + break; + + case 'camera': + dependency = this.loadCamera( index ); + break; + + default: + throw new Error( 'Unknown type: ' + type ); + + } + + this.cache.add( cacheKey, dependency ); + + } + + return dependency; + + } + + /** + * Requests all dependencies of the specified type asynchronously, with caching. + * @param {string} type + * @return {Promise>} + */ + getDependencies( type ) { + + let dependencies = this.cache.get( type ); + + if ( ! dependencies ) { + + const parser = this; + const defs = this.json[ type + ( type === 'mesh' ? 'es' : 's' ) ] || []; + + dependencies = Promise.all( defs.map( function ( def, index ) { + + return parser.getDependency( type, index ); + + } ) ); + + this.cache.add( type, dependencies ); + + } + + return dependencies; + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views + * @param {number} bufferIndex + * @return {Promise} + */ + loadBuffer( bufferIndex ) { + + const bufferDef = this.json.buffers[ bufferIndex ]; + const loader = this.fileLoader; + + if ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) { + + throw new Error( 'THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.' ); + + } + + // If present, GLB container is required to be the first buffer. + if ( bufferDef.uri === undefined && bufferIndex === 0 ) { + + return Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body ); + + } + + const options = this.options; + + return new Promise( function ( resolve, reject ) { + + loader.load( resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () { + + reject( new Error( 'THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".' ) ); + + } ); + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views + * @param {number} bufferViewIndex + * @return {Promise} + */ + loadBufferView( bufferViewIndex ) { + + const bufferViewDef = this.json.bufferViews[ bufferViewIndex ]; + + return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) { + + const byteLength = bufferViewDef.byteLength || 0; + const byteOffset = bufferViewDef.byteOffset || 0; + return buffer.slice( byteOffset, byteOffset + byteLength ); + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors + * @param {number} accessorIndex + * @return {Promise} + */ + loadAccessor( accessorIndex ) { + + const parser = this; + const json = this.json; + + const accessorDef = this.json.accessors[ accessorIndex ]; + + if ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) { + + // Ignore empty accessors, which may be used to declare runtime + // information about attributes coming from another source (e.g. Draco + // compression extension). + return Promise.resolve( null ); + + } + + const pendingBufferViews = []; + + if ( accessorDef.bufferView !== undefined ) { + + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.bufferView ) ); + + } else { + + pendingBufferViews.push( null ); + + } + + if ( accessorDef.sparse !== undefined ) { + + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.indices.bufferView ) ); + pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.values.bufferView ) ); + + } + + return Promise.all( pendingBufferViews ).then( function ( bufferViews ) { + + const bufferView = bufferViews[ 0 ]; + + const itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ]; + const TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; + + // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12. + const elementBytes = TypedArray.BYTES_PER_ELEMENT; + const itemBytes = elementBytes * itemSize; + const byteOffset = accessorDef.byteOffset || 0; + const byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[ accessorDef.bufferView ].byteStride : undefined; + const normalized = accessorDef.normalized === true; + let array, bufferAttribute; + + // The buffer is not interleaved if the stride is the item size in bytes. + if ( byteStride && byteStride !== itemBytes ) { + + // Each "slice" of the buffer, as defined by 'count' elements of 'byteStride' bytes, gets its own InterleavedBuffer + // This makes sure that IBA.count reflects accessor.count properly + const ibSlice = Math.floor( byteOffset / byteStride ); + const ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType + ':' + ibSlice + ':' + accessorDef.count; + let ib = parser.cache.get( ibCacheKey ); + + if ( ! ib ) { + + array = new TypedArray( bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes ); + + // Integer parameters to IB/IBA are in array elements, not bytes. + ib = new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBuffer( array, byteStride / elementBytes ); + + parser.cache.add( ibCacheKey, ib ); + + } + + bufferAttribute = new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( ib, itemSize, ( byteOffset % byteStride ) / elementBytes, normalized ); + + } else { + + if ( bufferView === null ) { + + array = new TypedArray( accessorDef.count * itemSize ); + + } else { + + array = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize ); + + } + + bufferAttribute = new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute( array, itemSize, normalized ); + + } + + // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#sparse-accessors + if ( accessorDef.sparse !== undefined ) { + + const itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR; + const TypedArrayIndices = WEBGL_COMPONENT_TYPES[ accessorDef.sparse.indices.componentType ]; + + const byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0; + const byteOffsetValues = accessorDef.sparse.values.byteOffset || 0; + + const sparseIndices = new TypedArrayIndices( bufferViews[ 1 ], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices ); + const sparseValues = new TypedArray( bufferViews[ 2 ], byteOffsetValues, accessorDef.sparse.count * itemSize ); + + if ( bufferView !== null ) { + + // Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes. + bufferAttribute = new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute( bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized ); + + } + + for ( let i = 0, il = sparseIndices.length; i < il; i ++ ) { + + const index = sparseIndices[ i ]; + + bufferAttribute.setX( index, sparseValues[ i * itemSize ] ); + if ( itemSize >= 2 ) bufferAttribute.setY( index, sparseValues[ i * itemSize + 1 ] ); + if ( itemSize >= 3 ) bufferAttribute.setZ( index, sparseValues[ i * itemSize + 2 ] ); + if ( itemSize >= 4 ) bufferAttribute.setW( index, sparseValues[ i * itemSize + 3 ] ); + if ( itemSize >= 5 ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.' ); + + } + + } + + return bufferAttribute; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures + * @param {number} textureIndex + * @return {Promise} + */ + loadTexture( textureIndex ) { + + const json = this.json; + const options = this.options; + const textureDef = json.textures[ textureIndex ]; + const source = json.images[ textureDef.source ]; + + let loader = this.textureLoader; + + if ( source.uri ) { + + const handler = options.manager.getHandler( source.uri ); + if ( handler !== null ) loader = handler; + + } + + return this.loadTextureImage( textureIndex, source, loader ); + + } + + loadTextureImage( textureIndex, source, loader ) { + + const parser = this; + const json = this.json; + const options = this.options; + + const textureDef = json.textures[ textureIndex ]; + + const cacheKey = ( source.uri || source.bufferView ) + ':' + textureDef.sampler; + + if ( this.textureCache[ cacheKey ] ) { + + // See https://github.com/mrdoob/three.js/issues/21559. + return this.textureCache[ cacheKey ]; + + } + + const URL = self.URL || self.webkitURL; + + let sourceURI = source.uri || ''; + let isObjectURL = false; + + if ( source.bufferView !== undefined ) { + + // Load binary image data from bufferView, if provided. + + sourceURI = parser.getDependency( 'bufferView', source.bufferView ).then( function ( bufferView ) { + + isObjectURL = true; + const blob = new Blob( [ bufferView ], { type: source.mimeType } ); + sourceURI = URL.createObjectURL( blob ); + return sourceURI; + + } ); + + } else if ( source.uri === undefined ) { + + throw new Error( 'THREE.GLTFLoader: Image ' + textureIndex + ' is missing URI and bufferView' ); + + } + + const promise = Promise.resolve( sourceURI ).then( function ( sourceURI ) { + + return new Promise( function ( resolve, reject ) { + + let onLoad = resolve; + + if ( loader.isImageBitmapLoader === true ) { + + onLoad = function ( imageBitmap ) { + + const texture = new three__WEBPACK_IMPORTED_MODULE_0__.Texture( imageBitmap ); + texture.needsUpdate = true; + + resolve( texture ); + + }; + + } + + loader.load( resolveURL( sourceURI, options.path ), onLoad, undefined, reject ); + + } ); + + } ).then( function ( texture ) { + + // Clean up resources and configure Texture. + + if ( isObjectURL === true ) { + + URL.revokeObjectURL( sourceURI ); + + } + + texture.flipY = false; + + if ( textureDef.name ) texture.name = textureDef.name; + + const samplers = json.samplers || {}; + const sampler = samplers[ textureDef.sampler ] || {}; + + texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter; + texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapLinearFilter; + texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping; + texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping; + + parser.associations.set( texture, { textures: textureIndex } ); + + return texture; + + } ).catch( function () { + + console.error( 'THREE.GLTFLoader: Couldn\'t load texture', sourceURI ); + return null; + + } ); + + this.textureCache[ cacheKey ] = promise; + + return promise; + + } + + /** + * Asynchronously assigns a texture to the given material parameters. + * @param {Object} materialParams + * @param {string} mapName + * @param {Object} mapDef + * @return {Promise} + */ + assignTexture( materialParams, mapName, mapDef ) { + + const parser = this; + + return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) { + + // Materials sample aoMap from UV set 1 and other maps from UV set 0 - this can't be configured + // However, we will copy UV set 0 to UV set 1 on demand for aoMap + if ( mapDef.texCoord !== undefined && mapDef.texCoord != 0 && ! ( mapName === 'aoMap' && mapDef.texCoord == 1 ) ) { + + console.warn( 'THREE.GLTFLoader: Custom UV set ' + mapDef.texCoord + ' for texture ' + mapName + ' not yet supported.' ); + + } + + if ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) { + + const transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined; + + if ( transform ) { + + const gltfReference = parser.associations.get( texture ); + texture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform ); + parser.associations.set( texture, gltfReference ); + + } + + } + + materialParams[ mapName ] = texture; + + return texture; + + } ); + + } + + /** + * Assigns final material to a Mesh, Line, or Points instance. The instance + * already has a material (generated from the glTF material options alone) + * but reuse of the same glTF material may require multiple threejs materials + * to accommodate different primitive types, defines, etc. New materials will + * be created if necessary, and reused from a cache. + * @param {Object3D} mesh Mesh, Line, or Points instance. + */ + assignFinalMaterial( mesh ) { + + const geometry = mesh.geometry; + let material = mesh.material; + + const useDerivativeTangents = geometry.attributes.tangent === undefined; + const useVertexColors = geometry.attributes.color !== undefined; + const useFlatShading = geometry.attributes.normal === undefined; + + if ( mesh.isPoints ) { + + const cacheKey = 'PointsMaterial:' + material.uuid; + + let pointsMaterial = this.cache.get( cacheKey ); + + if ( ! pointsMaterial ) { + + pointsMaterial = new three__WEBPACK_IMPORTED_MODULE_0__.PointsMaterial(); + three__WEBPACK_IMPORTED_MODULE_0__.Material.prototype.copy.call( pointsMaterial, material ); + pointsMaterial.color.copy( material.color ); + pointsMaterial.map = material.map; + pointsMaterial.sizeAttenuation = false; // glTF spec says points should be 1px + + this.cache.add( cacheKey, pointsMaterial ); + + } + + material = pointsMaterial; + + } else if ( mesh.isLine ) { + + const cacheKey = 'LineBasicMaterial:' + material.uuid; + + let lineMaterial = this.cache.get( cacheKey ); + + if ( ! lineMaterial ) { + + lineMaterial = new three__WEBPACK_IMPORTED_MODULE_0__.LineBasicMaterial(); + three__WEBPACK_IMPORTED_MODULE_0__.Material.prototype.copy.call( lineMaterial, material ); + lineMaterial.color.copy( material.color ); + + this.cache.add( cacheKey, lineMaterial ); + + } + + material = lineMaterial; + + } + + // Clone the material if it will be modified + if ( useDerivativeTangents || useVertexColors || useFlatShading ) { + + let cacheKey = 'ClonedMaterial:' + material.uuid + ':'; + + if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:'; + if ( useDerivativeTangents ) cacheKey += 'derivative-tangents:'; + if ( useVertexColors ) cacheKey += 'vertex-colors:'; + if ( useFlatShading ) cacheKey += 'flat-shading:'; + + let cachedMaterial = this.cache.get( cacheKey ); + + if ( ! cachedMaterial ) { + + cachedMaterial = material.clone(); + + if ( useVertexColors ) cachedMaterial.vertexColors = true; + if ( useFlatShading ) cachedMaterial.flatShading = true; + + if ( useDerivativeTangents ) { + + // https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995 + if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1; + if ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1; + + } + + this.cache.add( cacheKey, cachedMaterial ); + + this.associations.set( cachedMaterial, this.associations.get( material ) ); + + } + + material = cachedMaterial; + + } + + // workarounds for mesh and geometry + + if ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) { + + geometry.setAttribute( 'uv2', geometry.attributes.uv ); + + } + + mesh.material = material; + + } + + getMaterialType( /* materialIndex */ ) { + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshStandardMaterial; + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials + * @param {number} materialIndex + * @return {Promise} + */ + loadMaterial( materialIndex ) { + + const parser = this; + const json = this.json; + const extensions = this.extensions; + const materialDef = json.materials[ materialIndex ]; + + let materialType; + const materialParams = {}; + const materialExtensions = materialDef.extensions || {}; + + const pending = []; + + if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) { + + const sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ]; + materialType = sgExtension.getMaterialType(); + pending.push( sgExtension.extendParams( materialParams, materialDef, parser ) ); + + } else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) { + + const kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ]; + materialType = kmuExtension.getMaterialType(); + pending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) ); + + } else { + + // Specification: + // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material + + const metallicRoughness = materialDef.pbrMetallicRoughness || {}; + + materialParams.color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); + materialParams.opacity = 1.0; + + if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { + + const array = metallicRoughness.baseColorFactor; + + materialParams.color.fromArray( array ); + materialParams.opacity = array[ 3 ]; + + } + + if ( metallicRoughness.baseColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) ); + + } + + materialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0; + materialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0; + + if ( metallicRoughness.metallicRoughnessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture ) ); + pending.push( parser.assignTexture( materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture ) ); + + } + + materialType = this._invokeOne( function ( ext ) { + + return ext.getMaterialType && ext.getMaterialType( materialIndex ); + + } ); + + pending.push( Promise.all( this._invokeAll( function ( ext ) { + + return ext.extendMaterialParams && ext.extendMaterialParams( materialIndex, materialParams ); + + } ) ) ); + + } + + if ( materialDef.doubleSided === true ) { + + materialParams.side = three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide; + + } + + const alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE; + + if ( alphaMode === ALPHA_MODES.BLEND ) { + + materialParams.transparent = true; + + // See: https://github.com/mrdoob/three.js/issues/17706 + materialParams.depthWrite = false; + + } else { + + materialParams.format = three__WEBPACK_IMPORTED_MODULE_0__.RGBFormat; + materialParams.transparent = false; + + if ( alphaMode === ALPHA_MODES.MASK ) { + + materialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5; + + } + + } + + if ( materialDef.normalTexture !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) ); + + materialParams.normalScale = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2( 1, 1 ); + + if ( materialDef.normalTexture.scale !== undefined ) { + + const scale = materialDef.normalTexture.scale; + + materialParams.normalScale.set( scale, scale ); + + } + + } + + if ( materialDef.occlusionTexture !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture ) ); + + if ( materialDef.occlusionTexture.strength !== undefined ) { + + materialParams.aoMapIntensity = materialDef.occlusionTexture.strength; + + } + + } + + if ( materialDef.emissiveFactor !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { + + materialParams.emissive = new three__WEBPACK_IMPORTED_MODULE_0__.Color().fromArray( materialDef.emissiveFactor ); + + } + + if ( materialDef.emissiveTexture !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { + + pending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture ) ); + + } + + return Promise.all( pending ).then( function () { + + let material; + + if ( materialType === GLTFMeshStandardSGMaterial ) { + + material = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams ); + + } else { + + material = new materialType( materialParams ); + + } + + if ( materialDef.name ) material.name = materialDef.name; + + // baseColorTexture, emissiveTexture, and specularGlossinessTexture use sRGB encoding. + if ( material.map ) material.map.encoding = three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding; + if ( material.emissiveMap ) material.emissiveMap.encoding = three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding; + + assignExtrasToUserData( material, materialDef ); + + parser.associations.set( material, { materials: materialIndex } ); + + if ( materialDef.extensions ) addUnknownExtensionsToUserData( extensions, material, materialDef ); + + return material; + + } ); + + } + + /** When Object3D instances are targeted by animation, they need unique names. */ + createUniqueName( originalName ) { + + const sanitizedName = three__WEBPACK_IMPORTED_MODULE_0__.PropertyBinding.sanitizeNodeName( originalName || '' ); + + let name = sanitizedName; + + for ( let i = 1; this.nodeNamesUsed[ name ]; ++ i ) { + + name = sanitizedName + '_' + i; + + } + + this.nodeNamesUsed[ name ] = true; + + return name; + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry + * + * Creates BufferGeometries from primitives. + * + * @param {Array} primitives + * @return {Promise>} + */ + loadGeometries( primitives ) { + + const parser = this; + const extensions = this.extensions; + const cache = this.primitiveCache; + + function createDracoPrimitive( primitive ) { + + return extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] + .decodePrimitive( primitive, parser ) + .then( function ( geometry ) { + + return addPrimitiveAttributes( geometry, primitive, parser ); + + } ); + + } + + const pending = []; + + for ( let i = 0, il = primitives.length; i < il; i ++ ) { + + const primitive = primitives[ i ]; + const cacheKey = createPrimitiveKey( primitive ); + + // See if we've already created this geometry + const cached = cache[ cacheKey ]; + + if ( cached ) { + + // Use the cached geometry if it exists + pending.push( cached.promise ); + + } else { + + let geometryPromise; + + if ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) { + + // Use DRACO geometry if available + geometryPromise = createDracoPrimitive( primitive ); + + } else { + + // Otherwise create a new geometry + geometryPromise = addPrimitiveAttributes( new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry(), primitive, parser ); + + } + + // Cache this geometry + cache[ cacheKey ] = { primitive: primitive, promise: geometryPromise }; + + pending.push( geometryPromise ); + + } + + } + + return Promise.all( pending ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes + * @param {number} meshIndex + * @return {Promise} + */ + loadMesh( meshIndex ) { + + const parser = this; + const json = this.json; + const extensions = this.extensions; + + const meshDef = json.meshes[ meshIndex ]; + const primitives = meshDef.primitives; + + const pending = []; + + for ( let i = 0, il = primitives.length; i < il; i ++ ) { + + const material = primitives[ i ].material === undefined + ? createDefaultMaterial( this.cache ) + : this.getDependency( 'material', primitives[ i ].material ); + + pending.push( material ); + + } + + pending.push( parser.loadGeometries( primitives ) ); + + return Promise.all( pending ).then( function ( results ) { + + const materials = results.slice( 0, results.length - 1 ); + const geometries = results[ results.length - 1 ]; + + const meshes = []; + + for ( let i = 0, il = geometries.length; i < il; i ++ ) { + + const geometry = geometries[ i ]; + const primitive = primitives[ i ]; + + // 1. create Mesh + + let mesh; + + const material = materials[ i ]; + + if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || + primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || + primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || + primitive.mode === undefined ) { + + // .isSkinnedMesh isn't in glTF spec. See ._markDefs() + mesh = meshDef.isSkinnedMesh === true + ? new three__WEBPACK_IMPORTED_MODULE_0__.SkinnedMesh( geometry, material ) + : new three__WEBPACK_IMPORTED_MODULE_0__.Mesh( geometry, material ); + + if ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) { + + // we normalize floating point skin weight array to fix malformed assets (see #15319) + // it's important to skip this for non-float32 data since normalizeSkinWeights assumes non-normalized inputs + mesh.normalizeSkinWeights(); + + } + + if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) { + + mesh.geometry = toTrianglesDrawMode( mesh.geometry, three__WEBPACK_IMPORTED_MODULE_0__.TriangleStripDrawMode ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) { + + mesh.geometry = toTrianglesDrawMode( mesh.geometry, three__WEBPACK_IMPORTED_MODULE_0__.TriangleFanDrawMode ); + + } + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) { + + mesh = new three__WEBPACK_IMPORTED_MODULE_0__.LineSegments( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) { + + mesh = new three__WEBPACK_IMPORTED_MODULE_0__.Line( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) { + + mesh = new three__WEBPACK_IMPORTED_MODULE_0__.LineLoop( geometry, material ); + + } else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) { + + mesh = new three__WEBPACK_IMPORTED_MODULE_0__.Points( geometry, material ); + + } else { + + throw new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode ); + + } + + if ( Object.keys( mesh.geometry.morphAttributes ).length > 0 ) { + + updateMorphTargets( mesh, meshDef ); + + } + + mesh.name = parser.createUniqueName( meshDef.name || ( 'mesh_' + meshIndex ) ); + + assignExtrasToUserData( mesh, meshDef ); + + if ( primitive.extensions ) addUnknownExtensionsToUserData( extensions, mesh, primitive ); + + parser.assignFinalMaterial( mesh ); + + meshes.push( mesh ); + + } + + for ( let i = 0, il = meshes.length; i < il; i ++ ) { + + parser.associations.set( meshes[ i ], { + meshes: meshIndex, + primitives: i + } ); + + } + + if ( meshes.length === 1 ) { + + return meshes[ 0 ]; + + } + + const group = new three__WEBPACK_IMPORTED_MODULE_0__.Group(); + + parser.associations.set( group, { meshes: meshIndex } ); + + for ( let i = 0, il = meshes.length; i < il; i ++ ) { + + group.add( meshes[ i ] ); + + } + + return group; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras + * @param {number} cameraIndex + * @return {Promise} + */ + loadCamera( cameraIndex ) { + + let camera; + const cameraDef = this.json.cameras[ cameraIndex ]; + const params = cameraDef[ cameraDef.type ]; + + if ( ! params ) { + + console.warn( 'THREE.GLTFLoader: Missing camera parameters.' ); + return; + + } + + if ( cameraDef.type === 'perspective' ) { + + camera = new three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera( three__WEBPACK_IMPORTED_MODULE_0__.MathUtils.radToDeg( params.yfov ), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6 ); + + } else if ( cameraDef.type === 'orthographic' ) { + + camera = new three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera( - params.xmag, params.xmag, params.ymag, - params.ymag, params.znear, params.zfar ); + + } + + if ( cameraDef.name ) camera.name = this.createUniqueName( cameraDef.name ); + + assignExtrasToUserData( camera, cameraDef ); + + return Promise.resolve( camera ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins + * @param {number} skinIndex + * @return {Promise} + */ + loadSkin( skinIndex ) { + + const skinDef = this.json.skins[ skinIndex ]; + + const skinEntry = { joints: skinDef.joints }; + + if ( skinDef.inverseBindMatrices === undefined ) { + + return Promise.resolve( skinEntry ); + + } + + return this.getDependency( 'accessor', skinDef.inverseBindMatrices ).then( function ( accessor ) { + + skinEntry.inverseBindMatrices = accessor; + + return skinEntry; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations + * @param {number} animationIndex + * @return {Promise} + */ + loadAnimation( animationIndex ) { + + const json = this.json; + + const animationDef = json.animations[ animationIndex ]; + + const pendingNodes = []; + const pendingInputAccessors = []; + const pendingOutputAccessors = []; + const pendingSamplers = []; + const pendingTargets = []; + + for ( let i = 0, il = animationDef.channels.length; i < il; i ++ ) { + + const channel = animationDef.channels[ i ]; + const sampler = animationDef.samplers[ channel.sampler ]; + const target = channel.target; + const name = target.node !== undefined ? target.node : target.id; // NOTE: target.id is deprecated. + const input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input; + const output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output; + + pendingNodes.push( this.getDependency( 'node', name ) ); + pendingInputAccessors.push( this.getDependency( 'accessor', input ) ); + pendingOutputAccessors.push( this.getDependency( 'accessor', output ) ); + pendingSamplers.push( sampler ); + pendingTargets.push( target ); + + } + + return Promise.all( [ + + Promise.all( pendingNodes ), + Promise.all( pendingInputAccessors ), + Promise.all( pendingOutputAccessors ), + Promise.all( pendingSamplers ), + Promise.all( pendingTargets ) + + ] ).then( function ( dependencies ) { + + const nodes = dependencies[ 0 ]; + const inputAccessors = dependencies[ 1 ]; + const outputAccessors = dependencies[ 2 ]; + const samplers = dependencies[ 3 ]; + const targets = dependencies[ 4 ]; + + const tracks = []; + + for ( let i = 0, il = nodes.length; i < il; i ++ ) { + + const node = nodes[ i ]; + const inputAccessor = inputAccessors[ i ]; + const outputAccessor = outputAccessors[ i ]; + const sampler = samplers[ i ]; + const target = targets[ i ]; + + if ( node === undefined ) continue; + + node.updateMatrix(); + node.matrixAutoUpdate = true; + + let TypedKeyframeTrack; + + switch ( PATH_PROPERTIES[ target.path ] ) { + + case PATH_PROPERTIES.weights: + + TypedKeyframeTrack = three__WEBPACK_IMPORTED_MODULE_0__.NumberKeyframeTrack; + break; + + case PATH_PROPERTIES.rotation: + + TypedKeyframeTrack = three__WEBPACK_IMPORTED_MODULE_0__.QuaternionKeyframeTrack; + break; + + case PATH_PROPERTIES.position: + case PATH_PROPERTIES.scale: + default: + + TypedKeyframeTrack = three__WEBPACK_IMPORTED_MODULE_0__.VectorKeyframeTrack; + break; + + } + + const targetName = node.name ? node.name : node.uuid; + + const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : three__WEBPACK_IMPORTED_MODULE_0__.InterpolateLinear; + + const targetNames = []; + + if ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) { + + // Node may be a Group (glTF mesh with several primitives) or a Mesh. + node.traverse( function ( object ) { + + if ( object.isMesh === true && object.morphTargetInfluences ) { + + targetNames.push( object.name ? object.name : object.uuid ); + + } + + } ); + + } else { + + targetNames.push( targetName ); + + } + + let outputArray = outputAccessor.array; + + if ( outputAccessor.normalized ) { + + const scale = getNormalizedComponentScale( outputArray.constructor ); + const scaled = new Float32Array( outputArray.length ); + + for ( let j = 0, jl = outputArray.length; j < jl; j ++ ) { + + scaled[ j ] = outputArray[ j ] * scale; + + } + + outputArray = scaled; + + } + + for ( let j = 0, jl = targetNames.length; j < jl; j ++ ) { + + const track = new TypedKeyframeTrack( + targetNames[ j ] + '.' + PATH_PROPERTIES[ target.path ], + inputAccessor.array, + outputArray, + interpolation + ); + + // Override interpolation with custom factory method. + if ( sampler.interpolation === 'CUBICSPLINE' ) { + + track.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline( result ) { + + // A CUBICSPLINE keyframe in glTF has three output values for each input value, + // representing inTangent, splineVertex, and outTangent. As a result, track.getValueSize() + // must be divided by three to get the interpolant's sampleSize argument. + + const interpolantType = ( this instanceof three__WEBPACK_IMPORTED_MODULE_0__.QuaternionKeyframeTrack ) ? GLTFCubicSplineQuaternionInterpolant : GLTFCubicSplineInterpolant; + + return new interpolantType( this.times, this.values, this.getValueSize() / 3, result ); + + }; + + // Mark as CUBICSPLINE. `track.getInterpolation()` doesn't support custom interpolants. + track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true; + + } + + tracks.push( track ); + + } + + } + + const name = animationDef.name ? animationDef.name : 'animation_' + animationIndex; + + return new three__WEBPACK_IMPORTED_MODULE_0__.AnimationClip( name, undefined, tracks ); + + } ); + + } + + createNodeMesh( nodeIndex ) { + + const json = this.json; + const parser = this; + const nodeDef = json.nodes[ nodeIndex ]; + + if ( nodeDef.mesh === undefined ) return null; + + return parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) { + + const node = parser._getNodeRef( parser.meshCache, nodeDef.mesh, mesh ); + + // if weights are provided on the node, override weights on the mesh. + if ( nodeDef.weights !== undefined ) { + + node.traverse( function ( o ) { + + if ( ! o.isMesh ) return; + + for ( let i = 0, il = nodeDef.weights.length; i < il; i ++ ) { + + o.morphTargetInfluences[ i ] = nodeDef.weights[ i ]; + + } + + } ); + + } + + return node; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy + * @param {number} nodeIndex + * @return {Promise} + */ + loadNode( nodeIndex ) { + + const json = this.json; + const extensions = this.extensions; + const parser = this; + + const nodeDef = json.nodes[ nodeIndex ]; + + // reserve node's name before its dependencies, so the root has the intended name. + const nodeName = nodeDef.name ? parser.createUniqueName( nodeDef.name ) : ''; + + return ( function () { + + const pending = []; + + const meshPromise = parser._invokeOne( function ( ext ) { + + return ext.createNodeMesh && ext.createNodeMesh( nodeIndex ); + + } ); + + if ( meshPromise ) { + + pending.push( meshPromise ); + + } + + if ( nodeDef.camera !== undefined ) { + + pending.push( parser.getDependency( 'camera', nodeDef.camera ).then( function ( camera ) { + + return parser._getNodeRef( parser.cameraCache, nodeDef.camera, camera ); + + } ) ); + + } + + parser._invokeAll( function ( ext ) { + + return ext.createNodeAttachment && ext.createNodeAttachment( nodeIndex ); + + } ).forEach( function ( promise ) { + + pending.push( promise ); + + } ); + + return Promise.all( pending ); + + }() ).then( function ( objects ) { + + let node; + + // .isBone isn't in glTF spec. See ._markDefs + if ( nodeDef.isBone === true ) { + + node = new three__WEBPACK_IMPORTED_MODULE_0__.Bone(); + + } else if ( objects.length > 1 ) { + + node = new three__WEBPACK_IMPORTED_MODULE_0__.Group(); + + } else if ( objects.length === 1 ) { + + node = objects[ 0 ]; + + } else { + + node = new three__WEBPACK_IMPORTED_MODULE_0__.Object3D(); + + } + + if ( node !== objects[ 0 ] ) { + + for ( let i = 0, il = objects.length; i < il; i ++ ) { + + node.add( objects[ i ] ); + + } + + } + + if ( nodeDef.name ) { + + node.userData.name = nodeDef.name; + node.name = nodeName; + + } + + assignExtrasToUserData( node, nodeDef ); + + if ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef ); + + if ( nodeDef.matrix !== undefined ) { + + const matrix = new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4(); + matrix.fromArray( nodeDef.matrix ); + node.applyMatrix4( matrix ); + + } else { + + if ( nodeDef.translation !== undefined ) { + + node.position.fromArray( nodeDef.translation ); + + } + + if ( nodeDef.rotation !== undefined ) { + + node.quaternion.fromArray( nodeDef.rotation ); + + } + + if ( nodeDef.scale !== undefined ) { + + node.scale.fromArray( nodeDef.scale ); + + } + + } + + if ( ! parser.associations.has( node ) ) { + + parser.associations.set( node, {} ); + + } + + parser.associations.get( node ).nodes = nodeIndex; + + return node; + + } ); + + } + + /** + * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes + * @param {number} sceneIndex + * @return {Promise} + */ + loadScene( sceneIndex ) { + + const json = this.json; + const extensions = this.extensions; + const sceneDef = this.json.scenes[ sceneIndex ]; + const parser = this; + + // Loader returns Group, not Scene. + // See: https://github.com/mrdoob/three.js/issues/18342#issuecomment-578981172 + const scene = new three__WEBPACK_IMPORTED_MODULE_0__.Group(); + if ( sceneDef.name ) scene.name = parser.createUniqueName( sceneDef.name ); + + assignExtrasToUserData( scene, sceneDef ); + + if ( sceneDef.extensions ) addUnknownExtensionsToUserData( extensions, scene, sceneDef ); + + const nodeIds = sceneDef.nodes || []; + + const pending = []; + + for ( let i = 0, il = nodeIds.length; i < il; i ++ ) { + + pending.push( buildNodeHierarchy( nodeIds[ i ], scene, json, parser ) ); + + } + + return Promise.all( pending ).then( function () { + + // Removes dangling associations, associations that reference a node that + // didn't make it into the scene. + const reduceAssociations = ( node ) => { + + const reducedAssociations = new Map(); + + for ( const [ key, value ] of parser.associations ) { + + if ( key instanceof three__WEBPACK_IMPORTED_MODULE_0__.Material || key instanceof three__WEBPACK_IMPORTED_MODULE_0__.Texture ) { + + reducedAssociations.set( key, value ); + + } + + } + + node.traverse( ( node ) => { + + const mappings = parser.associations.get( node ); + + if ( mappings != null ) { + + reducedAssociations.set( node, mappings ); + + } + + } ); + + return reducedAssociations; + + }; + + parser.associations = reduceAssociations( scene ); + + return scene; + + } ); + + } + +} + +function buildNodeHierarchy( nodeId, parentObject, json, parser ) { + + const nodeDef = json.nodes[ nodeId ]; + + return parser.getDependency( 'node', nodeId ).then( function ( node ) { + + if ( nodeDef.skin === undefined ) return node; + + // build skeleton here as well + + let skinEntry; + + return parser.getDependency( 'skin', nodeDef.skin ).then( function ( skin ) { + + skinEntry = skin; + + const pendingJoints = []; + + for ( let i = 0, il = skinEntry.joints.length; i < il; i ++ ) { + + pendingJoints.push( parser.getDependency( 'node', skinEntry.joints[ i ] ) ); + + } + + return Promise.all( pendingJoints ); + + } ).then( function ( jointNodes ) { + + node.traverse( function ( mesh ) { + + if ( ! mesh.isMesh ) return; + + const bones = []; + const boneInverses = []; + + for ( let j = 0, jl = jointNodes.length; j < jl; j ++ ) { + + const jointNode = jointNodes[ j ]; + + if ( jointNode ) { + + bones.push( jointNode ); + + const mat = new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4(); + + if ( skinEntry.inverseBindMatrices !== undefined ) { + + mat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 ); + + } + + boneInverses.push( mat ); + + } else { + + console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', skinEntry.joints[ j ] ); + + } + + } + + mesh.bind( new three__WEBPACK_IMPORTED_MODULE_0__.Skeleton( bones, boneInverses ), mesh.matrixWorld ); + + } ); + + return node; + + } ); + + } ).then( function ( node ) { + + // build node hierachy + + parentObject.add( node ); + + const pending = []; + + if ( nodeDef.children ) { + + const children = nodeDef.children; + + for ( let i = 0, il = children.length; i < il; i ++ ) { + + const child = children[ i ]; + pending.push( buildNodeHierarchy( child, node, json, parser ) ); + + } + + } + + return Promise.all( pending ); + + } ); + +} + +/** + * @param {BufferGeometry} geometry + * @param {GLTF.Primitive} primitiveDef + * @param {GLTFParser} parser + */ +function computeBounds( geometry, primitiveDef, parser ) { + + const attributes = primitiveDef.attributes; + + const box = new three__WEBPACK_IMPORTED_MODULE_0__.Box3(); + + if ( attributes.POSITION !== undefined ) { + + const accessor = parser.json.accessors[ attributes.POSITION ]; + + const min = accessor.min; + const max = accessor.max; + + // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement. + + if ( min !== undefined && max !== undefined ) { + + box.set( + new three__WEBPACK_IMPORTED_MODULE_0__.Vector3( min[ 0 ], min[ 1 ], min[ 2 ] ), + new three__WEBPACK_IMPORTED_MODULE_0__.Vector3( max[ 0 ], max[ 1 ], max[ 2 ] ) + ); + + if ( accessor.normalized ) { + + const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] ); + box.min.multiplyScalar( boxScale ); + box.max.multiplyScalar( boxScale ); + + } + + } else { + + console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ); + + return; + + } + + } else { + + return; + + } + + const targets = primitiveDef.targets; + + if ( targets !== undefined ) { + + const maxDisplacement = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(); + const vector = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(); + + for ( let i = 0, il = targets.length; i < il; i ++ ) { + + const target = targets[ i ]; + + if ( target.POSITION !== undefined ) { + + const accessor = parser.json.accessors[ target.POSITION ]; + const min = accessor.min; + const max = accessor.max; + + // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement. + + if ( min !== undefined && max !== undefined ) { + + // we need to get max of absolute components because target weight is [-1,1] + vector.setX( Math.max( Math.abs( min[ 0 ] ), Math.abs( max[ 0 ] ) ) ); + vector.setY( Math.max( Math.abs( min[ 1 ] ), Math.abs( max[ 1 ] ) ) ); + vector.setZ( Math.max( Math.abs( min[ 2 ] ), Math.abs( max[ 2 ] ) ) ); + + + if ( accessor.normalized ) { + + const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] ); + vector.multiplyScalar( boxScale ); + + } + + // Note: this assumes that the sum of all weights is at most 1. This isn't quite correct - it's more conservative + // to assume that each target can have a max weight of 1. However, for some use cases - notably, when morph targets + // are used to implement key-frame animations and as such only two are active at a time - this results in very large + // boxes. So for now we make a box that's sometimes a touch too small but is hopefully mostly of reasonable size. + maxDisplacement.max( vector ); + + } else { + + console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ); + + } + + } + + } + + // As per comment above this box isn't conservative, but has a reasonable size for a very large number of morph targets. + box.expandByVector( maxDisplacement ); + + } + + geometry.boundingBox = box; + + const sphere = new three__WEBPACK_IMPORTED_MODULE_0__.Sphere(); + + box.getCenter( sphere.center ); + sphere.radius = box.min.distanceTo( box.max ) / 2; + + geometry.boundingSphere = sphere; + +} + +/** + * @param {BufferGeometry} geometry + * @param {GLTF.Primitive} primitiveDef + * @param {GLTFParser} parser + * @return {Promise} + */ +function addPrimitiveAttributes( geometry, primitiveDef, parser ) { + + const attributes = primitiveDef.attributes; + + const pending = []; + + function assignAttributeAccessor( accessorIndex, attributeName ) { + + return parser.getDependency( 'accessor', accessorIndex ) + .then( function ( accessor ) { + + geometry.setAttribute( attributeName, accessor ); + + } ); + + } + + for ( const gltfAttributeName in attributes ) { + + const threeAttributeName = ATTRIBUTES[ gltfAttributeName ] || gltfAttributeName.toLowerCase(); + + // Skip attributes already provided by e.g. Draco extension. + if ( threeAttributeName in geometry.attributes ) continue; + + pending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) ); + + } + + if ( primitiveDef.indices !== undefined && ! geometry.index ) { + + const accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) { + + geometry.setIndex( accessor ); + + } ); + + pending.push( accessor ); + + } + + assignExtrasToUserData( geometry, primitiveDef ); + + computeBounds( geometry, primitiveDef, parser ); + + return Promise.all( pending ).then( function () { + + return primitiveDef.targets !== undefined + ? addMorphTargets( geometry, primitiveDef.targets, parser ) + : geometry; + + } ); + +} + +/** + * @param {BufferGeometry} geometry + * @param {Number} drawMode + * @return {BufferGeometry} + */ +function toTrianglesDrawMode( geometry, drawMode ) { + + let index = geometry.getIndex(); + + // generate index if not present + + if ( index === null ) { + + const indices = []; + + const position = geometry.getAttribute( 'position' ); + + if ( position !== undefined ) { + + for ( let i = 0; i < position.count; i ++ ) { + + indices.push( i ); + + } + + geometry.setIndex( indices ); + index = geometry.getIndex(); + + } else { + + console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' ); + return geometry; + + } + + } + + // + + const numberOfTriangles = index.count - 2; + const newIndices = []; + + if ( drawMode === three__WEBPACK_IMPORTED_MODULE_0__.TriangleFanDrawMode ) { + + // gl.TRIANGLE_FAN + + for ( let i = 1; i <= numberOfTriangles; i ++ ) { + + newIndices.push( index.getX( 0 ) ); + newIndices.push( index.getX( i ) ); + newIndices.push( index.getX( i + 1 ) ); + + } + + } else { + + // gl.TRIANGLE_STRIP + + for ( let i = 0; i < numberOfTriangles; i ++ ) { + + if ( i % 2 === 0 ) { + + newIndices.push( index.getX( i ) ); + newIndices.push( index.getX( i + 1 ) ); + newIndices.push( index.getX( i + 2 ) ); + + + } else { + + newIndices.push( index.getX( i + 2 ) ); + newIndices.push( index.getX( i + 1 ) ); + newIndices.push( index.getX( i ) ); + + } + + } + + } + + if ( ( newIndices.length / 3 ) !== numberOfTriangles ) { + + console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' ); + + } + + // build final geometry + + const newGeometry = geometry.clone(); + newGeometry.setIndex( newIndices ); + + return newGeometry; + +} + + + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!**********************!*\ + !*** ./src/index.ts ***! + \**********************/ +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SceneRendererTJS */ "./src/SceneRendererTJS.ts"); +/* harmony import */ var _markermedia_NFTaddTJS__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./markermedia/NFTaddTJS */ "./src/markermedia/NFTaddTJS.ts"); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + SceneRendererTJS: _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_0__["default"], + NFTaddTJS: _markermedia_NFTaddTJS__WEBPACK_IMPORTED_MODULE_1__["default"] +}); +})(); + +__webpack_exports__ = __webpack_exports__["default"]; +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO0FBQ3BDLFlBQU0sRUFBRSxVQUQ0QjtBQUVwQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FGTztBQUdwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FIUztBQUlwQyx3QkFBa0IsRUFBRSxVQUFVLENBQUMsUUFBWCxDQUFvQixrQkFKSjtBQUtwQyxlQUFTLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsU0FMSztBQU1wQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FOTztBQU9wQyxlQUFTLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsU0FQSztBQVFwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FSUztBQVNwQyw0QkFBc0IsRUFBRSxVQUFVLENBQUMsUUFBWCxDQUFvQjtBQVRSLEtBQXhCLENB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YW5lR2VvbSwgbWF0KTtcbiAgICAgICAgcGxhbmUuc2NhbGUuc2V0KHNjYWxlLCBzY2FsZSwgc2NhbGUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICBwbGFuZS5wb3NpdGlvbi55ID0gKChtc2cuaGVpZ2h0IC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgcGxhbmUucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgcm9vdC5hZGQocGxhbmUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbG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uXHRcdHJldHVybiB0aGlzIHx8IG5ldyBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuXHR9IGNhdGNoIChlKSB7XG5cdFx0aWYgKHR5cGVvZiB3aW5kb3cgPT09ICdvYmplY3QnKSByZXR1cm4gd2luZG93O1xuXHR9XG59KSgpOyIsIl9fd2VicGFja19yZXF1aXJlX18ubyA9IChvYmosIHByb3ApID0+IChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwob2JqLCBwcm9wKSkiLCIvLyBkZWZpbmUgX19lc01vZHVsZSBvbiBleHBvcnRzXG5fX3dlYnBhY2tfcmVxdWlyZV9fLnIgPSAoZXhwb3J0cykgPT4ge1xuXHRpZih0eXBlb2YgU3ltYm9sICE9PSAndW5kZWZpbmVkJyAmJiBTeW1ib2wudG9TdHJpbmdUYWcpIHtcblx0XHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgU3ltYm9sLnRvU3RyaW5nVGFnLCB7IHZhbHVlOiAnTW9kdWxlJyB9KTtcblx0fVxuXHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgJ19fZXNNb2R1bGUnLCB7IHZhbHVlOiB0cnVlIH0pO1xufTsiLCJpbXBvcnQgU2NlbmVSZW5kZXJlclRKUyBmcm9tIFwiLi9TY2VuZVJlbmRlcmVyVEpTXCI7XG5pbXBvcnQgTkZUYWRkVEpTIGZyb20gXCIuL21hcmtlcm1lZGlhL05GVGFkZFRKU1wiO1xuXG5leHBvcnQgZGVmYXVsdCB7IFNjZW5lUmVuZGVyZXJUSlMsIE5GVGFkZFRKUyB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/src/filters/ARnftFilter.ts b/src/filters/ARnftFilter.ts new file mode 100644 index 0000000..ffc9e24 --- /dev/null +++ b/src/filters/ARnftFilter.ts @@ -0,0 +1,126 @@ +import { OneEuroFilterVector3 } from "./OneEuroFilter"; +import { DelayableSignalFilter } from "./DelayableSignalFilter"; +import { Euler, Matrix4, Quaternion, Vector3 } from "three"; + +export class ARnftFilter { + private delayExitCheck: DelayableSignalFilter; + + private delayEnterCheck: DelayableSignalFilter; + + private _hasFound: boolean = false; + + // private _interpolationFactor: number = 15; + + private _lastTranslation: Vector3; + + private _frameDrops: number = 0; + + private _deltaAccuracy: number = 10; + + private _positionFilter: OneEuroFilterVector3; + + private _rotationFilter: OneEuroFilterVector3; + + public filterFrequency: number = 30.0; + public filterMinCutoff: number = 1.0; + public filterBeta: number = 0.0; + public filterDcutoff: number = 1.0; + + constructor() { + this.delayEnterCheck = new DelayableSignalFilter(2); + this.delayExitCheck = new DelayableSignalFilter(0); + + this._positionFilter = new OneEuroFilterVector3(this.filterFrequency); + this._rotationFilter = new OneEuroFilterVector3(this.filterFrequency * 2); + } + + public update(world: any): Vector3 { + if (!world) { + this._hasFound = false; + this._frameDrops = 0; + } else { + console.log('inside loop'); + + //let worldMatrix: Matrix = Matrix.FromArray(this.getArrayMatrix(this.world)); + let matrixW: Matrix4 = new Matrix4(); + let worldMatrix: Matrix4 = matrixW.fromArray(this.getArrayMatrix(world)); + + + if (!this._hasFound) { + // for (var i = 0; i < 16; i++) { + // this.trackedMatrix.interpolated[i] = this.world[i]; + // } + this._hasFound = true; + let vecTrans: Vector3 = new Vector3() + ///this._lastTranslation = worldMatrix.getTranslation(); // Babylon code... + this._lastTranslation = vecTrans.setFromMatrixPosition(worldMatrix) + } + else { + let vecTrans: Vector3 = new Vector3() + //let _currentTranslation: Vector3 = worldMatrix.getTranslation(); // Babylon code... + let _currentTranslation: Vector3 = vecTrans.setFromMatrixPosition(worldMatrix) + + //if (Math.abs(Vector3.Distance(_currentTranslation, this._lastTranslation)) > this._deltaAccuracy) { //Babylon code... + if (Math.abs(_currentTranslation.distanceTo(this._lastTranslation)) > this._deltaAccuracy) { + this._frameDrops += 1; + if (this._frameDrops > 3) { + this._lastTranslation = _currentTranslation; + } + return; + } + this._frameDrops = 0; + this._lastTranslation = _currentTranslation; + // for (var i = 0; i < 16; i++) { + // this.trackedMatrix.delta[i] = this.world[i] - this.trackedMatrix.interpolated[i]; + // this.trackedMatrix.interpolated[i] = this.trackedMatrix.interpolated[i] + (this.trackedMatrix.delta[i] / this._interpolationFactor); + // } + } + // let matrix: Matrix = Matrix.FromArray(this.getArrayMatrix(this.world)); + + this._positionFilter.UpdateParams(this.filterFrequency, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); + this._rotationFilter.UpdateParams(this.filterFrequency * 2, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); + + //let matrix: Matrix = worldMatrix; //Babylon code... + let matrix: Matrix4 = worldMatrix; + + + //let rotMatrix: Matrix = matrix.getRotationMatrix(); + let rotMatrix: Matrix4 = new Matrix4(); + rotMatrix.extractRotation(matrix); + //let rotation: Quaternion = new Quaternion().setFromRotationMatrix(rotMatrix); //this is wrong , will do nothing! + let rotation: Quaternion = new Quaternion() + ///this._root.rotation = this._rotationFilter.Filter(rotation.toEulerAngles()); // Babylon code + let rotationVec: Vector3 = new Vector3(); + let eulerRot: Euler = new Euler(); + //eulerRot.setFromQuaternion(rotation) + //rotationVec = this._rotationFilter.Filter(rotation.toEulerAngles()); // Babylon code + //rotationVec = this._rotationFilter.Filter(eulerRot.toVector3()); + + // or even simple decompose the worldMatrix into position, quaternion and scale with decompose + let position: Vector3 = new Vector3(); + let scale: Vector3 = new Vector3(); + worldMatrix.decompose(position, rotation, scale) + let eRot = eulerRot.setFromQuaternion(rotation) + rotationVec = this._rotationFilter.Filter(eRot.toVector3()); + + //let pos = Vector3.TransformCoordinates(new Vector3(0, 0, 0), matrix); + + //this._root.setAbsolutePosition(this._positionFilter.Filter(position)); + let pos = this._positionFilter.Filter(position) + /*let out: Matrix4 = new Matrix4(); + let rotationMatrix = new Matrix4(); + //rotationMatrix.makeRotationFromQuaternion() + let finalRot = new Quaternion(); + finalRot.setFromRotationMatrix(rotationMatrix)*/ + //out.compose(pos, ) /// will see if output the matrix in a future... + return pos + } + } + protected getArrayMatrix(value: any): any { + var array: any = []; + for (var key in value) { + array[key] = value[key]; //.toFixed(4); + } + return array; + } +} \ No newline at end of file diff --git a/src/filters/DelayableSignalFilter.ts b/src/filters/DelayableSignalFilter.ts new file mode 100644 index 0000000..07989be --- /dev/null +++ b/src/filters/DelayableSignalFilter.ts @@ -0,0 +1,40 @@ +import { getTime } from "../utils/Utils"; + +export class DelayableSignalFilter { + + private _inDelay: boolean; + private _totalTime: number; + private _prevTime: number; + + private _timeOut: number; + + constructor(timeOut: number) { + this._timeOut = timeOut; + this._inDelay = false; + } + + public Update(tick: boolean): boolean { + let time: number = getTime(); + + if (!this._inDelay) { + this._prevTime = time; + this._totalTime = 0; + } + + this._totalTime += time - this._prevTime; + + if (this._inDelay && this._totalTime > this._timeOut) { + this._inDelay = false; + return true; + } + + if (tick) { + this._inDelay = true; + return false; + } + this._inDelay = false; + + return false; + } + +} \ No newline at end of file diff --git a/src/filters/OneEuroFilter.ts b/src/filters/OneEuroFilter.ts new file mode 100644 index 0000000..91df8a3 --- /dev/null +++ b/src/filters/OneEuroFilter.ts @@ -0,0 +1,194 @@ +import { Vector3 } from "three"; + +//https://github.com/DarioMazzanti/OneEuroFilterUnity/blob/master/Assets/Scripts/OneEuroFilter.cs +//https://github.com/DarioMazzanti/OneEuroFilterUnity/blob/master/Assets/Scripts/FilterTestVector3.cs +//https://gist.github.com/ThorstenBux/323183bb0bc2ccb92ff23ebdf3de6408 + +/* eslint-disable max-classes-per-file */ +class LowPassFilter { + y: number | null; + + s: number | null; + + alpha = 0; + + constructor(alpha: number) { + this.setAlpha(alpha); + this.y = null; + this.s = null; + } + + setAlpha(alpha: number) { + if (alpha <= 0 || alpha > 1.0) { + throw new Error(); + } + this.alpha = alpha; + } + + filter(value: number, timestamp: number, alpha: number) { + if (alpha) { + this.setAlpha(alpha); + } + let s; + if (!this.y) { + s = value; + } else { + s = this.alpha * value + (1.0 - this.alpha) * this.s!; + } + this.y = value; + this.s = s; + return s; + } + + lastValue() { + return this.y; + } +} + +export default class OneEuroFilter { + freq: number; + + minCutOff: number; + + beta: number; + + dCutOff: number; + + x: LowPassFilter; + + dx: LowPassFilter; + + lasttime: number | null; + + public currValue: number; + public prevValue: number; + + constructor(freq: number, minCutOff = 1.0, beta = 0.0, dCutOff = 1.0) { + if (freq <= 0 || minCutOff <= 0 || dCutOff <= 0) { + throw new Error(); + } + this.freq = freq; + this.minCutOff = minCutOff; + this.beta = beta; + this.dCutOff = dCutOff; + this.x = new LowPassFilter(this.alpha(this.minCutOff)); + this.dx = new LowPassFilter(this.alpha(this.dCutOff)); + this.lasttime = null; + + this.currValue = 0.0; + this.prevValue = this.currValue; + } + + public alpha(cutOff: number) { + const te = 1.0 / this.freq; + const tau = 1.0 / (2 * Math.PI * cutOff); + return 1.0 / (1.0 + tau / te); + } + + public UpdateParams(_freq: number, _mincutoff: number = 1.0, _beta: number = 0, _dcutoff: number = 1): void { + this.freq = _freq; + this.minCutOff = _mincutoff; + this.beta = _beta; + this.dCutOff = _dcutoff; + this.x.setAlpha(this.alpha(this.minCutOff)); + this.dx.setAlpha(this.alpha(this.dCutOff)); + } + + public Filter(x: number, timestamp: number | null = null): number { + + this.prevValue = this.currValue; + if (this.lasttime && timestamp) { + this.freq = 1.0 / (timestamp - this.lasttime); + } + this.lasttime = timestamp; + const prevX = this.x.lastValue(); + const dx = !prevX ? 0.0 : (x - prevX) * this.freq; + const edx = this.dx.filter(dx, timestamp!, this.alpha(this.dCutOff)); + const cutOff = this.minCutOff + this.beta * Math.abs(edx); + return this.currValue = this.x.filter(x, timestamp!, this.alpha(cutOff)); + } +} + +export class OneEuroFilterVector3 { + + // containst the type of T + // the array of filters + private oneEuroFilters: Array; + + private _freq: number; + public get freq(): number { + return this._freq; + } + + private _beta: number; + public get beta(): number { + return this._beta; + } + + private _dcutoff: number; + public get dcutoff(): number { + return this._dcutoff; + } + private _mincutoff: number; + public get mincutoff_1(): number { + return this._mincutoff; + } + + + // currValue contains the latest value which have been succesfully filtered + // prevValue contains the previous filtered value + + private currValue: Vector3; + private prevValue: Vector3; + + // initialization of our filter(s) + constructor(_freq: number, _mincutoff: number = 1, _beta: number = 0, _dcutoff: number = 1) { + + + this.currValue = new Vector3(); + this.prevValue = new Vector3(); + + this._freq = _freq; + this._mincutoff = _mincutoff; + this._beta = _beta; + this._dcutoff = _dcutoff; + + this.oneEuroFilters = []; + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)) + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)) + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)) + } + + // updates the filter parameters + public UpdateParams(_freq: number, _mincutoff: number = 1.0, _beta: number = 0, _dcutoff: number = 1): void { + this._freq = _freq; + this._mincutoff = _mincutoff; + this._beta = _beta; + this._dcutoff = _dcutoff; + + for (let i: number = 0; i < this.oneEuroFilters.length; i++) + this.oneEuroFilters[i].UpdateParams(this._freq, this._mincutoff, this._beta, this._dcutoff); + } + + + // filters the provided _value and returns the result. + // Note: a timestamp can also be provided - will override filter frequency. + public Filter(_value: Vector3, timestamp: number = -1.0): Vector3 { + this.prevValue = this.currValue; + + //let output: number[] = Vector3.ZeroReadOnly.asArray(); // Babylon code... + let out: Vector3 = new Vector3(); + let output: number[] = out.toArray(); + + //let input: number[] = _value.asArray(); // Babylon code + let input: number[] = _value.toArray(); + + this.oneEuroFilters.forEach((filters, idx) => { + output[idx] = filters.Filter(input[idx], timestamp); + }) + + let arr: Vector3 = new Vector3(); + + return this.currValue = arr.fromArray(output); + } +} \ No newline at end of file diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 45511f9..6678a29 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -1,3 +1,6 @@ +export function getTime(): number { + return Math.floor(Date.now() / 1000); +} export class Utils { private static trackedMatrix: any = { // for interpolation diff --git a/types/filters/ARnftFilter.d.ts b/types/filters/ARnftFilter.d.ts new file mode 100644 index 0000000..5fc84fb --- /dev/null +++ b/types/filters/ARnftFilter.d.ts @@ -0,0 +1,18 @@ +import { Vector3 } from "three"; +export declare class ARnftFilter { + private delayExitCheck; + private delayEnterCheck; + private _hasFound; + private _lastTranslation; + private _frameDrops; + private _deltaAccuracy; + private _positionFilter; + private _rotationFilter; + filterFrequency: number; + filterMinCutoff: number; + filterBeta: number; + filterDcutoff: number; + constructor(); + update(world: any): Vector3; + protected getArrayMatrix(value: any): any; +} diff --git a/types/filters/DelayableSignalFilter.d.ts b/types/filters/DelayableSignalFilter.d.ts new file mode 100644 index 0000000..d33eb15 --- /dev/null +++ b/types/filters/DelayableSignalFilter.d.ts @@ -0,0 +1,8 @@ +export declare class DelayableSignalFilter { + private _inDelay; + private _totalTime; + private _prevTime; + private _timeOut; + constructor(timeOut: number); + Update(tick: boolean): boolean; +} diff --git a/types/filters/OneEuroFilter.d.ts b/types/filters/OneEuroFilter.d.ts new file mode 100644 index 0000000..139fa50 --- /dev/null +++ b/types/filters/OneEuroFilter.d.ts @@ -0,0 +1,42 @@ +import { Vector3 } from "three"; +declare class LowPassFilter { + y: number | null; + s: number | null; + alpha: number; + constructor(alpha: number); + setAlpha(alpha: number): void; + filter(value: number, timestamp: number, alpha: number): number; + lastValue(): number; +} +export default class OneEuroFilter { + freq: number; + minCutOff: number; + beta: number; + dCutOff: number; + x: LowPassFilter; + dx: LowPassFilter; + lasttime: number | null; + currValue: number; + prevValue: number; + constructor(freq: number, minCutOff?: number, beta?: number, dCutOff?: number); + alpha(cutOff: number): number; + UpdateParams(_freq: number, _mincutoff?: number, _beta?: number, _dcutoff?: number): void; + Filter(x: number, timestamp?: number | null): number; +} +export declare class OneEuroFilterVector3 { + private oneEuroFilters; + private _freq; + get freq(): number; + private _beta; + get beta(): number; + private _dcutoff; + get dcutoff(): number; + private _mincutoff; + get mincutoff_1(): number; + private currValue; + private prevValue; + constructor(_freq: number, _mincutoff?: number, _beta?: number, _dcutoff?: number); + UpdateParams(_freq: number, _mincutoff?: number, _beta?: number, _dcutoff?: number): void; + Filter(_value: Vector3, timestamp?: number): Vector3; +} +export {}; diff --git a/types/utils/Utils.d.ts b/types/utils/Utils.d.ts index c6cd46a..fd5f9cf 100644 --- a/types/utils/Utils.d.ts +++ b/types/utils/Utils.d.ts @@ -1,3 +1,4 @@ +export declare function getTime(): number; export declare class Utils { private static trackedMatrix; static interpolate(world: any): any; From 49ef43001967a5bb26e912cb2af48031deb64052 Mon Sep 17 00:00:00 2001 From: kalwalt Date: Tue, 12 Oct 2021 16:43:37 +0200 Subject: [PATCH 02/11] testing with NFTaddTJS --- dist/ARnftThreejs.js | 405 ++++++++++++++++++++++++++++++- src/filters/ARnftFilter.ts | 10 +- src/markermedia/NFTaddTJS.ts | 17 +- types/filters/ARnftFilter.d.ts | 2 +- types/markermedia/NFTaddTJS.d.ts | 1 + 5 files changed, 421 insertions(+), 14 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index dd43957..ee7a83d 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -135,6 +135,389 @@ var SceneRendererTJS = /*#__PURE__*/function () { +/***/ }), + +/***/ "./src/filters/ARnftFilter.ts": +/*!************************************!*\ + !*** ./src/filters/ARnftFilter.ts ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ARnftFilter": () => (/* binding */ ARnftFilter) +/* harmony export */ }); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); +/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); +/* harmony import */ var _OneEuroFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OneEuroFilter */ "./src/filters/OneEuroFilter.ts"); +/* harmony import */ var _DelayableSignalFilter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DelayableSignalFilter */ "./src/filters/DelayableSignalFilter.ts"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ "three"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_4__); + + + + + +var ARnftFilter = /*#__PURE__*/function () { + function ARnftFilter() { + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ARnftFilter); + + this._hasFound = false; + this._frameDrops = 0; + this._deltaAccuracy = 10; + this.filterFrequency = 30.0; + this.filterMinCutoff = 1.0; + this.filterBeta = 0.0; + this.filterDcutoff = 1.0; + this.delayEnterCheck = new _DelayableSignalFilter__WEBPACK_IMPORTED_MODULE_3__.DelayableSignalFilter(2); + this.delayExitCheck = new _DelayableSignalFilter__WEBPACK_IMPORTED_MODULE_3__.DelayableSignalFilter(0); + this._positionFilter = new _OneEuroFilter__WEBPACK_IMPORTED_MODULE_2__.OneEuroFilterVector3(this.filterFrequency); + this._rotationFilter = new _OneEuroFilter__WEBPACK_IMPORTED_MODULE_2__.OneEuroFilterVector3(this.filterFrequency * 2); + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ARnftFilter, [{ + key: "update", + value: function update(world) { + if (!world) { + this._hasFound = false; + this._frameDrops = 0; + } else { + var matrixW = new three__WEBPACK_IMPORTED_MODULE_4__.Matrix4(); + var worldMatrix = matrixW.fromArray(this.getArrayMatrix(world)); + + if (!this._hasFound) { + this._hasFound = true; + var vecTrans = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + this._lastTranslation = vecTrans.setFromMatrixPosition(worldMatrix); + } else { + var _vecTrans = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + + var _currentTranslation = _vecTrans.setFromMatrixPosition(worldMatrix); + + if (Math.abs(_currentTranslation.distanceTo(this._lastTranslation)) > this._deltaAccuracy) { + this._frameDrops += 1; + + if (this._frameDrops > 3) { + this._lastTranslation = _currentTranslation; + } + + return; + } + + this._frameDrops = 0; + this._lastTranslation = _currentTranslation; + } + + this._positionFilter.UpdateParams(this.filterFrequency, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); + + this._rotationFilter.UpdateParams(this.filterFrequency * 2, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); + + var matrix = worldMatrix; + var rotation = new three__WEBPACK_IMPORTED_MODULE_4__.Quaternion(); + var rotationVec = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + var eulerRot = new three__WEBPACK_IMPORTED_MODULE_4__.Euler(); + var position = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + var scale = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + worldMatrix.decompose(position, rotation, scale); + var eRot = eulerRot.setFromQuaternion(rotation); + rotationVec = this._rotationFilter.Filter(eRot.toVector3()); + + var pos = this._positionFilter.Filter(position); + + return [pos, rotationVec, scale]; + } + } + }, { + key: "getArrayMatrix", + value: function getArrayMatrix(value) { + var array = []; + + for (var key in value) { + array[key] = value[key]; + } + + return array; + } + }]); + + return ARnftFilter; +}(); + +/***/ }), + +/***/ "./src/filters/DelayableSignalFilter.ts": +/*!**********************************************!*\ + !*** ./src/filters/DelayableSignalFilter.ts ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "DelayableSignalFilter": () => (/* binding */ DelayableSignalFilter) +/* harmony export */ }); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); +/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); +/* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/Utils */ "./src/utils/Utils.ts"); + + + +var DelayableSignalFilter = /*#__PURE__*/function () { + function DelayableSignalFilter(timeOut) { + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, DelayableSignalFilter); + + this._timeOut = timeOut; + this._inDelay = false; + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(DelayableSignalFilter, [{ + key: "Update", + value: function Update(tick) { + var time = (0,_utils_Utils__WEBPACK_IMPORTED_MODULE_2__.getTime)(); + + if (!this._inDelay) { + this._prevTime = time; + this._totalTime = 0; + } + + this._totalTime += time - this._prevTime; + + if (this._inDelay && this._totalTime > this._timeOut) { + this._inDelay = false; + return true; + } + + if (tick) { + this._inDelay = true; + return false; + } + + this._inDelay = false; + return false; + } + }]); + + return DelayableSignalFilter; +}(); + +/***/ }), + +/***/ "./src/filters/OneEuroFilter.ts": +/*!**************************************!*\ + !*** ./src/filters/OneEuroFilter.ts ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ OneEuroFilter), +/* harmony export */ "OneEuroFilterVector3": () => (/* binding */ OneEuroFilterVector3) +/* harmony export */ }); +/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); +/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three */ "three"); +/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_2__); + + + + +var LowPassFilter = /*#__PURE__*/function () { + function LowPassFilter(alpha) { + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, LowPassFilter); + + this.alpha = 0; + this.setAlpha(alpha); + this.y = null; + this.s = null; + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(LowPassFilter, [{ + key: "setAlpha", + value: function setAlpha(alpha) { + if (alpha <= 0 || alpha > 1.0) { + throw new Error(); + } + + this.alpha = alpha; + } + }, { + key: "filter", + value: function filter(value, timestamp, alpha) { + if (alpha) { + this.setAlpha(alpha); + } + + var s; + + if (!this.y) { + s = value; + } else { + s = this.alpha * value + (1.0 - this.alpha) * this.s; + } + + this.y = value; + this.s = s; + return s; + } + }, { + key: "lastValue", + value: function lastValue() { + return this.y; + } + }]); + + return LowPassFilter; +}(); + +var OneEuroFilter = /*#__PURE__*/function () { + function OneEuroFilter(freq) { + var minCutOff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1.0; + var beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.0; + var dCutOff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1.0; + + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, OneEuroFilter); + + if (freq <= 0 || minCutOff <= 0 || dCutOff <= 0) { + throw new Error(); + } + + this.freq = freq; + this.minCutOff = minCutOff; + this.beta = beta; + this.dCutOff = dCutOff; + this.x = new LowPassFilter(this.alpha(this.minCutOff)); + this.dx = new LowPassFilter(this.alpha(this.dCutOff)); + this.lasttime = null; + this.currValue = 0.0; + this.prevValue = this.currValue; + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(OneEuroFilter, [{ + key: "alpha", + value: function alpha(cutOff) { + var te = 1.0 / this.freq; + var tau = 1.0 / (2 * Math.PI * cutOff); + return 1.0 / (1.0 + tau / te); + } + }, { + key: "UpdateParams", + value: function UpdateParams(_freq) { + var _mincutoff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1.0; + + var _beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + var _dcutoff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + + this.freq = _freq; + this.minCutOff = _mincutoff; + this.beta = _beta; + this.dCutOff = _dcutoff; + this.x.setAlpha(this.alpha(this.minCutOff)); + this.dx.setAlpha(this.alpha(this.dCutOff)); + } + }, { + key: "Filter", + value: function Filter(x) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + this.prevValue = this.currValue; + + if (this.lasttime && timestamp) { + this.freq = 1.0 / (timestamp - this.lasttime); + } + + this.lasttime = timestamp; + var prevX = this.x.lastValue(); + var dx = !prevX ? 0.0 : (x - prevX) * this.freq; + var edx = this.dx.filter(dx, timestamp, this.alpha(this.dCutOff)); + var cutOff = this.minCutOff + this.beta * Math.abs(edx); + return this.currValue = this.x.filter(x, timestamp, this.alpha(cutOff)); + } + }]); + + return OneEuroFilter; +}(); + + +var OneEuroFilterVector3 = /*#__PURE__*/function () { + function OneEuroFilterVector3(_freq) { + var _mincutoff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + + var _beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + var _dcutoff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + + (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, OneEuroFilterVector3); + + this.currValue = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); + this.prevValue = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); + this._freq = _freq; + this._mincutoff = _mincutoff; + this._beta = _beta; + this._dcutoff = _dcutoff; + this.oneEuroFilters = []; + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); + } + + (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(OneEuroFilterVector3, [{ + key: "freq", + get: function get() { + return this._freq; + } + }, { + key: "beta", + get: function get() { + return this._beta; + } + }, { + key: "dcutoff", + get: function get() { + return this._dcutoff; + } + }, { + key: "mincutoff_1", + get: function get() { + return this._mincutoff; + } + }, { + key: "UpdateParams", + value: function UpdateParams(_freq) { + var _mincutoff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1.0; + + var _beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + + var _dcutoff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + + this._freq = _freq; + this._mincutoff = _mincutoff; + this._beta = _beta; + this._dcutoff = _dcutoff; + + for (var i = 0; i < this.oneEuroFilters.length; i++) { + this.oneEuroFilters[i].UpdateParams(this._freq, this._mincutoff, this._beta, this._dcutoff); + } + } + }, { + key: "Filter", + value: function Filter(_value) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1.0; + this.prevValue = this.currValue; + var out = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); + var output = out.toArray(); + + var input = _value.toArray(); + + this.oneEuroFilters.forEach(function (filters, idx) { + output[idx] = filters.Filter(input[idx], timestamp); + }); + var arr = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); + return this.currValue = arr.fromArray(output); + } + }]); + + return OneEuroFilterVector3; +}(); + /***/ }), /***/ "./src/markermedia/NFTaddTJS.ts": @@ -153,7 +536,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader */ "./node_modules/three/examples/jsm/loaders/GLTFLoader.js"); /* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/Utils */ "./src/utils/Utils.ts"); -/* harmony import */ var _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../SceneRendererTJS */ "./src/SceneRendererTJS.ts"); +/* harmony import */ var _filters_ARnftFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../filters/ARnftFilter */ "./src/filters/ARnftFilter.ts"); +/* harmony import */ var _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../SceneRendererTJS */ "./src/SceneRendererTJS.ts"); + @@ -166,15 +551,18 @@ var NFTaddTJS = /*#__PURE__*/function () { (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, NFTaddTJS); this.entities = []; - this.scene = _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_5__["default"].getGlobalScene(); + this.scene = _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_6__["default"].getGlobalScene(); this.target = window || __webpack_require__.g; this.uuid = uuid; this.names = []; + this._filter = new _filters_ARnftFilter__WEBPACK_IMPORTED_MODULE_5__.ARnftFilter(); } (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(NFTaddTJS, [{ key: "add", value: function add(mesh, name, objVisibility) { + var _this = this; + this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { var msg = ev.detail; mesh.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; @@ -188,8 +576,15 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; mesh.visible = true; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + + var filter = _this._filter.update(ev.detail.matrixGL_RH); + + console.log("position from filter is: ", filter[0]); + console.log("rotation from filter is: ", filter[1]); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); + root.rotation.setFromVector3(filter[1]); }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { root.visible = objVisibility; @@ -4776,4 +5171,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO0FBQ3BDLFlBQU0sRUFBRSxVQUQ0QjtBQUVwQyxhQUFP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VHTFRGTG9hZGVyLmxvYWQodXJsLCAoZ2x0ZikgPT4ge1xuICAgICAgICAgICAgbW9kZWwgPSBnbHRmLnNjZW5lO1xuICAgICAgICAgICAgbW9kZWwuc2NhbGUuc2V0KHNjYWxlLCBzY2FsZSwgc2NhbGUpO1xuICAgICAgICAgICAgbW9kZWwucm90YXRpb24ueCA9IE1hdGguUEkgLyAyO1xuICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueCA9IHg7XG4gICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi55ID0geTtcbiAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnogPSB6O1xuICAgICAgICAgICAgcm9vdC5hZGQobW9kZWwpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE1hdHJpeEdMX1JILVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5hbWVzLnB1c2gobmFtZSk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NnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgcm9vdC5hZGQocGxhbmUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbGFuZS52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG4gICAgcHVibGljIGFkZFZpZGVvKGlkOiBzdHJpbmcsIG5hbWU6IHN0cmluZywgc2NhbGU6IG51bWJlciwgb2JqVmlzaWJpbGl0eTogYm9vbGVhbikge1xuICAgICAgICBjb25zdCByb290ID0gbmV3IE9iamVjdDNEKCk7XG4gICAgICAgIHJvb3QubmFtZSA9IFwicm9vdC1cIiArIG5hbWU7XG4gICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICB0aGlzLnNjZW5lLmFkZChyb290KTtcbiAgICAgICA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lzLmZpbHRlckZyZXF1ZW5jeSAqIDIpO1xuICAgIH1cblxuICAgIHB1YmxpYyB1cGRhdGUod29ybGQ6IGFueSk6IFZlY3RvcjNbXSB7XG4gICAgICAgIGlmICghd29ybGQpIHtcbiAgICAgICAgICAgIHRoaXMuX2hhc0ZvdW5kID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLl9mcmFtZURyb3BzID0gMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ2luc2lkZSBsb29wJyk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIC8vbGV0IHdvcmxkTWF0cml4OiBNYXRyaXggPSBNYXRyaXguRnJvbUFycmF5KHRoaXMuZ2V0QXJyYXlNYXRyaXgodGhpcy53b3JsZCkpO1xuICAgICAgICAgICAgbGV0IG1hdHJpeFc6IE1hdHJpeDQgPSBuZXcgTWF0cml4NCgpO1xuICAgICAgICAgICAgbGV0IHdvcmxkTWF0cml4OiBNYXRyaXg0ID0gbWF0cml4Vy5mcm9tQXJyYXkodGhpcy5nZXRBcnJheU1hdHJpeCh3b3JsZCkpO1xuXG5cbiAgICAgICAgICAgIGlmICghdGhpcy5faGFzRm91bmQpIHtcbiAgICAgICAgICAgICAgICAvLyBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcbiAgICAgICAgICAgICAgICAvLyAgICAgdGhpcy50cmFja2VkTWF0cml4LmludGVycG9sYXRlZFtpXSA9IHRoaXMud29ybGRbaV07XG4gICAgICAgICAgICAgICAgLy8gfVxuICAgICAgICAgICAgICAgIHRoaXMuX2hhc0ZvdW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBsZXQgdmVjVHJhbnM6IFZlY3RvcjMgPSBuZXcgVmVjdG9yMygpXG4gICAgICAgICAgICAgICAgLy8vdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gd29ybGRNYXRyaXguZ2V0VHJhbnNsYXRpb24oKTsgLy8gQmFieWxvbiB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GlzLl90aW1lT3V0ID0gdGltZU91dDtcbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgIH1cblxuICAgIHB1YmxpYyBVcGRhdGUodGljazogYm9vbGVhbik6IGJvb2xlYW4ge1xuICAgICAgICBsZXQgdGltZTogbnVtYmVyID0gZ2V0VGltZSgpO1xuXG4gICAgICAgIGlmICghdGhpcy5faW5EZWxheSkge1xuICAgICAgICAgICAgdGhpcy5fcHJldlRpbWUgPSB0aW1lO1xuICAgICAgICAgICAgdGhpcy5fdG90YWxUaW1lID0gMDtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX3RvdGFsVGltZSArPSB0aW1lIC0gdGhpcy5fcHJldlRpbWU7XG5cbiAgICAgICAgaWYgKHRoaXMuX2luRGVsYXkgJiYgdGhpcy5fdG90YWxUaW1lID4gdGhpcy5fdGltZU91dCkge1xuICAgICAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGljaykge1xuICAgICAgICAgICAgdGhpcy5faW5EZWxheSA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuXG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbn0iLCJpbXBvcnQgeyBWZWN0b3IzIH0gZnJvbSBcInRocmVlXCI7XG5cbi8vaHR0cHM6Ly9naXRodWIuY29tL0RhcmlvTWF6emFudGkvT25lRXVyb0ZpbHRlclVuaXR5L2Jsb2IvbWFzdGVyL0Fzc2V0cy9TY3JpcHRzL09uZUV1cm9GaWx0ZXIuY3Ncbi8vaHR0cHM6Ly9naXRodWIuY29tL0RhcmlvTWF6emFudGkvT25lRXVyb0ZpbHRlclVuaXR5L2Jsb2IvbWFzdGVyL0Fzc2V0cy9TY3JpcHRzL0ZpbHRlclRlc3RWZWN0b3IzLmNzXG4vL2h0dHBzOi8vZ2lzdC5naXRodWIuY29tL1Rob3JzdGVuQnV4LzMyMzE4M2JiMGJjMmNjYjkyZmYyM2ViZGYzZGU2NDA4XG5cbi8qIGVzbGludC1kaXNhYmxlIG1heC1jbGFzc2VzLXBlci1maWxlICovXG5jbGFzcyBMb3dQYXNzRmlsdGVyIHtcbiAgICB5OiBudW1iZXIgfCBudWxsO1xuXG4gICAgczogbnVtYmVyIHwgbnVsbDtcblxuICAgIGFscGhhID0gMDtcblxuICAgIGNvbnN0cnVjdG9yKGFscGhhOiBudW1iZXIpIHtcbiAgICAgICAgdGhpcy5zZXRBbHBoYShhbHBoYSk7XG4gICAgICAgIHRoaXMueSA9IG51bGw7XG4gICAgICAgIHRoaXMucyA9IG51bGw7XG4gICAgfVxuXG4gICAgc2V0QWxwaGEoYWxwaGE6IG51bWJlcikge1xuICAgICAgICBpZiAoYWxwaGEgPD0gMCB8fCBhbHBoYSA+IDEuMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5hbHBoYSA9IGFscGhhO1xuICAgIH1cblxuICAgIGZpbHRlcih2YWx1ZTogbnVtYmVyLCB0aW1lc3RhbXA6IG51bWJlciwgYWxwaGE6IG51bWJlcikge1xuICAgICAgICBpZiAoYWxwaGEpIHtcbiAgICAgICAgICAgIHRoaXMuc2V0QWxwaGEoYWxwaGEpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzO1xuICAgICAgICBpZiAoIXRoaXMueSkge1xuICAgICAgICAgICAgcyA9IHZhbHVlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcyA9IHRoaXMuYWxwaGEgKiB2YWx1ZSArICgxLjAgLSB0aGlzLmFscGhhKSAqIHRoaXMucyE7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy55ID0gdmFsdWU7XG4gICAgICAgIHRoaXMucyA9IHM7XG4gICAgICAgI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gbW9kZWw6IGFueTtcbiAgICAgICAgLyogTG9hZCBNb2RlbCAqL1xuICAgICAgICBjb25zdCB0aHJlZUdMVEZMb2FkZXIgPSBuZXcgR0xURkxvYWRlcigpO1xuICAgICAgICB0aHJlZUdMVEZMb2FkZXIubG9hZCh1cmwsIChnbHRmKSA9PiB7XG4gICAgICAgICAgICBtb2RlbCA9IGdsdGYuc2NlbmU7XG4gICAgICAgICAgICBtb2RlbC5zY2FsZS5zZXQoc2NhbGUsIHNjYWxlLCBzY2FsZSk7XG4gICAgICAgICAgICBtb2RlbC5yb3RhdGlvbi54ID0gTWF0aC5QSSAvIDI7XG4gICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0geDtcbiAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSB5O1xuICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueiA9IHo7XG4gICAgICAgICAgICByb290LmFkZChtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZp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HRcdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBTeW1ib2wudG9TdHJpbmdUYWcsIHsgdmFsdWU6ICdNb2R1bGUnIH0pO1xuXHR9XG5cdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCAnX19lc01vZHVsZScsIHsgdmFsdWU6IHRydWUgfSk7XG59OyIsImltcG9ydCBTY2VuZVJlbmRlcmVyVEpTIGZyb20gXCIuL1NjZW5lUmVuZGVyZXJUSlNcIjtcbmltcG9ydCBORlRhZGRUSlMgZnJvbSBcIi4vbWFya2VybWVkaWEvTkZUYWRkVEpTXCI7XG5cbmV4cG9ydCBkZWZhdWx0IHsgU2NlbmVSZW5kZXJlclRKUywgTkZUYWRkVEpTIH07XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/src/filters/ARnftFilter.ts b/src/filters/ARnftFilter.ts index ffc9e24..b7f0258 100644 --- a/src/filters/ARnftFilter.ts +++ b/src/filters/ARnftFilter.ts @@ -34,12 +34,12 @@ export class ARnftFilter { this._rotationFilter = new OneEuroFilterVector3(this.filterFrequency * 2); } - public update(world: any): Vector3 { + public update(world: any): Vector3[] { if (!world) { this._hasFound = false; this._frameDrops = 0; } else { - console.log('inside loop'); + //console.log('inside loop'); //let worldMatrix: Matrix = Matrix.FromArray(this.getArrayMatrix(this.world)); let matrixW: Matrix4 = new Matrix4(); @@ -85,8 +85,8 @@ export class ARnftFilter { //let rotMatrix: Matrix = matrix.getRotationMatrix(); - let rotMatrix: Matrix4 = new Matrix4(); - rotMatrix.extractRotation(matrix); + //let rotMatrix: Matrix4 = new Matrix4(); // this is not neede because we decompose the matrix + //rotMatrix.extractRotation(matrix); //let rotation: Quaternion = new Quaternion().setFromRotationMatrix(rotMatrix); //this is wrong , will do nothing! let rotation: Quaternion = new Quaternion() ///this._root.rotation = this._rotationFilter.Filter(rotation.toEulerAngles()); // Babylon code @@ -113,7 +113,7 @@ export class ARnftFilter { let finalRot = new Quaternion(); finalRot.setFromRotationMatrix(rotationMatrix)*/ //out.compose(pos, ) /// will see if output the matrix in a future... - return pos + return [pos, rotationVec, scale] } } protected getArrayMatrix(value: any): any { diff --git a/src/markermedia/NFTaddTJS.ts b/src/markermedia/NFTaddTJS.ts index d1b4420..deb939b 100644 --- a/src/markermedia/NFTaddTJS.ts +++ b/src/markermedia/NFTaddTJS.ts @@ -1,6 +1,7 @@ -import { Object3D, PlaneGeometry, Scene, TextureLoader, VideoTexture, Mesh, MeshStandardMaterial } from "three"; +import { Object3D, PlaneGeometry, Scene, TextureLoader, VideoTexture, Mesh, MeshStandardMaterial, Vector3 } from "three"; import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; import { Utils } from "../utils/Utils"; +import { ARnftFilter } from '../filters/ARnftFilter' import SceneRendererTJS from "../SceneRendererTJS"; interface ARvideo { @@ -18,11 +19,13 @@ export default class NFTaddTJS { private scene: Scene; private target: EventTarget; private uuid: string; + private _filter: ARnftFilter; constructor(uuid: string) { this.scene = SceneRendererTJS.getGlobalScene(); this.target = window || global; this.uuid = uuid; this.names = []; + this._filter = new ARnftFilter(); } public add(mesh: Object3D, name: string, objVisibility: boolean) { this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, (ev: any) => { @@ -38,8 +41,16 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; mesh.visible = true; - const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + + let filter = this._filter.update(ev.detail.matrixGL_RH) + + console.log("position from filter is: ", filter[0]); + console.log("rotation from filter is: ", filter[1]); + + root.position.setX((filter[0].x)); + root.position.setY((filter[0].y)); + root.position.setZ((filter[0].z)); + root.rotation.setFromVector3(filter[1]) }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { root.visible = objVisibility; diff --git a/types/filters/ARnftFilter.d.ts b/types/filters/ARnftFilter.d.ts index 5fc84fb..fd4b590 100644 --- a/types/filters/ARnftFilter.d.ts +++ b/types/filters/ARnftFilter.d.ts @@ -13,6 +13,6 @@ export declare class ARnftFilter { filterBeta: number; filterDcutoff: number; constructor(); - update(world: any): Vector3; + update(world: any): Vector3[]; protected getArrayMatrix(value: any): any; } diff --git a/types/markermedia/NFTaddTJS.d.ts b/types/markermedia/NFTaddTJS.d.ts index b3c5db9..d461b66 100644 --- a/types/markermedia/NFTaddTJS.d.ts +++ b/types/markermedia/NFTaddTJS.d.ts @@ -5,6 +5,7 @@ export default class NFTaddTJS { private scene; private target; private uuid; + private _filter; constructor(uuid: string); add(mesh: Object3D, name: string, objVisibility: boolean): void; addModel(url: string, name: string, x: number, y: number, z: number, scale: number, objVisibility: boolean): void; From 3ba898ccaa51a16a296dde1087f5cde7855e604b Mon Sep 17 00:00:00 2001 From: kalwalt Date: Mon, 18 Oct 2021 14:57:56 +0200 Subject: [PATCH 03/11] removing matrixAutoUpdate and adding scaling --- dist/ARnftThreejs.js | 6 ++++-- src/markermedia/NFTaddTJS.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index ee7a83d..f4f5d84 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -570,7 +570,6 @@ var NFTaddTJS = /*#__PURE__*/function () { }); var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); root.add(mesh); this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { @@ -585,6 +584,9 @@ var NFTaddTJS = /*#__PURE__*/function () { root.position.setY(filter[0].y); root.position.setZ(filter[0].z); root.rotation.setFromVector3(filter[1]); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { root.visible = objVisib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coJ2luc2lkZSBsb29wJyk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIC8vbGV0IHdvcmxkTWF0cml4OiBNYXRyaXggPSBNYXRyaXguRnJvbUFycmF5KHRoaXMuZ2V0QXJyYXlNYXRyaXgodGhpcy53b3JsZCkpO1xuICAgICAgICAgICAgbGV0IG1hdHJpeFc6IE1hdHJpeDQgPSBuZXcgTWF0cml4NCgpO1xuICAgICAgICAgICAgbGV0IHdvcmxkTWF0cml4OiBNYXRyaXg0ID0gbWF0cml4Vy5mcm9tQXJyYXkodGhpcy5nZXRBcnJheU1hdHJpeCh3b3JsZCkpO1xuXG5cbiAgICAgICAgICAgIGlmICghdGhpcy5faGFzRm91bmQpIHtcbiAgICAgICAgICAgICAgICAvLyBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcbiAgICAgICAgICAgICAgICAvLyAgICAgdGhpcy50cmFja2VkTWF0cml4LmludGVycG9sYXRlZFtpXSA9IHRoaXMud29ybGRbaV07XG4gICAgICAgICAgICAgICAgLy8gfVxuICAgICAgICAgICAgICAgIHRoaXMuX2hhc0ZvdW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBsZXQgdmVjVHJhbnM6IFZlY3RvcjMgPSBuZXcgVmVjdG9yMygpXG4gICAgICAgICAgICAgICAgLy8vdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gd29ybGRNYXRyaXguZ2V0VHJhbnNsYXRpb24oKTsgLy8gQmFieWxvbiBjb2RlLi4uXG4gICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gdmVjVHJhbnMuc2V0RnJvbU1hdHJpeFBvc2l0aW9uKHdvcmxkTWF0cml4KVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHZlY1RyYW5zOiBWZWN0b3IzID0gbmV3IFZlY3RvcjMoKVxuICAgICAgICAgICAgICAgIC8vbGV0IF9jdXJyZW50VHJhbnNsYXRpb246IFZlY3RvcjMgPSB3b3JsZE1hdHJpeC5nZXRUcmFuc2xhdGlvbigpOyAvLyBCYWJ5bG9uIGNvZGUuLi5cbiAgICAgICAgICAgICAgICBsZXQgX2N1cnJlbnRUcmFuc2xhdGlvbjogVmVjdG9yMyA9IHZlY1RyYW5zLnNldEZyb21NYXRyaXhQb3NpdGlvbih3b3JsZE1hdHJpeClcblxuICAgICAgICAgICAgICAgIC8vaWYgKE1hdGguYWJzKFZlY3RvcjMuRGlzdGFuY2UoX2N1cnJlbnRUcmFuc2xhdGlvbiwgdGhpcy5fbGFzdFRyYW5zbGF0aW9uKSkgPiB0aGlzLl9kZWx0YUFjY3VyYWN5KSB7IC8vQmFieWxvbiBjb2RlLi4uXG4gICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKF9jdXJyZW50VHJhbnNsYXRpb24uZGlzdGFuY2VUbyh0aGlzLl9sYXN0VHJhbnNsYXRpb24pKSA+IHRoaXMuX2RlbHRhQWNjdXJhY3kpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZnJhbWVEcm9wcyArPSAxO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJhbWVEcm9wcyA+IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2xhc3RUcmFuc2xhdGlvbiA9IF9jdXJyZW50VHJhbnNsYXRpb247XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZURyb3BzID0gMDtcbiAgICAgICAgICAgICAgICB0aGlzLl9sYXN0VHJhbnNsYXRpb24gPSBfY3VycmVudFRyYW5zbGF0aW9uO1xuICAgICAgICAgICAgICAgIC8vIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuICAgICAgICAgICAgICAgIC8vICAgICB0aGlzLnRyYWNrZWRNYXRyaXguZGV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XG4gICAgICAgICAgICAvL291dC5jb21wb3NlKHBvcywgKSAvLy8gd2lsbCBzZWUgaWYgb3V0cHV0IHRoZSBtYXRyaXggaW4gYSBmdXR1cmUuLi5cbiAgICAgICAgICAgIHJldHVybiBbcG9zLCByb3RhdGlvblZlYywgc2NhbGVdXG4gICAgICAgIH1cbiAgICB9XG4gICAgcHJvdGVjdGVkIGdldEFycmF5TWF0cml4KHZhbHVlOiBhbnkpOiBhbnkge1xuICAgICAgICB2YXIgYXJyYXk6IGFueSA9IFtdO1xuICAgICAgICBmb3IgKHZhciBrZXkgaW4gdmFsdWUpIHtcbiAgICAgICAgICAgIGFycmF5W2tleV0gPSB2YWx1ZVtrZXldOyAvLy50b0ZpeGVkKDQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhcnJheTtcbiAgICB9XG59IiwiaW1wb3J0IHsgZ2V0VGltZSB9IGZyb20gXCIuLi91dGlscy9VdGlsc1wiO1xuXG5leHBvcnQgY2xhc3MgRGVsYXlhYmxlU2lnbmFsRmlsdGVyIHtcblxuICAgIHByaXZhdGUgX2luRGVsYXk6IGJvb2xlYW47XG4gICAgcHJpdmF0ZSBfdG90YWxUaW1lOiBudW1iZXI7XG4gICAgcHJpdmF0ZSBfcHJldlRpbWU6IG51bWJlcjtcblxuICAgIHByaXZhdGUgX3RpbWVPdXQ6IG51bWJlcjtcblxuICAgIGNvbnN0cnVjdG9yKHRpbWVPdXQ6IG51bWJlcikge1xuICAgICAgICB0aGlzLl90aW1lT3V0ID0gdGltZU91dDtcbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgIH1cblxuICAgIHB1YmxpYyBVcGRhdGUodGljazogYm9vbGVhbik6IGJvb2xlYW4ge1xuICAgICAgICBsZXQgdGltZTogbnVtYmVyID0gZ2V0VGltZSgpO1xuXG4gICAgICAgIGlmICghdGhpcy5faW5EZWxheSkge1xuICAgICAgICAgICAgdGhpcy5fcHJldlRpbWUgPSB0aW1lO1xuICAgIC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GFscGhhID0gMDtcblxuICAgIGNvbnN0cnVjdG9yKGFscGhhOiBudW1iZXIpIHtcbiAgICAgICAgdGhpcy5zZXRBbHBoYShhbHBoYSk7XG4gICAgICAgIHRoaXMueSA9IG51bGw7XG4gICAgICAgIHRoaXMucyA9IG51bGw7XG4gICAgfVxuXG4gICAgc2V0QWxwaGEoYWxwaGE6IG51bWJlcikge1xuICAgICAgICBpZiAoYWxwaGEgPD0gMCB8fCBhbHBoYSA+IDEuMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5hbHBoYSA9IGFscGhhO1xuICAgIH1cblxuICAgIGZpbHRlcih2YWx1ZTogbnVtYmVyLCB0aW1lc3RhbXA6IG51bWJlciwgYWxwaGE6IG51bWJlcikge1xuICAgICAgICBpZiAoYWxwaGEpIHtcbiAgICAgICAgICAgIHRoaXMuc2V0QWxwaGEoYWxwaGEpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzO1xuICAgICAgICBpZiAoIXRoaXMueSkge1xuICAgICAgICAgICAgcyA9IHZhbHVlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcyA9IHRoaXMuYWxwaGEgKiB2YWx1ZSArICgxLjAgLSB0aGlzLmFscGhhKSAqIHRoaXMucyE7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy55ID0gdmFsdWU7XG4gICAgICAgIHRoaXMucyA9IHM7XG4gICAgICAgIHJldHVybiBzO1xuICAgIH1cblxuICAgIGxhc3RWYWx1ZSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMueTtcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIE9uZUV1cm9GaWx0ZXIge1xuICAgIGZyZXE6IG51bWJlcjtcblxuICAgIG1pbkN1dE9mZjogbnVtYmVyO1xuXG4gICAgYmV0YTogbnVtYmVyO1xuXG4gICAgZEN1dE9mZjogbnVtYmVyO1xuXG4gICAgeD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Y2FsZSk7XG4gICAgICAgICAgICBtb2RlbC5yb3RhdGlvbi54ID0gTWF0aC5QSSAvIDI7XG4gICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0geDtcbiAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSB5O1xuICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueiA9IHo7XG4gICAgICAgICAgICByb290LmFkZChtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG4gICAgcHVibGljIGFkZEltYWdlKGltYWdlVXJsOiBzdHJpbmcsIG5hbWU6IHN0cmluZywgY29sb3I6IHN0cmluZywgc2NhbGU6IG51bWJlciwgb2JqVmlzaWJpbGl0eTogYm9vbGVhbikge1xuICAgIC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VyID0gbmV3IE9uZUV1cm9GaWx0ZXJWZWN0b3IzKHRoaXMuZmlsdGVyRnJlcXVlbmN5ICogMik7XG4gICAgfVxuXG4gICAgcHVibGljIHVwZGF0ZSh3b3JsZDogYW55KTogVmVjdG9yM1tdIHtcbiAgICAgICAgaWYgKCF3b3JsZCkge1xuICAgICAgICAgICAgdGhpcy5faGFzRm91bmQgPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuX2ZyYW1lRHJvcHMgPSAwO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygnaW5zaWRlIGxvb3AnKTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgLy9sZXQgd29ybGRNYXRyaXg6IE1hdHJpeCA9IE1hdHJpeC5Gcm9tQXJyYXkodGhpcy5nZXRBcnJheU1hdHJpeCh0aGlzLndvcmxkKSk7XG4gICAgICAgICAgICBsZXQgbWF0cml4VzogTWF0cml4NCA9IG5ldyBNYXRyaXg0KCk7XG4gICAgICAgICAgICBsZXQgd29ybGRNYXRyaXg6IE1hdHJpeDQgPSBtYXRyaXhXLmZyb21BcnJheSh0aGlzLmdldEFycmF5TWF0cml4KHdvcmxkKSk7XG5cblxuICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNGb3VuZCkge1xuICAgICAgICAgICAgICAgIC8vIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuICAgICAgICAgICAgICAgIC8vICAgICB0aGlzLnRyYWNrZWRNYXRyaXguaW50ZXJwb2xhdGVkW2ldID0gdGhpcy53b3JsZFtpXTtcbiAgICAgICAgICAgICAgICAvLyB9XG4gICAgICAgICAgICAgICAgdGhpcy5faGFzRm91bmQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCB2ZWNUcmFuczogVmVjdG9yMyA9IG5ldyBWZWN0b3IzKClcbiAgICAgICAgICAgICAgICAvLy90aGlzLl9sYXN0VHJhbnNsYXRpb24gPSB3b3JsZE1hdHJpe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sdGVyIGlzOiBcIiwgZmlsdGVyWzBdKTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKFwicm90YXRpb24gZnJvbSBmaWx0ZXIgaXM6IFwiLCBmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIG1lc2gudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5hbWVzLnB1c2gobmFtZSk7XG4gICAgICAgIHRoaXMuZW50aXRpZXMucHVzaCh7IG5hbWUsIG1lc2ggfSk7XG4gICAgfVxuXG4gICAgcHVibGljIGFkZE1vZGVsKHVybDogc3RyaW5nLCBuYW1lOiBzdHJpbmcsIHg6IG51bWJlciwgeTogbnVtYmVyLCB6OiBudW1iZXIsIHNjYWxlOiBudW1iZXIsIG9ialZpc2liaWxpdHk6IGJvb2xlYW4pIHtcbiAgICAg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IHNjYWxlKTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE5GVERhdGEtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgcGxhbmUucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgIHBsYW5lLnBvc2l0aW9uLnggPSAoKG1zZy53aWR0aCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgfSk7XG4gICAgICAgIHJvb3QuYWRkKHBsYW5lKTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE1hdHJpeEdMX1JILVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIHBsYW5lLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB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AgICAgICAgICAgcGxhbmUucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgIHBsYW5lLnBvc2l0aW9uLnggPSAoKG1zZy53aWR0aCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgfSk7XG4gICAgICAgIHJvb3QuYWRkKHBsYW5lKTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE1hdHJpeEdMX1JILVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIHBsYW5lLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5hbWVzLnB1c2gobmFtZSk7XG4gICAgfVxuXG4gICAgcHVibGljIGdldE5hbWVzKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5uYW1lcztcbiAgICB9XG59XG4iLCJleHBvcnQgZnVuY3Rpb24gZ2V0VGltZSgpOiBudW1iZXIge1xuICAgIHJldHV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gcHJvcCkpIiwiLy8gZGVmaW5lIF9fZXNNb2R1bGUgb24gZXhwb3J0c1xuX193ZWJwYWNrX3JlcXVpcmVfXy5yID0gKGV4cG9ydHMpID0+IHtcblx0aWYodHlwZW9mIFN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcgJiYgU3ltYm9sLnRvU3RyaW5nVGFnKSB7XG5cdFx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFN5bWJvbC50b1N0cmluZ1RhZywgeyB2YWx1ZTogJ01vZHVsZScgfSk7XG5cdH1cblx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICdfX2VzTW9kdWxlJywgeyB2YWx1ZTogdHJ1ZSB9KTtcbn07IiwiaW1wb3J0IFNjZW5lUmVuZGVyZXJUSlMgZnJvbSBcIi4vU2NlbmVSZW5kZXJlclRKU1wiO1xuaW1wb3J0IE5GVGFkZFRKUyBmcm9tIFwiLi9tYXJrZXJtZWRpYS9ORlRhZGRUSlNcIjtcblxuZXhwb3J0IGRlZmF1bHQgeyBTY2VuZVJlbmRlcmVyVEpTLCBORlRhZGRUSlMgfTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/src/markermedia/NFTaddTJS.ts b/src/markermedia/NFTaddTJS.ts index deb939b..75a7c6f 100644 --- a/src/markermedia/NFTaddTJS.ts +++ b/src/markermedia/NFTaddTJS.ts @@ -35,7 +35,6 @@ export default class NFTaddTJS { }); const root = new Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); root.add(mesh); this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { @@ -50,7 +49,10 @@ export default class NFTaddTJS { root.position.setX((filter[0].x)); root.position.setY((filter[0].y)); root.position.setZ((filter[0].z)); - root.rotation.setFromVector3(filter[1]) + root.rotation.setFromVector3(filter[1]); + root.scale.setX((filter[2].x)); + root.scale.setY((filter[2].y)); + root.scale.setZ((filter[2].z)); }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { root.visible = objVisibility; From 183cec61c5890da71a838d13c1de7c052e94540e Mon Sep 17 00:00:00 2001 From: kalwalt Date: Mon, 18 Oct 2021 15:03:31 +0200 Subject: [PATCH 04/11] rebuild libs after merging --- dist/ARnftThreejs.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index 2c59af0..bb191ec 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -60,7 +60,7 @@ var SceneRendererTJS = /*#__PURE__*/function () { this.camera = new three__WEBPACK_IMPORTED_MODULE_2__.Camera(); } - this.version = "0.3.0"; + this.version = "0.3.2"; console.log("ARnftThreejs version: ", this.version); } @@ -594,8 +594,7 @@ var NFTaddTJS = /*#__PURE__*/function () { }); this.names.push(name); this.entities.push({ - name: name, - mesh: mesh + name: name }); } }, { @@ -630,12 +629,12 @@ var NFTaddTJS = /*#__PURE__*/function () { } }, { key: "addImage", - value: function addImage(imageUrl, name, color, scale, objVisibility) { + value: function addImage(imageUrl, name, color, scale, configs, objVisibility) { var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); root.name = "root-" + name; root.matrixAutoUpdate = false; this.scene.add(root); - var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(1, 1, 1, 1); + var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(configs.w, configs.h, configs.ws, configs.hs); var texture = new three__WEBPACK_IMPORTED_MODULE_2__.TextureLoader().load(imageUrl); var material = new three__WEBPACK_IMPORTED_MODULE_2__.MeshStandardMaterial({ color: color, @@ -663,7 +662,7 @@ var NFTaddTJS = /*#__PURE__*/function () { } }, { key: "addVideo", - value: function addVideo(id, name, scale, objVisibility) { + value: function addVideo(id, name, scale, configs, objVisibility) { var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); root.name = "root-" + name; root.matrixAutoUpdate = false; @@ -675,7 +674,7 @@ var NFTaddTJS = /*#__PURE__*/function () { map: texture }); ARVideo.play(); - var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(1, 1, 1, 1); + var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(configs.w, configs.h, configs.ws, configs.hs); var plane = new three__WEBPACK_IMPORTED_MODULE_2__.Mesh(planeGeom, mat); plane.scale.set(scale, scale, scale); this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { @@ -5173,4 +5172,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO0FBQ3BDLFlBQU0sRUFBRSxVQUQ0QjtBQUVwQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FGTztBQUdwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FIUztBQUlwQyx3QkFBa0IsRUFBRSxVQUFVLENBQUMsUUFBWCxDQUFvQixrQkF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b3BzICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZURyb3BzID4gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gX2N1cnJlbnRUcmFuc2xhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lRHJvcHMgPSAwO1xuICAgICAgICAgICAgICAgIHRoaXMuX2xhc3RUcmFuc2xhdGlvbiA9IF9jdXJyZW50VHJhbnNsYXRpb247XG4gICAgICAgICAgICAgICAgLy8gZm9yICh2YXIgaSA9IDA7IGkgPCAxNjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgLy8gICAgIHRoaXMudHJhY2tlZE1hdHJpeC5kZWx0YVtpXSA9IHRoaXMud29ybGRbaV0gLSB0aGlzLnRyYWNrZWRNYXRyaXguaW50ZXJwb2xhdGVkW2ldO1xuICAgICAgICAgICAgICAgIC8vICAgICB0aGlzLnRyYWNrZWRNYXRyaXguaW50ZXJwb2xhdGVkW2ldID0gdGhpcy50cmFja2VkTWF0cml4LmludGVycG9sYXRlZFtpXSArICh0aGlzLnRyYWNrZWRNYXRyaXguZGVsdGFbaV0gLyB0aGlzLl9pbnRlcnBvbGF0aW9uRmFjdG9yKTtcbiAgICAgICAgICAgICAgICAvLyB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBsZXQgbWF0cml4OiBNYXRyaXggPSBNYXRyaXguRnJvbUFycmF5KHRoaXMuZ2V0QXJyYXlNYXRyaXgodGhpcy53b3JsZCkpO1xuXG4gICAgICAgICAgICB0aGlzLl9wb3NpdGlvbkZpbHRlci5VcGRhdGVQYXJhbXModGhpcy5maWx0ZXJGcmVxdWVuY3ksIHRoaXMuZmlsdGVyTWluQ3V0b2ZmLCB0aGlzLmZpbHRlckJldGEsIHRoa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aC52aXNpYmxlID0gdHJ1ZTtcblxuICAgICAgICAgICAgbGV0IGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKVxuXG4gICAgICAgICAgICBjb25zb2xlLmxvZyhcInBvc2l0aW9uIGZyb20gZmlsdGVyIGlzOiBcIiwgZmlsdGVyWzBdKTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKFwicm90YXRpb24gZnJvbSBmaWx0ZXIgaXM6IFwiLCBmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIG1lc2gudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5hbWVzLnB1c2gobmFtZSk7XG4gICAgICAgIHRoaXMuZW50aXRpZXMucHVzaCh7IG5hbWUsIG1lc2ggfSk7XG4gIC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KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE5GVERhdGEtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgcGxhbmUucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgIHBsYW5lLnBvc2l0aW9uLnggPSAoKG1zZy53aWR0aCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgfSk7XG4gICAgICAgIHJvb3QuYWRkKHBsYW5lKTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE1hdHJpeEdMX1JILVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIHBsYW5lLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5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cblx0XHRyb290W1wiQVJuZnRUaHJlZWpzXCJdID0gZmFjdG9yeShyb290W1wiVEhSRUVcIl0pO1xufSkodGhpcywgZnVuY3Rpb24oX19XRUJQQUNLX0VYVEVSTkFMX01PRFVMRV90aHJlZV9fKSB7XG5yZXR1cm4gIiwiaW1wb3J0ICogYXMgVEhSRUUgZnJvbSBcInRocmVlXCI7XG5pbXBvcnQgeyBVdGlscyB9IGZyb20gXCIuL3V0aWxzL1V0aWxzXCI7XG5cbmludGVyZmFjZSBDb25maWdEYXRhIHtcbiAgICBjYW1lcmE6IHtcbiAgICAgICAgZmFyOiBudW1iZXI7XG4gICAgICAgIGZvdjogbnVtYmVyO1xuICAgICAgICBtYXRyaXhBdXRvVXBkYXRlOiBib29sZWFuO1xuICAgICAgICBuZWFyOiBudW1iZXI7XG4gICAgICAgIHJhdGlvOiBudW1iZXI7XG4gICAgfTtcbiAgICByZW5kZXJlcjoge1xuICAgICAgICBhbHBoYTogYm9vbGVhbjtcbiAgICAgICAgYW50aWFsaWFzOiBib29sZWFuO1xuICAgICAgICBjb250ZXh0OiBhbnk7XG4gICAgICAgIGRlcHRoOiBib29sZWFuO1xuICAgICAgICBsb2dhcml0aG1pY0RlcHRoQnVmZmVyOiBib29sZWFuO1xuICAgICAgICBwcmVjaXNpb246IHN0cmluZztcbiAgICAgICAgc3RlbmNpbDogYm9vbGVhbjtcbiAgICAgICAgcHJlbXVsdGlwbGllZEFscGhhOiBib29sZWFuO1xuICAgICAgICBvYmpWaXNpYmlsaXR5OiBib29sZWFuO1xuICAgIH07XG59XG5cbmludGVyZmFjZSBSb290IGV4dGVuZHMgVEhSRUUuT2JqZWN0M0Qge1xuICAgIC8vbWF0cml4OiBvYmplY3Rcbn1cblxuaW50ZXJmYWNlIFJlbmRlcmVyIHtcbiAgICByZW5kZXI6IChzY2VuZTogVEhSRUUuU2NlbmUsIGNhbWVyYTogVEhSRUUuQ2FtZXJhKSA9PiB2b2lkO1xuICAgIHNldFBpeGVsUmF0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bWVyYShcbiAgICAgICAgICAgICAgICBjb25maWdEYXRhLmNhbWVyYS5mb3YsXG4gICAgICAgICAgICAgICAgY29uZmlnRGF0YS5jYW1lcmEucmF0aW8sXG4gICAgICAgICAgICAgICAgY29uZmlnRGF0YS5jYW1lcmEubmVhcixcbiAgICAgICAgICAgICAgICBjb25maWdEYXRhLmNhbWVyYS5mYXJcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNhbWVyYSA9IG5ldyBUSFJFRS5DYW1lcmEoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZlcnNpb24gPSBcIjAuMy4yXCI7XG4gICAgICAgIGNvbnNvbGUubG9nKFwiQVJuZnRUaHJlZWpzIHZlcnNpb246IFwiLCB0aGlzLnZlcnNpb24pO1xuICAgIH1cblxuICAgIGluaXRSZW5kZXJlcigpIHtcbiAgICAgICAgdGhpcy5jYW1lcmEubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0UHJvamVjdGlvbk1hdHJpeFwiLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHRoaXMuY2FtZXJhLnByb2plY3Rpb25NYXRyaXgsIGV2LmRldGFpbC5wcm9qKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMuc2NlbmUuYWRkKHRoaXMuY2FtZXJhKTtcblxuICAgICAgICBjb25zdCBsaWdodCA9IG5ldyBUSFJFRS5BbWJpZW50TGlnaHQoMHhmZmZmZmYpO1xuICAgICAgICB0aGlzLnNjZW5lLmFkZChsaWdodCk7XG5cbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldFdpbmRvd1NpemVcIiwgKF9ldjogYW55KSA9PiB7XG4gICAgICAgICAgICB0aGlzLnJlbmRlcmVyLnNldFNpemUoX2V2L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aWRlIGxvb3AnKTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgLy9sZXQgd29ybGRNYXRyaXg6IE1hdHJpeCA9IE1hdHJpeC5Gcm9tQXJyYXkodGhpcy5nZXRBcnJheU1hdHJpeCh0aGlzLndvcmxkKSk7XG4gICAgICAgICAgICBsZXQgbWF0cml4VzogTWF0cml4NCA9IG5ldyBNYXRyaXg0KCk7XG4gICAgICAgICAgICBsZXQgd29ybGRNYXRyaXg6IE1hdHJpeDQgPSBtYXRyaXhXLmZyb21BcnJheSh0aGlzLmdldEFycmF5TWF0cml4KHdvcmxkKSk7XG5cblxuICAgICAgICAgICAgaWYgKCF0aGlzLl9oYXNGb3VuZCkge1xuICAgICAgICAgICAgICAgIC8vIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuICAgICAgICAgICAgICAgIC8vICAgICB0aGlzLnRyYWNrZWRNYXRyaXguaW50ZXJwb2xhdGVkW2ldID0gdGhpcy53b3JsZFtpXTtcbiAgICAgICAgICAgICAgICAvLyB9XG4gICAgICAgICAgICAgICAgdGhpcy5faGFzRm91bmQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCB2ZWNUcmFuczogVmVjdG9yMyA9IG5ldyBWZWN0b3IzKClcbiAgICAgICAgICAgICAgICAvLy90aGlzLl9sYXN0VHJhbnNsYXRpb24gPSB3b3JsZE1hdHJpeC5nZXRUcmFuc2xhdGlvbigpOyAvLyBCYWJ5bG9uIGNvZGUuLi5cbiAgICAgICAgICAgICAgICB0aGlzLl9sYXN0VHJhbnNsYXRpb24gPSB2ZWNUcmFucy5zZXRGcm9tTWF0cml4UG9zaXRpb24od29ybGRNYXRyaXgpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgdmVjVHJhbnM6IFZlY3RvcjMgPSBuZXcgVmVjdG9yMygpXG4gICAgICAgICAgICAgICAgLy9sZXQgX2N1cnJlbnRUcmFuc2xhdGlvbjogVmVjdG9yMyA9IHdvcmxkTWF0cml4LmdldFRyYW5zbGF0aW9uKCk7IC8vIEJhYnlsb24gY29kZS4uLlxuICAgICAgICAgICAgICAgIGxldCBfY3VycmVudFRyYW5zbGF0aW9uOiBWZWN0b3IzID0gdmVjVHJhbnMuc2V0RnJvbU1hdHJpeFBvc2l0aW9uKHdvcmxkTWF0cml4KVxuXG4gICAgICAgICAgICAgICAgLy9pZiAoTWF0aC5hYnMoVmVjdG9yMy5EaXN0YW5jZShfY3VycmVudFRyYW5zbGF0aW9uLCB0aGlzLl9sYXN0VHJhbnNsYXRpb24pKSA+IHRoaXMuX2RlbHRhQWNjdXJhY3kpIHsgLy9CYWJ5bG9uIGNvZGUuLi5cbiAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMoX2N1cnJlbnRUcmFuc2xhdGlvbi5kaXN0YW5jZVRvKHRoaXMuX2xhc3RUcmFuc2xhdGlvbikpID4gdGhpcy5fZGVsdGFBY2N1cmFjeSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZURyb3BzICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZURyb3BzID4gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gX2N1cnJlbnRUcmFuc2xhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lRHJvcHMgPSAwO1xuICAgICAgICAgICAgICAgIHRoaXMuX2xhc3RUcmFuc2xhdGlvbiA9IF9jdXJyZW50VHJhbnNsYXRpb247XG4gICAgICAgICAgICAgICAgLy8gZm9yICh2YXIgaSA9IDA7IGkgPCAxNjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgLy8gICAgIHRoaXMudHJhY2tlZE1hdHJpeC5kZWx0YVtpXSA9I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zOiBudW1iZXIgfCBudWxsO1xuXG4gICAgYWxwaGEgPSAwO1xuXG4gICAgY29uc3RydWN0b3IoYWxwaGE6IG51bWJlcikge1xuICAgICAgICB0aGlzLnNldEFscGhhKGFscGhhKTtcbiAgICAgICAgdGhpcy55ID0gbnVsbDtcbiAgICAgICAgdGhpcy5zID0gbnVsbDtcbiAgICB9XG5cbiAgICBzZXRBbHBoYShhbHBoYTogbnVtYmVyKSB7XG4gICAgICAgIGlmIChhbHBoYSA8PSAwIHx8IGFscGhhID4gMS4wKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmFscGhhID0gYWxwaGE7XG4gICAgfVxuXG4gICAgZmlsdGVyKHZhbHVlOiBudW1iZXIsIHRpbWVzdGFtcDogbnVtYmVyLCBhbHBoYTogbnVtYmVyKSB7XG4gICAgICAgIGlmIChhbHBoYSkge1xuICAgICAgICAgICAgdGhpcy5zZXRBbHBoYShhbHBoYSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHM7XG4gICAgICAgIGlmICghdGhpcy55KSB7XG4gICAgICAgICAgICBzID0gdmFsdWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzID0gdGhpcy5hbHBoYSAqIHZhbHVlICsgKDEuMCAtIHRoaXMuYWxwaGEpICogdGhpcy5zITtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnkgPSB2YWx1ZTtcbiAgICAgICAgdGhpcy5zID0gcztcbiAgICAgICAgcmV0dXJuIHM7XG4gICAgfVxuXG4gICAgbGFzdFZhbHVlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy55O1xuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgT25lRXVyb0ZpbHRlciB7XG4gICAgZnJlcTogbnVtYmVyO1xuXG4gICAgbWluQ3V0T2ZmOiBudW1iZXI7XG5cbiAgICBiZXRhOiBudW1iZXI7XG5cbiAgICBkQ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URkxvYWRlcigpO1xuICAgICAgICB0aHJlZUdMVEZMb2FkZXIubG9hZCh1cmwsIChnbHRmKSA9PiB7XG4gICAgICAgICAgICBtb2RlbCA9IGdsdGYuc2NlbmU7XG4gICAgICAgICAgICBtb2RlbC5zY2FsZS5zZXQoc2NhbGUsIHNjYWxlLCBzY2FsZSk7XG4gICAgICAgICAgICBtb2RlbC5yb3RhdGlvbi54ID0gTWF0aC5QSSAvIDI7XG4gICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0geDtcbiAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSB5O1xuICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueiA9IHo7XG4gICAgICAgICAgICByb290LmFkZChtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXM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ICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICBwbGFuZS5wb3NpdGlvbi55ID0gKChtc2cuaGVpZ2h0IC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgcGxhbmUucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgcm9vdC5hZGQocGxhbmUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbGFuZS52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG5cbiAgICBwdWJsaWMgZ2V0TmFtZXMoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm5hbWVzO1xuICAgIH1cbn1cbiIsImV4cG9ydCBmdW5jdGlvb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b3ApID0+IChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwob2JqLCBwcm9wKSkiLCIvLyBkZWZpbmUgX19lc01vZHVsZSBvbiBleHBvcnRzXG5fX3dlYnBhY2tfcmVxdWlyZV9fLnIgPSAoZXhwb3J0cykgPT4ge1xuXHRpZih0eXBlb2YgU3ltYm9sICE9PSAndW5kZWZpbmVkJyAmJiBTeW1ib2wudG9TdHJpbmdUYWcpIHtcblx0XHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgU3ltYm9sLnRvU3RyaW5nVGFnLCB7IHZhbHVlOiAnTW9kdWxlJyB9KTtcblx0fVxuXHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgJ19fZXNNb2R1bGUnLCB7IHZhbHVlOiB0cnVlIH0pO1xufTsiLCJpbXBvcnQgU2NlbmVSZW5kZXJlclRKUyBmcm9tIFwiLi9TY2VuZVJlbmRlcmVyVEpTXCI7XG5pbXBvcnQgTkZUYWRkVEpTIGZyb20gXCIuL21hcmtlcm1lZGlhL05GVGFkZFRKU1wiO1xuXG5leHBvcnQgZGVmYXVsdCB7IFNjZW5lUmVuZGVyZXJUSlMsIE5GVGFkZFRKUyB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file From bd3d5ac1de6304987675e48d74327a3055f58440 Mon Sep 17 00:00:00 2001 From: kalwalt Date: Tue, 16 Nov 2021 11:02:59 +0100 Subject: [PATCH 05/11] solved the issue - sometimes was returning nothing! --- dist/ARnftThreejs.js | 33 ++++++++++++++++++++++----------- src/filters/ARnftFilter.ts | 25 +++++++++++++++++-------- src/markermedia/NFTaddTJS.ts | 14 +++++++++++++- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index 1119102..ac03820 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -178,6 +178,10 @@ var ARnftFilter = /*#__PURE__*/function () { (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ARnftFilter, [{ key: "update", value: function update(world) { + var pos = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + var rotationVec = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + var scale = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + if (!world) { this._hasFound = false; this._frameDrops = 0; @@ -201,7 +205,7 @@ var ARnftFilter = /*#__PURE__*/function () { this._lastTranslation = _currentTranslation; } - return; + return [pos, rotationVec, scale]; } this._frameDrops = 0; @@ -212,20 +216,20 @@ var ARnftFilter = /*#__PURE__*/function () { this._rotationFilter.UpdateParams(this.filterFrequency * 2, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); - var matrix = worldMatrix; + var matrix = new three__WEBPACK_IMPORTED_MODULE_4__.Matrix4(); + matrix = worldMatrix; var rotation = new three__WEBPACK_IMPORTED_MODULE_4__.Quaternion(); - var rotationVec = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); var eulerRot = new three__WEBPACK_IMPORTED_MODULE_4__.Euler(); - var position = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); - var scale = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); + var position = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(0, 0, 0); worldMatrix.decompose(position, rotation, scale); var eRot = eulerRot.setFromQuaternion(rotation); rotationVec = this._rotationFilter.Filter(eRot.toVector3()); - - var pos = this._positionFilter.Filter(position); - - return [pos, rotationVec, scale]; + console.log('pos is: ', pos); + pos = this._positionFilter.Filter(position); + console.log('position is:', pos); } + + return [pos, rotationVec, scale]; } }, { key: "getArrayMatrix", @@ -575,9 +579,16 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; mesh.visible = true; + console.log('matrix GL_RH: ', ev.detail.matrixGL_RH); - var filter = _this._filter.update(ev.detail.matrixGL_RH); + if (ev.detail.matrixGL_RH === 'undefinded') { + console.log('matrix is undefined'); + } + var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; + console.log(filter); + filter = _this._filter.update(ev.detail.matrixGL_RH); + console.log('filter is: ', filter); console.log("position from filter is: ", filter[0]); console.log("rotation from filter is: ", filter[1]); root.position.setX(filter[0].x); @@ -5213,4 +5224,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO0FBQ3BDLFlBQU0sRUFBRSxVQUQ0QjtBQUVwQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FGTztBQUdwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FIUztBQUlwQyx3QkFBa0IsRUFBRSxVQUFVLENBQUMsUUFBWCxDQUFvQixrQkFKSjtBQUtwQyxlQUF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fZnJhbWVEcm9wcyArPSAxO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJhbWVEcm9wcyA+IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2xhc3RUcmFuc2xhdGlvbiA9IF9jdXJyZW50VHJhbnNsYXRpb247XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZURyb3BzID0gMDtcbiAgICAgICAgICAgICAgICB0aGlzLl9sYXN0VHJhbnNsYXRpb24gPSBfY3VycmVudFRyYW5zbGF0aW9uO1xuICAgICAgICAgICAgICAgIC8vIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuICAgICAgICAgICAgICAgIC8vICAgICB0aGlzLnRyYWNrZWRNYXRyaXguZGVsdGFbaV0gPSB0aGlzLndvcmxkW2ldIC0gdGhpcy50cmFja2VkTWF0cml4LmludGVycG9sYXRlZFtpXTtcbiAgICAgICAgICAgICAgICAvLyAgICAgdGhpcy50cmFja2VkTWF0cml4LmludGVycG9sYXRlZFtpXSA9IHRoaXMudHJhY2tlZE1hdHJpeC5pbnRlcnBvbGF0ZWRbaV0gKyAodGhpcy50cmFja2VkTWF0cml4LmRlbHRhW2ldIC8gdGhpcy5faW50ZXJwb2xhdGlvbkZhY3Rvcik7XG4gICAgICAgICAgICAgICAgLy8gfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gbGV0IG1hdHJpeDogTWF0cml4ID0gTWF0cml4LkZyb21BcnJheSh0aGlzLmdldEFycmF5TWF0cml4KHRoaXMud29ybGQpKTtcblxuICAgICAgICAgICAgdGhpcy5fcG9zaXRpb25GaWx0ZXIuVXBkYXRlUGFyYW1zKHRoaXMuZmlsdGVyRnJlcXVlbmN5LCB0aGlzLmZpbHRlck1pbkN1dG9mZiwgdGhpcy5maWx0ZXJCZXRhLCB0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hdGUgX2luRGVsYXk6IGJvb2xlYW47XG4gICAgcHJpdmF0ZSBfdG90YWxUaW1lOiBudW1iZXI7XG4gICAgcHJpdmF0ZSBfcHJldlRpbWU6IG51bWJlcjtcblxuICAgIHByaXZhdGUgX3RpbWVPdXQ6IG51bWJlcjtcblxuICAgIGNvbnN0cnVjdG9yKHRpbWVPdXQ6IG51bWJlcikge1xuICAgICAgICB0aGlzLl90aW1lT3V0ID0gdGltZU91dDtcbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgIH1cblxuICAgIHB1YmxpYyBVcGRhdGUodGljazogYm9vbGVhbik6IGJvb2xlYW4ge1xuICAgICAgICBsZXQgdGltZTogbnVtYmVyID0gZ2V0VGltZSgpO1xuXG4gICAgICAgIGlmICghdGhpcy5faW5EZWxheSkge1xuICAgICAgICAgICAgdGhpcy5fcHJldlRpbWUgPSB0aW1lO1xuICAgICAgICAgICAgdGhpcy5fdG90YWxUaW1lID0gMDtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX3RvdGFsVGltZSArPSB0aW1lIC0gdGhpcy5fcHJldlRpbWU7XG5cbiAgICAgICAgaWYgKHRoaXMuX2luRGVsYXkgJiYgdGhpcy5fdG90YWxUaW1lID4gdGhpcy5fdGltZU91dCkge1xuICAgICAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGljaykge1xuICAgICAgICAgICAgdGhpcy5faW5EZWxheSA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuXG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbn0iLCJpbXBvcnQgeyBWZWN0b3IzIH0gZnJvbSBcInRocmVlXCI7XG5cbi8vaHR0cHM6Ly9naXRodWIuY29tL0RhcmlvT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Bmb3IgKHZhciBrZXkgaW4gdmFsdWUpIHtcbiAgICAgICAgICAgIGFycmF5W2tleV0gPSB2YWx1ZVtrZXldOyAvLy50b0ZpeGVkKDQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhcnJheTtcbiAgICB9XG59IiwiaW1wb3J0IHsgZ2V0VGltZSB9IGZyb20gXCIuLi91dGlscy9VdGlsc1wiO1xuXG5leHBvcnQgY2xhc3MgRGVsYXlhYmxlU2lnbmFsRmlsdGVyIHtcblxuICAgIHByaXZhdGUgX2luRGVsYXk6IGJvb2xlYW47XG4gICAgcHJpdmF0ZSBfdG90YWxUaW1lOiBudW1iZXI7XG4gICAgcHJpdmF0ZSBfcHJldlRpbWU6IG51bWJlcjtcblxuICAgIHByaXZhdGUgX3RpbWVPdXQ6IG51bWJlcjtcblxuICAgIGNvbnN0cnVjdG9yKHRpbWVPdXQ6IG51bWJlcikge1xuICAgICAgICB0aGlzLl90aW1lT3V0ID0gdGltZU91dDtcbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgIH1cblxuICAgIHB1YmxpYyBVcGRhdGUodGljazogYm9vbGVhbik6IGJvb2xlYW4ge1xuICAgICAgICBsZXQgdGltZTogbnVtYmVyID0gZ2V0VGltZSgpO1xuXG4gICAgICAgIGlmICghdGhpcy5faW5EZWxheSkge1xuICAgICAgICAgICAgdGhpcy5fcHJldlRpbWUgPSB0aW1lO1xuICAgICAgICAgICAgdGhpcy5fdG90YWxUaW1lID0gMDtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX3RvdGFsVGltZSArPSB0aW1lIC0gdGhpcy5fcHJldlRpbWU7XG5cbiAgICAgICAgaWYgKHRoaXMuX2luRGVsYXkgJiYgdGhpcy5fdG90YWxUaW1lID4gdGhpcy5fdGltZU91dCkge1xuICAgICAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuIC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ICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgdmFyIG1zZyA9IGV2LmRldGFpbDtcbiAgICAgICAgICAgIG1lc2gucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgIG1lc2gucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgY29uc3Qgcm9vdCA9IG5ldyBPYmplY3QzRCgpO1xuICAgICAgICByb290Lm5hbWUgPSBcInJvb3QtXCIgKyBuYW1lO1xuICAgICAgICB0aGlzLnNjZW5lLmFkZChyb290KTtcbiAgICAgICAgcm9vdC5hZGQobWVzaCk7XG4gICAgICAgIC8vbGV0IGZpbHRlciA9IFtuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApXTtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhmaWx0ZXIpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbWVzaC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdtYXRyaXggR0xfUkg6ICcsIGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICBpZihldi5kZXRhaWwubWF0cml4R0xfUkggPT09ICd1bmRlZmluZGVkJyl7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ21hdHJpeCBpcyB1bmRlZmluZWQnKTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBbbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKV07XG4gICAgICAgICAgICBjb25zb2xlLmxvZyhmaWx0ZXIpO1xuICAgICAgICAgICAgXG5cbiAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKVxuICAgICAgICAgICAgY29uc29sZS5sb2coJ2ZpbHRlciBpczogJywgZmlsdGVyKTtcbiAgICAgICAgICAgIFxuXG4gICAgICAgICAgICBjb25zb2xlLmxvZyhcInBvc2l0aW9uIGZyb20gZmlsdGVyIGlzOiBcIiwgZmlsdGVyWzBdKTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKFwicm90YXRpb24gZnJvbSBmaWx0ZXIgaXM6IFwiLCBmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1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9tIFwiLi9TY2VuZVJlbmRlcmVyVEpTXCI7XG5pbXBvcnQgTkZUYWRkVEpTIGZyb20gXCIuL21hcmtlcm1lZGlhL05GVGFkZFRKU1wiO1xuXG5leHBvcnQgZGVmYXVsdCB7IFNjZW5lUmVuZGVyZXJUSlMsIE5GVGFkZFRKUyB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/src/filters/ARnftFilter.ts b/src/filters/ARnftFilter.ts index b7f0258..89bcd6c 100644 --- a/src/filters/ARnftFilter.ts +++ b/src/filters/ARnftFilter.ts @@ -35,11 +35,13 @@ export class ARnftFilter { } public update(world: any): Vector3[] { + let pos: Vector3 = new Vector3(); + let rotationVec: Vector3 = new Vector3(); + let scale: Vector3 = new Vector3(); if (!world) { this._hasFound = false; this._frameDrops = 0; } else { - //console.log('inside loop'); //let worldMatrix: Matrix = Matrix.FromArray(this.getArrayMatrix(this.world)); let matrixW: Matrix4 = new Matrix4(); @@ -66,7 +68,7 @@ export class ARnftFilter { if (this._frameDrops > 3) { this._lastTranslation = _currentTranslation; } - return; + return [pos, rotationVec, scale]; } this._frameDrops = 0; this._lastTranslation = _currentTranslation; @@ -81,7 +83,9 @@ export class ARnftFilter { this._rotationFilter.UpdateParams(this.filterFrequency * 2, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); //let matrix: Matrix = worldMatrix; //Babylon code... - let matrix: Matrix4 = worldMatrix; + let matrix: Matrix4 = new Matrix4(); + + matrix = worldMatrix; //let rotMatrix: Matrix = matrix.getRotationMatrix(); @@ -90,15 +94,15 @@ export class ARnftFilter { //let rotation: Quaternion = new Quaternion().setFromRotationMatrix(rotMatrix); //this is wrong , will do nothing! let rotation: Quaternion = new Quaternion() ///this._root.rotation = this._rotationFilter.Filter(rotation.toEulerAngles()); // Babylon code - let rotationVec: Vector3 = new Vector3(); + //let rotationVec: Vector3 = new Vector3(); let eulerRot: Euler = new Euler(); //eulerRot.setFromQuaternion(rotation) //rotationVec = this._rotationFilter.Filter(rotation.toEulerAngles()); // Babylon code //rotationVec = this._rotationFilter.Filter(eulerRot.toVector3()); // or even simple decompose the worldMatrix into position, quaternion and scale with decompose - let position: Vector3 = new Vector3(); - let scale: Vector3 = new Vector3(); + let position: Vector3 = new Vector3(0, 0, 0); + //let scale: Vector3 = new Vector3(); worldMatrix.decompose(position, rotation, scale) let eRot = eulerRot.setFromQuaternion(rotation) rotationVec = this._rotationFilter.Filter(eRot.toVector3()); @@ -106,15 +110,20 @@ export class ARnftFilter { //let pos = Vector3.TransformCoordinates(new Vector3(0, 0, 0), matrix); //this._root.setAbsolutePosition(this._positionFilter.Filter(position)); - let pos = this._positionFilter.Filter(position) + //let pos: Vector3 = new Vector3(0,0,0); + console.log('pos is: ', pos); + + pos = this._positionFilter.Filter(position) + console.log('position is:', pos); /*let out: Matrix4 = new Matrix4(); let rotationMatrix = new Matrix4(); //rotationMatrix.makeRotationFromQuaternion() let finalRot = new Quaternion(); finalRot.setFromRotationMatrix(rotationMatrix)*/ //out.compose(pos, ) /// will see if output the matrix in a future... - return [pos, rotationVec, scale] + //return [pos, rotationVec, scale] } + return [pos, rotationVec, scale] } protected getArrayMatrix(value: any): any { var array: any = []; diff --git a/src/markermedia/NFTaddTJS.ts b/src/markermedia/NFTaddTJS.ts index b2607e7..9878bb0 100644 --- a/src/markermedia/NFTaddTJS.ts +++ b/src/markermedia/NFTaddTJS.ts @@ -73,11 +73,23 @@ export default class NFTaddTJS { root.name = "root-" + name; this.scene.add(root); root.add(mesh); + //let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; + //console.log(filter); this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; mesh.visible = true; + console.log('matrix GL_RH: ', ev.detail.matrixGL_RH); + if(ev.detail.matrixGL_RH === 'undefinded'){ + console.log('matrix is undefined'); + + } + let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; + console.log(filter); + - let filter = this._filter.update(ev.detail.matrixGL_RH) + filter = this._filter.update(ev.detail.matrixGL_RH) + console.log('filter is: ', filter); + console.log("position from filter is: ", filter[0]); console.log("rotation from filter is: ", filter[1]); From 91894f93ff17a60ed09127c10abc8640fa3e02a6 Mon Sep 17 00:00:00 2001 From: kalwalt Date: Tue, 16 Nov 2021 18:12:09 +0100 Subject: [PATCH 06/11] cleaning the code --- dist/ARnftThreejs.js | 12 +-------- src/filters/ARnftFilter.ts | 49 +++--------------------------------- src/markermedia/NFTaddTJS.ts | 15 +++-------- 3 files changed, 8 insertions(+), 68 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index ac03820..62c93e1 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -224,9 +224,7 @@ var ARnftFilter = /*#__PURE__*/function () { worldMatrix.decompose(position, rotation, scale); var eRot = eulerRot.setFromQuaternion(rotation); rotationVec = this._rotationFilter.Filter(eRot.toVector3()); - console.log('pos is: ', pos); pos = this._positionFilter.Filter(position); - console.log('position is:', pos); } return [pos, rotationVec, scale]; @@ -579,16 +577,8 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; mesh.visible = true; - console.log('matrix GL_RH: ', ev.detail.matrixGL_RH); - - if (ev.detail.matrixGL_RH === 'undefinded') { - console.log('matrix is undefined'); - } - var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; - console.log(filter); filter = _this._filter.update(ev.detail.matrixGL_RH); - console.log('filter is: ', filter); console.log("position from filter is: ", filter[0]); console.log("rotation from filter is: ", filter[1]); root.position.setX(filter[0].x); @@ -5224,4 +5214,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingUR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A9IDA7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIC8vbGV0IHdvcmxkTWF0cml4OiBNYXRyaXggPSBNYXRyaXguRnJvbUFycmF5KHRoaXMuZ2V0QXJyYXlNYXRyaXgodGhpcy53b3JsZCkpO1xuICAgICAgICAgICAgbGV0IG1hdHJpeFc6IE1hdHJpeDQgPSBuZXcgTWF0cml4NCgpO1xuICAgICAgICAgICAgbGV0IHdvcmxkTWF0cml4OiBNYXRyaXg0ID0gbWF0cml4Vy5mcm9tQXJyYXkodGhpcy5nZXRBcnJheU1hdHJpeCh3b3JsZCkpO1xuXG5cbiAgICAgICAgICAgIGlmICghdGhpcy5faGFzRm91bmQpIHtcbiAgICAgICAgICAgICAgICAvLyBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcbiAgICAgICAgICAgICAgICAvLyAgICAgdGhpcy50cmFja2VkTWF0cml4LmludGVycG9sYXRlZFtpXSA9IHRoaXMud29ybGRbaV07XG4gICAgICAgICAgICAgICAgLy8gfVxuICAgICAgICAgICAgICAgIHRoaXMuX2hhc0ZvdW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBsZXQgdmVjVHJhbnM6IFZlY3RvcjMgPSBuZXcgVmVjdG9yMygpXG4gICAgICAgICAgICAgICAgLy8vdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gd29ybGRNYXRyaXguZ2V0VHJhbnNsYXRpb24oKTsgLy8gQmFieWxvbiBjb2RlLi4uXG4gICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gdmVjVHJhbnMuc2V0RnJvbU1hdHJpeFBvc2l0aW9uKHdvcmxkTWF0cml4KVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHZlY1RyYW5zOiBWZWN0b3IzID0gbmV3IFZlY3RvcjMoKVxuICAgICAgICAgICAgICAgIC8vbGV0IF9jdXJ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ZSBfcHJldlRpbWU6IG51bWJlcjtcblxuICAgIHByaXZhdGUgX3RpbWVPdXQ6IG51bWJlcjtcblxuICAgIGNvbnN0cnVjdG9yKHRpbWVPdXQ6IG51bWJlcikge1xuICAgICAgICB0aGlzLl90aW1lT3V0ID0gdGltZU91dDtcbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgIH1cblxuICAgIHB1YmxpYyBVcGRhdGUodGljazogYm9vbGVhbik6IGJvb2xlYW4ge1xuICAgICAgICBsZXQgdGltZTogbnVtYmVyID0gZ2V0VGltZSgpO1xuXG4gICAgICAgIGlmICghdGhpcy5faW5EZWxheSkge1xuICAgICAgICAgICAgdGhpcy5fcHJldlRpbWUgPSB0aW1lO1xuICAgICAgICAgICAgdGhpcy5fdG90YWxUaW1lID0gMDtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX3RvdGFsVGltZSArPSB0aW1lIC0gdGhpcy5fcHJldlRpbWU7XG5cbiAgICAgICAgaWYgKHRoaXMuX2luRGVsYXkgJiYgdGhpcy5fdG90YWxUaW1lID4gdGhpcy5fdGltZU91dCkge1xuICAgICAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGljaykge1xuICAgICAgICAgICAgdGhpcy5faW5EZWxheSA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5faW5EZWxheSA9IGZhbHNlO1xuXG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbn0iLCJpbXBvcnQgeyBWZWN0b3IzIH0gZnJvbSBcInRocmVlXCI7XG5cbi8vaHR0cHM6Ly9naXRodWIuY29tL0RhcmlvTWF6emFudGkvT25lRXVyb0ZpbHRlclVuaXR5L2Jsb2IvbWFzdGVyL0Fzc2V0cy9TY3JpcHRzL09uZUV1cm9GaWx0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IgKyBuYW1lO1xuICAgICAgICB0aGlzLnNjZW5lLmFkZChyb290KTtcbiAgICAgICAgcm9vdC5hZGQobWVzaCk7XG4gICAgICAgIC8vbGV0IGZpbHRlciA9IFtuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApXTtcbiAgICAgICAgLy9jb25zb2xlLmxvZyhmaWx0ZXIpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbWVzaC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdtYXRyaXggR0xfUkg6ICcsIGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICBpZihldi5kZXRhaWwubWF0cml4R0xfUkggPT09ICd1bmRlZmluZGVkJyl7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ21hdHJpeCBpcyB1bmRlZmluZWQnKTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBbbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKV07XG4gICAgICAgICAgICBjb25zb2xlLmxvZyhmaWx0ZXIpO1xuICAgICAgICAgICAgXG5cbiAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKVxuICAgICAgICAgICAgY29uc29sZS5sb2coJ2ZpbHRlciBpczogJywgZmlsdGVyKTtcbiAgICAgICAgICAgIFxuXG4gICAgICAgICAgICBjb25zb2xlLmxvZyhcInBvc2l0aW9uIGZyb20gZmlsdGVyIGlzOiBcIiwgZmlsdGVyWzBdKTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKFwicm90YXRpb24gZnJvbSBmaWx0ZXIgaXM6IFwiLCBmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIG1lc2gudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5hbWVzLnB1c2gobmFtZSk7XG4gICAgICAgIHRoaXMuZW50aXRpZXMucHVzaCh7IG5hbWUgfSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGFkZE1vZGVsIGZ1bmN0aW9uIHdpbGwgYWRkIGEgbW9kZWwgdG8gdGhlIFJlbmRlcmVyIHJvb3QuIFlvdSBuZWVkIHRvIGFzc29jaWF0ZSBhIG5hbWU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TFRGTG9hZGVyID0gbmV3IEdMVEZMb2FkZXIoKTtcbiAgICAgICAgdGhyZWVHTFRGTG9hZGVyLmxvYWQodXJsLCAoZ2x0ZikgPT4ge1xuICAgICAgICAgICAgbW9kZWwgPSBnbHRmLnNjZW5lO1xuICAgICAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE5GVERhdGEtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgdmFyIG1zZyA9IGV2LmRldGFpbDtcbiAgICAgICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi55ID0gKChtc2cuaGVpZ2h0IC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnggPSAoKG1zZy53aWR0aCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgY2FsbGJhY2soZ2x0Zik7XG4gICAgICAgICAgICByb290LmFkZChtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5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R2VvbSwgbWF0KTtcbiAgICAgICAgcGxhbmUuc2NhbGUuc2V0KHNjYWxlLCBzY2FsZSwgc2NhbGUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICBwbGFuZS5wb3NpdGlvbi55ID0gKChtc2cuaGVpZ2h0IC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgcGxhbmUucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgcm9vdC5hZGQocGxhbmUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbGFuZS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cdHJldHVybiB0aGlzIHx8IG5ldyBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuXHR9IGNhdGNoIChlKSB7XG5cdFx0aWYgKHR5cGVvZiB3aW5kb3cgPT09ICdvYmplY3QnKSByZXR1cm4gd2luZG93O1xuXHR9XG59KSgpOyIsIl9fd2VicGFja19yZXF1aXJlX18ubyA9IChvYmosIHByb3ApID0+IChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwob2JqLCBwcm9wKSkiLCIvLyBkZWZpbmUgX19lc01vZHVsZSBvbiBleHBvcnRzXG5fX3dlYnBhY2tfcmVxdWlyZV9fLnIgPSAoZXhwb3J0cykgPT4ge1xuXHRpZih0eXBlb2YgU3ltYm9sICE9PSAndW5kZWZpbmVkJyAmJiBTeW1ib2wudG9TdHJpbmdUYWcpIHtcblx0XHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgU3ltYm9sLnRvU3RyaW5nVGFnLCB7IHZhbHVlOiAnTW9kdWxlJyB9KTtcblx0fVxuXHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgJ19fZXNNb2R1bGUnLCB7IHZhbHVlOiB0cnVlIH0pO1xufTsiLCJpbXBvcnQgU2NlbmVSZW5kZXJlclRKUyBmcm9tIFwiLi9TY2VuZVJlbmRlcmVyVEpTXCI7XG5pbXBvcnQgTkZUYWRkVEpTIGZyb20gXCIuL21hcmtlcm1lZGlhL05GVGFkZFRKU1wiO1xuXG5leHBvcnQgZGVmYXVsdCB7IFNjZW5lUmVuZGVyZXJUSlMsIE5GVGFkZFRKUyB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQT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Btb2RlbCA9IGdsdGYuc2NlbmU7XG4gICAgICAgICAgICBtb2RlbC5zY2FsZS5zZXQoc2NhbGUsIHNjYWxlLCBzY2FsZSk7XG4gICAgICAgICAgICBtb2RlbC5yb3RhdGlvbi54ID0gTWF0aC5QSSAvIDI7XG4gICAgICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSAoKG1zZy5oZWlnaHQgLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByb290LmFkZChtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCAr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Lm5hbWUgPSBcInJvb3QtXCIgKyBuYW1lO1xuICAgICAgICByb290Lm1hdHJpeEF1dG9VcGRhdGUgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5zY2VuZS5hZGQocm9vdCk7XG4gICAgICAgIGxldCBtb2RlbDogYW55O1xuICAgICAgICAvKiBMb2FkIE1vZGVsICovXG4gICAgICAgIGNvbnN0IHRocmVlR0xURkxvYWRlciA9IG5ldyBHTFRGTG9hZGVyKCk7XG4gICAgICAgIHRocmVlR0xURkxvYWRlci5sb2FkKHVybCwgKGdsdGYpID0+IHtcbiAgICAgICAgICAgIG1vZGVsID0gZ2x0Zi5zY2VuZTtcbiAgICAgICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRORlREYXRhLVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0gKChtc2cud2lkdGggLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGNhbGxiYWNrKGdsdGYpO1xuICAgICAgICAgICAgcm9vdC5hZGQobW9kZWwpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE1hdHJpeEdMX1JILVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgY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a/src/filters/ARnftFilter.ts b/src/filters/ARnftFilter.ts index 89bcd6c..7b61659 100644 --- a/src/filters/ARnftFilter.ts +++ b/src/filters/ARnftFilter.ts @@ -42,27 +42,16 @@ export class ARnftFilter { this._hasFound = false; this._frameDrops = 0; } else { - - //let worldMatrix: Matrix = Matrix.FromArray(this.getArrayMatrix(this.world)); let matrixW: Matrix4 = new Matrix4(); let worldMatrix: Matrix4 = matrixW.fromArray(this.getArrayMatrix(world)); - - if (!this._hasFound) { - // for (var i = 0; i < 16; i++) { - // this.trackedMatrix.interpolated[i] = this.world[i]; - // } this._hasFound = true; let vecTrans: Vector3 = new Vector3() - ///this._lastTranslation = worldMatrix.getTranslation(); // Babylon code... this._lastTranslation = vecTrans.setFromMatrixPosition(worldMatrix) } else { let vecTrans: Vector3 = new Vector3() - //let _currentTranslation: Vector3 = worldMatrix.getTranslation(); // Babylon code... let _currentTranslation: Vector3 = vecTrans.setFromMatrixPosition(worldMatrix) - - //if (Math.abs(Vector3.Distance(_currentTranslation, this._lastTranslation)) > this._deltaAccuracy) { //Babylon code... if (Math.abs(_currentTranslation.distanceTo(this._lastTranslation)) > this._deltaAccuracy) { this._frameDrops += 1; if (this._frameDrops > 3) { @@ -72,56 +61,26 @@ export class ARnftFilter { } this._frameDrops = 0; this._lastTranslation = _currentTranslation; - // for (var i = 0; i < 16; i++) { - // this.trackedMatrix.delta[i] = this.world[i] - this.trackedMatrix.interpolated[i]; - // this.trackedMatrix.interpolated[i] = this.trackedMatrix.interpolated[i] + (this.trackedMatrix.delta[i] / this._interpolationFactor); - // } } - // let matrix: Matrix = Matrix.FromArray(this.getArrayMatrix(this.world)); - this._positionFilter.UpdateParams(this.filterFrequency, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); this._rotationFilter.UpdateParams(this.filterFrequency * 2, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); - - //let matrix: Matrix = worldMatrix; //Babylon code... let matrix: Matrix4 = new Matrix4(); matrix = worldMatrix; - - //let rotMatrix: Matrix = matrix.getRotationMatrix(); - //let rotMatrix: Matrix4 = new Matrix4(); // this is not neede because we decompose the matrix - //rotMatrix.extractRotation(matrix); - //let rotation: Quaternion = new Quaternion().setFromRotationMatrix(rotMatrix); //this is wrong , will do nothing! let rotation: Quaternion = new Quaternion() - ///this._root.rotation = this._rotationFilter.Filter(rotation.toEulerAngles()); // Babylon code - //let rotationVec: Vector3 = new Vector3(); let eulerRot: Euler = new Euler(); - //eulerRot.setFromQuaternion(rotation) - //rotationVec = this._rotationFilter.Filter(rotation.toEulerAngles()); // Babylon code - //rotationVec = this._rotationFilter.Filter(eulerRot.toVector3()); - - // or even simple decompose the worldMatrix into position, quaternion and scale with decompose let position: Vector3 = new Vector3(0, 0, 0); - //let scale: Vector3 = new Vector3(); + + // or even simple decompose the worldMatrix into position, quaternion and scale with decompose worldMatrix.decompose(position, rotation, scale) let eRot = eulerRot.setFromQuaternion(rotation) rotationVec = this._rotationFilter.Filter(eRot.toVector3()); - //let pos = Vector3.TransformCoordinates(new Vector3(0, 0, 0), matrix); - - //this._root.setAbsolutePosition(this._positionFilter.Filter(position)); - //let pos: Vector3 = new Vector3(0,0,0); - console.log('pos is: ', pos); + //console.log('pos is: ', pos); pos = this._positionFilter.Filter(position) - console.log('position is:', pos); - /*let out: Matrix4 = new Matrix4(); - let rotationMatrix = new Matrix4(); - //rotationMatrix.makeRotationFromQuaternion() - let finalRot = new Quaternion(); - finalRot.setFromRotationMatrix(rotationMatrix)*/ - //out.compose(pos, ) /// will see if output the matrix in a future... - //return [pos, rotationVec, scale] + //console.log('position is:', pos); } return [pos, rotationVec, scale] } diff --git a/src/markermedia/NFTaddTJS.ts b/src/markermedia/NFTaddTJS.ts index 9878bb0..f782d35 100644 --- a/src/markermedia/NFTaddTJS.ts +++ b/src/markermedia/NFTaddTJS.ts @@ -73,23 +73,14 @@ export default class NFTaddTJS { root.name = "root-" + name; this.scene.add(root); root.add(mesh); - //let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - //console.log(filter); this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; mesh.visible = true; - console.log('matrix GL_RH: ', ev.detail.matrixGL_RH); - if(ev.detail.matrixGL_RH === 'undefinded'){ - console.log('matrix is undefined'); - - } + //console.log('matrix GL_RH: ', ev.detail.matrixGL_RH); let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - console.log(filter); - - + //console.log(filter); filter = this._filter.update(ev.detail.matrixGL_RH) - console.log('filter is: ', filter); - + //console.log('filter is: ', filter); console.log("position from filter is: ", filter[0]); console.log("rotation from filter is: ", filter[1]); From 657f66d6571f25ec253551b0d2c167325208eece Mon Sep 17 00:00:00 2001 From: kalwalt Date: Wed, 17 Nov 2021 12:25:26 +0100 Subject: [PATCH 07/11] added oef filter to all methods - oef setter and getter --- dist/ARnftThreejs.js | 118 +++++++++++++++++++++++------ src/markermedia/NFTaddTJS.ts | 124 ++++++++++++++++++++++++------- types/markermedia/NFTaddTJS.d.ts | 3 + 3 files changed, 193 insertions(+), 52 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index 62c93e1..5af71bc 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -558,6 +558,7 @@ var NFTaddTJS = /*#__PURE__*/function () { this.uuid = uuid; this.names = []; this._filter = new _filters_ARnftFilter__WEBPACK_IMPORTED_MODULE_5__.ARnftFilter(); + this._oef = false; } (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(NFTaddTJS, [{ @@ -577,17 +578,22 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; mesh.visible = true; - var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; - filter = _this._filter.update(ev.detail.matrixGL_RH); - console.log("position from filter is: ", filter[0]); - console.log("rotation from filter is: ", filter[1]); - root.position.setX(filter[0].x); - root.position.setY(filter[0].y); - root.position.setZ(filter[0].z); - root.rotation.setFromVector3(filter[1]); - root.scale.setX(filter[2].x); - root.scale.setY(filter[2].y); - root.scale.setZ(filter[2].z); + + if (_this._oef === true) { + var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; + filter = _this._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); + root.rotation.setFromVector3(filter[1]); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); + } else { + root.matrixAutoUpdate = false; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { root.visible = objVisibility; @@ -605,7 +611,6 @@ var NFTaddTJS = /*#__PURE__*/function () { var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); var model; var threeGLTFLoader = new three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__.GLTFLoader(); @@ -625,8 +630,22 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; model.visible = true; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + + if (_this2._oef === true) { + var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; + filter = _this2._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); + root.rotation.setFromVector3(filter[1]); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); + } else { + root.matrixAutoUpdate = false; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { root.visible = objVisibility; @@ -641,7 +660,6 @@ var NFTaddTJS = /*#__PURE__*/function () { var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); var model; var threeGLTFLoader = new three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__.GLTFLoader(); @@ -660,8 +678,22 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; model.visible = true; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + + if (_this3._oef === true) { + var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; + filter = _this3._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); + root.rotation.setFromVector3(filter[1]); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); + } else { + root.matrixAutoUpdate = false; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { root.visible = objVisibility; @@ -672,9 +704,10 @@ var NFTaddTJS = /*#__PURE__*/function () { }, { key: "addImage", value: function addImage(imageUrl, name, color, scale, configs, objVisibility) { + var _this4 = this; + var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(configs.w, configs.h, configs.ws, configs.hs); var texture = new three__WEBPACK_IMPORTED_MODULE_2__.TextureLoader().load(imageUrl); @@ -693,8 +726,22 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; plane.visible = true; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + + if (_this4._oef === true) { + var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; + filter = _this4._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); + root.rotation.setFromVector3(filter[1]); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); + } else { + root.matrixAutoUpdate = false; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { root.visible = objVisibility; @@ -705,9 +752,10 @@ var NFTaddTJS = /*#__PURE__*/function () { }, { key: "addVideo", value: function addVideo(id, name, scale, configs, objVisibility) { + var _this5 = this; + var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); var ARVideo = document.getElementById(id); var texture = new three__WEBPACK_IMPORTED_MODULE_2__.VideoTexture(ARVideo); @@ -728,8 +776,22 @@ var NFTaddTJS = /*#__PURE__*/function () { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { root.visible = true; plane.visible = true; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + + if (_this5._oef === true) { + var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; + filter = _this5._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); + root.rotation.setFromVector3(filter[1]); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); + } else { + root.matrixAutoUpdate = false; + var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); + _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { root.visible = objVisibility; @@ -742,6 +804,14 @@ var NFTaddTJS = /*#__PURE__*/function () { value: function getNames() { return this.names; } + }, { + key: "oef", + get: function get() { + return this._oef; + }, + set: function set(enable) { + this._oef = enable; + } }]); return NFTaddTJS; @@ -5214,4 +5284,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO0FBQ3BDLFlBQU0sRUFBRSxVQUQ0QjtBQUVwQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FGTztBQUdwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FIUztBQUlwQyx3QkFBa0IsRUFBRSxVQUFVLENBQUMsUUFBWCxDQUFvQixrQkFKSjtBQUtwQyxlQUFTLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsU0FMSztBQU1wQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQV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LmZyb21BcnJheSh0aGlzLmdldEFycmF5TWF0cml4KHdvcmxkKSk7XG4gICAgICAgICAgICBpZiAoIXRoaXMuX2hhc0ZvdW5kKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5faGFzRm91bmQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCB2ZWNUcmFuczogVmVjdG9yMyA9IG5ldyBWZWN0b3IzKClcbiAgICAgICAgICAgICAgICB0aGlzLl9sYXN0VHJhbnNsYXRpb24gPSB2ZWNUcmFucy5zZXRGcm9tTWF0cml4UG9zaXRpb24od29ybGRNYXRyaXgpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgdmVjVHJhbnM6IFZlY3RvcjMgPSBuZXcgVmVjdG9yMygpXG4gICAgICAgICAgICAgICAgbGV0IF9jdXJyZW50VHJhbnNsYXRpb246IFZlY3RvcjMgPSB2ZWNUcmFucy5zZXRGcm9tTWF0cml4UG9zaXRpb24od29ybGRNYXRyaXgpXG4gICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKF9jdXJyZW50VHJhbnNsYXRpb24uZGlzdGFuY2VUbyh0aGlzLl9sYXN0VHJhbnNsYXRpb24pKSA+IHRoaXMuX2RlbHRhQWNjdXJhY3kpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZnJhbWVEcm9wcyArPSAxO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJhbWVEcm9wcyA+IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2xhc3RUcmFuc2xhdGlvbiA9IF9jdXJyZW50VHJhbnNsYXRpb247XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtwb3MsIHJvdGF0aW9uVmVjLCBzY2FsZV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lRHJvcHMgPSAwO1xuICAg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aW9uKVxuICAgICAgICAgICAgcm90YXRpb25WZWMgPSB0aGlzLl9yb3RhdGlvbkZpbHRlci5GaWx0ZXIoZVJvdC50b1ZlY3RvcjMoKSk7XG5cbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ3BvcyBpczogJywgcG9zKTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgcG9zID0gdGhpcy5fcG9zaXRpb25GaWx0ZXIuRmlsdGVyKHBvc2l0aW9uKVxuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygncG9zaXRpb24gaXM6JywgcG9zKTsgICAgICAgIFxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbcG9zLCByb3RhdGlvblZlYywgc2NhbGVdXG4gICAgfVxuICAgIHByb3RlY3RlZCBnZXRBcnJheU1hdHJpeCh2YWx1ZTogYW55KTogYW55IHtcbiAgICAgICAgdmFyIGFycmF5OiBhbnkgPSBbXTtcbiAgICAgICAgZm9yICh2YXIga2V5IGluIHZhbHVlKSB7XG4gICAgICAgICAgICBhcnJheVtrZXldID0gdmFsdWVba2V5XTsgLy8udG9GaXhlZCg0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYXJyYXk7XG4gICAgfVxufSIsImltcG9ydCB7IGdldFRpbWUgfSBmcm9tIFwiLi4vdXRpbHMvVXRpbHNcIjtcblxuZXhwb3J0IGNsYXNzIERlbGF5YWJsZVNpZ25hbEZpbHRlciB7XG5cbiAgICBwcml2YXRlIF9pbkRlbGF5OiBib29sZWFuO1xuICAgIHByaXZhdGUgX3RvdGFsVGltZTogbnVtYmVyO1xuICAgIHByaXZhdGUgX3ByZXZUaW1lOiBudW1iZXI7XG5cbiAgICBwcml2YXRlIF90aW1lT3V0OiBudW1iZXI7XG5cbiAgICBjb25zdHJ1Y3Rvcih0aW1lT3V0OiBudW1iZXIpIHtcbiAgICAgICAgdGhpcy5fdGltZU91dCA9IHRpbWVPdXQ7XG4gICAgICAgIHRoaXMuX2luRGVsYXkgPSBmYWxzZTt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b290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKChmaWx0ZXJbMF0ueikpO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRZKChmaWx0ZXJbMl0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WigoZmlsdGVyWzJdLnopKTsgXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlOyAgICAgICAgIFxuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpOyBcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgbWVzaC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICAgICAgdGhpcy5lbnRpdGllcy5wdXNoKHsgbmFtZSB9KTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgYWRkTW9kZWwgZnVuY3Rpb24gd2lsb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dmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSAoKG1zZy5oZWlnaHQgLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByb290LmFkZChtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBpZih0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKSAgICBcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKChmaWx0ZXJbMF0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WigoZmlsdGVyWzBdLnopKTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKChmaWx0ZXJbMl0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WSgoZmlsdGVyWzJdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7IFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290Lm1hdHJpeEF1dG9VcGRhdGUgPSBmYWxzZTsgICAgICAgICBcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTsgXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRNb2RlbFdpdGhDYWxsYmFjayBmdW5jdGlvbiB3aWxsIGFkZCBhIG1vZGVsIHRvIHRoZSBSZW5kZXJlciByb290LiBZb3UgbmVlZCB0byBhc3NvY2lhdGUgYSBuYW1lIG9mIHRoZSBFbnRpdHkuXG4gICAgICogWW91IGNhbiBtb2RpZnkgdGhlIG1vZGVsIHJ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ICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSAoKG1zZy5oZWlnaHQgLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjYWxsYmFjayhnbHRmKTtcbiAgICAgICAgICAgIHJvb3QuYWRkKG1vZGVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmKHRoaXMuX29lZiA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBbbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKV07XG4gICAgICAgICAgICAgICAgZmlsdGVyID0gdGhpcy5fZmlsdGVyLnVwZGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpICBcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKChmaWx0ZXJbMF0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WigoZmlsdGVyWzBdLnopKTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKChmaWx0ZXJbMl0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WSgoZmlsdGVyWzJdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7IFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290Lm1hdHJpeEF1dG9VcGRhdGUgPSBmYWxzZTsgICAgICAgICBcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTsgXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRJbWFnZSBmdW5jdGlvbiB3aWxsIGFkZCBhbiBpbWFnZSB0byB0aGUgUmVuZGVyZXIgcm9vdC4gWW91IG5lZWQgdG8gYXNzb2NpYXRlIGEgbmFtZSBvZiB0aGUgRW50aXR5LlxuICAgICAqIEBwYXJhbSBpbWFnZVVybCB1cmwgb2YgdGhlIGltYWdlLlxuICAgICAqIEBwYXJhbSBuYW1lIHRoZSBuYW1lIG9mIHRoZSBFb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GFuZUdlb20sIG1hdGVyaWFsKTtcbiAgICAgICAgcGxhbmUuc2NhbGUuc2V0KHNjYWxlLCBzY2FsZSwgc2NhbGUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICBwbGFuZS5wb3NpdGlvbi55ID0gKChtc2cuaGVpZ2h0IC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgcGxhbmUucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgcm9vdC5hZGQocGxhbmUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBpZih0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKVxuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WCgoZmlsdGVyWzBdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKChmaWx0ZXJbMF0ueikpO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRZKChmaWx0ZXJbMl0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WigoZmlsdGVyWzJdLnopKTsgXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlOyAgICAgICAgIFxuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpOyBcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5hbWVzLnB1c2gobmFtZSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGFkZFZpZGVvIGZ1bmN0aW9uIHdpbGwgYWRkIGEgdmlkZW8gdG8gdGhlIFJlbmRlcmVyIHJvb3QuIFlvdSBuZWVkIHRvIGFzc29jaWF0Z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XIudXBkYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCkgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRYKChmaWx0ZXJbMF0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WSgoZmlsdGVyWzBdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5yb3RhdGlvbi5zZXRGcm9tVmVjdG9yMyhmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WCgoZmlsdGVyWzJdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRaKChmaWx0ZXJbMl0ueikpOyBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm9vdC5tYXRyaXhBdXRvVXBkYXRlID0gZmFsc2U7ICAgICAgICAgXG4gICAgICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICBVdGlscy5zZXRNYXRyaXgocm9vdC5tYXRyaXgsIG1hdHJpeCk7IFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbGFuZS52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAg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tcblx0fVxuXHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgJ19fZXNNb2R1bGUnLCB7IHZhbHVlOiB0cnVlIH0pO1xufTsiLCJpbXBvcnQgU2NlbmVSZW5kZXJlclRKUyBmcm9tIFwiLi9TY2VuZVJlbmRlcmVyVEpTXCI7XG5pbXBvcnQgTkZUYWRkVEpTIGZyb20gXCIuL21hcmtlcm1lZGlhL05GVGFkZFRKU1wiO1xuXG5leHBvcnQgZGVmYXVsdCB7IFNjZW5lUmVuZGVyZXJUSlMsIE5GVGFkZFRKUyB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/src/markermedia/NFTaddTJS.ts b/src/markermedia/NFTaddTJS.ts index f782d35..b283306 100644 --- a/src/markermedia/NFTaddTJS.ts +++ b/src/markermedia/NFTaddTJS.ts @@ -44,6 +44,7 @@ export default class NFTaddTJS { private target: EventTarget; private uuid: string; private _filter: ARnftFilter; + private _oef: boolean; /** * The NFTaddTJS constuctor, you need to pass the uuid from the ARnft instance. @@ -55,6 +56,7 @@ export default class NFTaddTJS { this.uuid = uuid; this.names = []; this._filter = new ARnftFilter(); + this._oef = false; } /** @@ -76,22 +78,21 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; mesh.visible = true; - //console.log('matrix GL_RH: ', ev.detail.matrixGL_RH); - let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - //console.log(filter); - filter = this._filter.update(ev.detail.matrixGL_RH) - //console.log('filter is: ', filter); - - console.log("position from filter is: ", filter[0]); - console.log("rotation from filter is: ", filter[1]); - - root.position.setX((filter[0].x)); - root.position.setY((filter[0].y)); - root.position.setZ((filter[0].z)); - root.rotation.setFromVector3(filter[1]); - root.scale.setX((filter[2].x)); - root.scale.setY((filter[2].y)); - root.scale.setZ((filter[2].z)); + if(this._oef === true) { + let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; + filter = this._filter.update(ev.detail.matrixGL_RH) + root.position.setX((filter[0].x)); + root.position.setY((filter[0].y)); + root.position.setZ((filter[0].z)); + root.rotation.setFromVector3(filter[1]); + root.scale.setX((filter[2].x)); + root.scale.setY((filter[2].y)); + root.scale.setZ((filter[2].z)); + } else { + root.matrixAutoUpdate = false; + const matrix = Utils.interpolate(ev.detail.matrixGL_RH); + Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { root.visible = objVisibility; @@ -111,7 +112,6 @@ export default class NFTaddTJS { public addModel(url: string, name: string, scale: number, objVisibility: boolean) { const root = new Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); let model: any; /* Load Model */ @@ -130,8 +130,21 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; model.visible = true; - const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + if(this._oef === true) { + let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; + filter = this._filter.update(ev.detail.matrixGL_RH) + root.position.setX((filter[0].x)); + root.position.setY((filter[0].y)); + root.position.setZ((filter[0].z)); + root.rotation.setFromVector3(filter[1]); + root.scale.setX((filter[2].x)); + root.scale.setY((filter[2].y)); + root.scale.setZ((filter[2].z)); + } else { + root.matrixAutoUpdate = false; + const matrix = Utils.interpolate(ev.detail.matrixGL_RH); + Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { root.visible = objVisibility; @@ -151,7 +164,6 @@ export default class NFTaddTJS { public addModelWithCallback(url: string, name: string, callback: (gltf: any) =>{} , objVisibility: boolean) { const root = new Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); let model: any; /* Load Model */ @@ -169,8 +181,21 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; model.visible = true; - const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + if(this._oef === true) { + let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; + filter = this._filter.update(ev.detail.matrixGL_RH) + root.position.setX((filter[0].x)); + root.position.setY((filter[0].y)); + root.position.setZ((filter[0].z)); + root.rotation.setFromVector3(filter[1]); + root.scale.setX((filter[2].x)); + root.scale.setY((filter[2].y)); + root.scale.setZ((filter[2].z)); + } else { + root.matrixAutoUpdate = false; + const matrix = Utils.interpolate(ev.detail.matrixGL_RH); + Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { root.visible = objVisibility; @@ -198,7 +223,6 @@ export default class NFTaddTJS { ) { const root = new Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); const planeGeom = new PlaneGeometry(configs.w, configs.h, configs.ws, configs.hs); const texture = new TextureLoader().load(imageUrl); @@ -214,8 +238,21 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; plane.visible = true; - const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + if(this._oef === true) { + let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; + filter = this._filter.update(ev.detail.matrixGL_RH) + root.position.setX((filter[0].x)); + root.position.setY((filter[0].y)); + root.position.setZ((filter[0].z)); + root.rotation.setFromVector3(filter[1]); + root.scale.setX((filter[2].x)); + root.scale.setY((filter[2].y)); + root.scale.setZ((filter[2].z)); + } else { + root.matrixAutoUpdate = false; + const matrix = Utils.interpolate(ev.detail.matrixGL_RH); + Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { root.visible = objVisibility; @@ -235,7 +272,6 @@ export default class NFTaddTJS { public addVideo(id: string, name: string, scale: number, configs: IPlaneConfig, objVisibility: boolean) { const root = new Object3D(); root.name = "root-" + name; - root.matrixAutoUpdate = false; this.scene.add(root); const ARVideo: HTMLVideoElement = document.getElementById(id) as HTMLVideoElement; const texture = new VideoTexture(ARVideo as HTMLVideoElement); @@ -253,8 +289,21 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; plane.visible = true; - const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + if(this._oef === true) { + let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; + filter = this._filter.update(ev.detail.matrixGL_RH) + root.position.setX((filter[0].x)); + root.position.setY((filter[0].y)); + root.position.setZ((filter[0].z)); + root.rotation.setFromVector3(filter[1]); + root.scale.setX((filter[2].x)); + root.scale.setY((filter[2].y)); + root.scale.setZ((filter[2].z)); + } else { + root.matrixAutoUpdate = false; + const matrix = Utils.interpolate(ev.detail.matrixGL_RH); + Utils.setMatrix(root.matrix, matrix); + } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { root.visible = objVisibility; @@ -263,7 +312,26 @@ export default class NFTaddTJS { this.names.push(name); } + /** + * You can get the names of the entities used in your project. + * @returns the names of the entities + */ public getNames() { return this.names; } + + /** + * Enable or not the OneEuroFilter routine. + */ + public set oef(enable: boolean) { + this._oef = enable; + } + + /** + * Check if OneEuroFilter is enabled or not. + * @returns (boolean) true or false + */ + public get oef() { + return this._oef; + } } diff --git a/types/markermedia/NFTaddTJS.d.ts b/types/markermedia/NFTaddTJS.d.ts index d14d7cc..409b616 100644 --- a/types/markermedia/NFTaddTJS.d.ts +++ b/types/markermedia/NFTaddTJS.d.ts @@ -12,6 +12,7 @@ export default class NFTaddTJS { private target; private uuid; private _filter; + private _oef; constructor(uuid: string); add(mesh: Object3D, name: string, objVisibility: boolean): void; addModel(url: string, name: string, scale: number, objVisibility: boolean): void; @@ -19,5 +20,7 @@ export default class NFTaddTJS { addImage(imageUrl: string, name: string, color: string, scale: number, configs: IPlaneConfig, objVisibility: boolean): void; addVideo(id: string, name: string, scale: number, configs: IPlaneConfig, objVisibility: boolean): void; getNames(): string[]; + set oef(enable: boolean); + get oef(): boolean; } export {}; From 707dd2d1020a81a7f4d7bf1863b46a9e62ca45c9 Mon Sep 17 00:00:00 2001 From: kalwalt Date: Wed, 17 Nov 2021 12:32:22 +0100 Subject: [PATCH 08/11] cleaning the code again --- dist/ARnftThreejs.js | 2 +- src/filters/ARnftFilter.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index 5af71bc..1f85223 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -5284,4 +5284,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO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ICAgICAgICAgICAgZmlsdGVyID0gdGhpcy5fZmlsdGVyLnVwZGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpICAgICAgIFxuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WCgoZmlsdGVyWzBdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKChmaWx0ZXJbMF0ueikpO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRZKChmaWx0ZXJbMl0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WigoZmlsdGVyWzJdLnopKTsgXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlOyAgICAgICAgIFxuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpOyBcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgbWVzaC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiA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Yuc2NlbmU7XG4gICAgICAgICAgICBtb2RlbC5zY2FsZS5zZXQoc2NhbGUsIHNjYWxlLCBzY2FsZSk7XG4gICAgICAgICAgICBtb2RlbC5yb3RhdGlvbi54ID0gTWF0aC5QSSAvIDI7XG4gICAgICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSAoKG1zZy5oZWlnaHQgLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByb290LmFkZChtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBpZih0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKSAgICBcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKChmaWx0ZXJbMF0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WigoZmlsdGVyWzBdLnopKTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKChmaWx0ZXJbMl0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WSgoZmlsdGVyWzJdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7IFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290Lm1hdHJpeEF1dG9VcGRhdGUgPSBmYWxzZTsgICAgICAgICBcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTsgXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRNb2RlbFdpdGhDYWxsY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ICAgICAgICBtb2RlbCA9IGdsdGYuc2NlbmU7XG4gICAgICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSAoKG1zZy5oZWlnaHQgLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjYWxsYmFjayhnbHRmKTtcbiAgICAgICAgICAgIHJvb3QuYWRkKG1vZGVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmKHRoaXMuX29lZiA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBbbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKV07XG4gICAgICAgICAgICAgICAgZmlsdGVyID0gdGhpcy5fZmlsdGVyLnVwZGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpICBcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKChmaWx0ZXJbMF0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WigoZmlsdGVyWzBdLnopKTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKChmaWx0ZXJbMl0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WSgoZmlsdGVyWzJdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7IFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290Lm1hdHJpeEF1dG9VcGRhdGUgPSBmYWxzZTsgICAgICAgICBcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTsgXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRJbWFnZSBmdW5jdGlvbiB3aWxsIGFkZCBhbiBpbWFnZSB0byB0aGUgUmVuZGVyZXIgc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IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKVxuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WCgoZmlsdGVyWzBdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKChmaWx0ZXJbMF0ueikpO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRZKChmaWx0ZXJbMl0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WigoZmlsdGVyWzJdLnopKTsgXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlOyAgICAgICAgIFxuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpOyBcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlz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KSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IFtuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApXTtcbiAgICAgICAgICAgICAgICBmaWx0ZXIgPSB0aGlzLl9maWx0ZXIudXBkYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCkgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRYKChmaWx0ZXJbMF0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WSgoZmlsdGVyWzBdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5yb3RhdGlvbi5zZXRGcm9tVmVjdG9yMyhmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WCgoZmlsdGVyWzJdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRaKChmaWx0ZXJbMl0ueikpOyBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm9vdC5tYXRyaXhBdXRvVXBkYXRlID0gZmFsc2U7ICAgICAgICAgXG4gICAgICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICBVdGlscy5zZXRNYXRyaXgocm9vdC5tYXRyaXgsIG1hdHJpeCk7IFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIF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gIGxldCBtYXRyaXg6IE1hdHJpeDQgPSBuZXcgTWF0cml4NCgpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBtYXRyaXggPSB3b3JsZE1hdHJpeDtcblxuICAgICAgICAgICAgbGV0IHJvdGF0aW9uOiBRdWF0ZXJuaW9uID0gbmV3IFF1YXRlcm5pb24oKVxuICAgICAgICAgICAgbGV0IGV1bGVyUm90OiBFdWxlciA9IG5ldyBFdWxlcigpO1xuICAgICAgICAgICAgbGV0IHBvc2l0aW9uOiBWZWN0b3IzID0gbmV3IFZlY3RvcjMoMCwgMCwgMCk7XG5cbiAgICAgICAgICAgIC8vIG9yIGV2ZW4gc2ltcGxlIGRlY29tcG9zZSB0aGUgd29ybGRNYXRyaXggaW50byBwb3NpdGlvbiwgcXVhdGVybmlvbiBhbmQgc2NhbGUgd2l0aCBkZWNvbXBvc2UgICBcbiAgICAgICAgICAgIHdvcmxkTWF0cml4LmRlY29tcG9zZShwb3NpdGlvbiwgcm90YXRpb24sIHNjYWxlKVxuICAgICAgICAgICAgbGV0IGVSb3QgPSBldWxlclJvdC5zZXRGcm9tUXVhdGVybmlvbihyb3RhdGlvbilcbiAgICAgICAgICAgIHJvdGF0aW9uVmVjID0gdGhpcy5fcm90YXRpb25GaWx0ZXIuRmlsdGVyKGVSb3QudG9WZWN0b3IzKCkpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBwb3MgPSB0aGlzLl9wb3NpdGlvbkZpbHRlci5GaWx0ZXIocG9zaXRpb24pICAgICAgIFxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbcG9zLCByb3RhdGlvblZlYywgc2NhbGVdXG4gICAgfVxuICAgIHByb3RlY3RlZCBnZXRBcnJheU1hdHJpeCh2YWx1ZTogYW55KTogYW55IHtcbiAgICAgICAgdmFyIGFycmF5OiBhbnkgPSBbXTtcbiAgICAgICAgZm9yICh2YXIga2V5IGluIHZhbHVlKSB7XG4gICAgICAgICAgICBhcnJheVtrZXldID0gdmFsdWVba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mFkZEV2ZW50TGlzdGVuZXIoXCJnZXRORlREYXRhLVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgdmFyIG1zZyA9IGV2LmRldGFpbDtcbiAgICAgICAgICAgIG1lc2gucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgIG1lc2gucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgY29uc3Qgcm9vdCA9IG5ldyBPYmplY3QzRCgpO1xuICAgICAgICByb290Lm5hbWUgPSBcInJvb3QtXCIgKyBuYW1lO1xuICAgICAgICB0aGlzLnNjZW5lLmFkZChyb290KTtcbiAgICAgICAgcm9vdC5hZGQobWVzaCk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtZXNoLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgaWYodGhpcy5fb2VmID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IFtuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApXTtcbiAgICAgICAgICAgICAgICBmaWx0ZXIgPSB0aGlzLl9maWx0ZXIudXBkYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCkgICAgICAgXG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRYKChmaWx0ZXJbMF0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WSgoZmlsdGVyWzBdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5yb3RhdGlvbi5zZXRGcm9tVmVjdG9yMyhmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WCgoZmlsdGVyWzJdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRaKChmaWx0ZXJbMl0ueikpOyBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm9vdC5tYXRyaXhBdXRvVXBkYXRlID0gZmFsc2U7ICAgICAgICAgXG4gICAgICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICBVdGlscy5zZXRNYXRyaXgocm9vdC5tYXRyaXgsIG1hdHJpeCk7IFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtZXNoLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgICAgICB0aGlzLmVudGl0aWVzLnB1c2goeyBuYW1lIH0pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRNb2RlbCBmdW5jdGl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V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRORlREYXRhLVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0gKChtc2cud2lkdGggLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJvb3QuYWRkKG1vZGVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmKHRoaXMuX29lZiA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBbbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKV07XG4gICAgICAgICAgICAgICAgZmlsdGVyID0gdGhpcy5fZmlsdGVyLnVwZGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpICAgIFxuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WCgoZmlsdGVyWzBdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaK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gKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0gKChtc2cud2lkdGggLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGNhbGxiYWNrKGdsdGYpO1xuICAgICAgICAgICAgcm9vdC5hZGQobW9kZWwpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE1hdHJpeEdMX1JILVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgaWYodGhpcy5fb2VmID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IFtuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApXTtcbiAgICAgICAgICAgICAgICBmaWx0ZXIgPSB0aGlzLl9maWx0ZXIudXBkYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCkgIFxuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WCgoZmlsdGVyWzBdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKChmaWx0ZXJbMF0ueikpO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRZKChmaWx0ZXJbMl0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WigoZmlsdGVyWzJdLnopKTsgXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlOyAgICAgICAgIFxuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpOyBcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJuZnRUcmFja2luZ0xvc3QtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICAgICAgbW9kZWwudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLm5hbWVzLnB1c2gobmFtZSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGFkZEltYWdlIGZ1bmN0aW9uIHdpbGwgYWRkIGFuIGltYWdlIHRvIHRoZSBSZW5kZXJlciByb290LiBZb3UgbmVlZCB0byBhc3NvY2lhdGUgYSBuYW1lIG9mIHRoZSBFbnRpdHkuXG4gICAgICogQHBhcmFtIGltYWdlVXJsIHVybCBvZiB0aGUgaW1hZ2UuXG4gICAgICogQHBhcmFtIG5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1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WSgoZmlsdGVyWzBdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5yb3RhdGlvbi5zZXRGcm9tVmVjdG9yMyhmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WCgoZmlsdGVyWzJdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoKGZpbHRlclsyXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRaKChmaWx0ZXJbMl0ueikpOyBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm9vdC5tYXRyaXhBdXRvVXBkYXRlID0gZmFsc2U7ICAgICAgICAgXG4gICAgICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICBVdGlscy5zZXRNYXRyaXgocm9vdC5tYXRyaXgsIG1hdHJpeCk7IFxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbGFuZS52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgYWRkVmlkZW8gZnVuY3Rpb24gd2lsbCBhZGQgYSB2aWRlbyB0byB0a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wLDAsMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKSAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKChmaWx0ZXJbMF0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WigoZmlsdGVyWzBdLnopKTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKChmaWx0ZXJbMl0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WSgoZmlsdGVyWzJdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7IFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290Lm1hdHJpeEF1dG9VcGRhdGUgPSBmYWxzZTsgICAgICAgICBcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTsgXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIHBsYW5lLnZpc2libGUgPSBvYmpW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nIH0pO1xuXHR9XG5cdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCAnX19lc01vZHVsZScsIHsgdmFsdWU6IHRydWUgfSk7XG59OyIsImltcG9ydCBTY2VuZVJlbmRlcmVyVEpTIGZyb20gXCIuL1NjZW5lUmVuZGVyZXJUSlNcIjtcbmltcG9ydCBORlRhZGRUSlMgZnJvbSBcIi4vbWFya2VybWVkaWEvTkZUYWRkVEpTXCI7XG5cbmV4cG9ydCBkZWZhdWx0IHsgU2NlbmVSZW5kZXJlclRKUywgTkZUYWRkVEpTIH07XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/src/filters/ARnftFilter.ts b/src/filters/ARnftFilter.ts index 7b61659..a03a406 100644 --- a/src/filters/ARnftFilter.ts +++ b/src/filters/ARnftFilter.ts @@ -76,11 +76,8 @@ export class ARnftFilter { worldMatrix.decompose(position, rotation, scale) let eRot = eulerRot.setFromQuaternion(rotation) rotationVec = this._rotationFilter.Filter(eRot.toVector3()); - - //console.log('pos is: ', pos); - pos = this._positionFilter.Filter(position) - //console.log('position is:', pos); + pos = this._positionFilter.Filter(position) } return [pos, rotationVec, scale] } From c455441e5ee00241a9dd03fe767a34831aa25748 Mon Sep 17 00:00:00 2001 From: kalwalt Date: Wed, 17 Nov 2021 12:43:34 +0100 Subject: [PATCH 09/11] upgrading packages --- package.json | 18 +- yarn.lock | 1655 +++++++++++++++++++++++++------------------------- 2 files changed, 835 insertions(+), 838 deletions(-) diff --git a/package.json b/package.json index a791b6a..e7c1985 100644 --- a/package.json +++ b/package.json @@ -32,21 +32,21 @@ }, "homepage": "https://github.com/webarkit/ARnft-threejs#readme", "devDependencies": { - "@babel/core": "^7.15.8", - "@babel/plugin-transform-runtime": "^7.15.8", - "@babel/preset-env": "^7.15.8", + "@babel/core": "^7.16.0", + "@babel/plugin-transform-runtime": "^7.16.4", + "@babel/preset-env": "^7.16.4", "@types/node": "^15.6.0", - "@types/three": "^0.133.0", + "@types/three": "^0.134.0", "babel-loader": "^8.2.2", "prettier": "^2.4.1", "ts-loader": "^9.2.6", - "typedoc": "^0.22.5", + "typedoc": "^0.22.9", "typescript": "^4.2.4", - "webpack": "^5.58.1", - "webpack-cli": "^4.9.0" + "webpack": "^5.64.1", + "webpack-cli": "^4.9.1" }, "dependencies": { - "@babel/runtime": "^7.15.4", - "three": "^0.133.0" + "@babel/runtime": "^7.16.3", + "three": "^0.134.0" } } diff --git a/yarn.lock b/yarn.lock index ec1214b..831a9cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,42 +4,42 @@ "@babel/code-frame@^7.12.13": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz" integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== dependencies: "@babel/highlight" "^7.12.13" -"@babel/code-frame@^7.14.5", "@babel/code-frame@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" - integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== +"@babel/code-frame@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" + integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== dependencies: - "@babel/highlight" "^7.14.5" + "@babel/highlight" "^7.16.0" "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.13.15": version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.0.tgz#a901128bce2ad02565df95e6ecbf195cf9465919" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.0.tgz" integrity sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q== -"@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== - -"@babel/core@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.8.tgz#195b9f2bffe995d2c6c159e72fe525b4114e8c10" - integrity sha512-3UG9dsxvYBMYwRv+gS41WKHno4K60/9GPy1CJaH6xy3Elq8CTtvtjT5R5jmNhXfCYLX2mTw+7/aq5ak/gOE0og== - dependencies: - "@babel/code-frame" "^7.15.8" - "@babel/generator" "^7.15.8" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.8" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" +"@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e" + integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q== + +"@babel/core@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" + integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" + "@babel/helper-module-transforms" "^7.16.0" + "@babel/helpers" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -49,47 +49,47 @@ "@babel/generator@^7.14.2": version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz" integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== dependencies: "@babel/types" "^7.14.2" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.15.4", "@babel/generator@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" - integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== +"@babel/generator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" + integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== dependencies: - "@babel/types" "^7.15.6" + "@babel/types" "^7.16.0" jsesc "^2.5.1" source-map "^0.5.0" "@babel/helper-annotate-as-pure@^7.12.13": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" + resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz" integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw== dependencies: "@babel/types" "^7.12.13" -"@babel/helper-annotate-as-pure@^7.14.5", "@babel/helper-annotate-as-pure@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz#3d0e43b00c5e49fdb6c57e421601a7a658d5f835" - integrity sha512-QwrtdNvUNsPCj2lfNQacsGSQvGX8ee1ttrBrcozUP2Sv/jylewBP/8QFe6ZkBsC8T/GYWonNAWJV4aRR9AL2DA== +"@babel/helper-annotate-as-pure@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz#9a1f0ebcda53d9a2d00108c4ceace6a5d5f1f08d" + integrity sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.15.4.tgz#21ad815f609b84ee0e3058676c33cf6d1670525f" - integrity sha512-P8o7JP2Mzi0SdC6eWr1zF+AEYvrsZa7GSY1lTayjF5XJhVH0kjLYUZPvTMflP7tBgZoe9gIhTa60QwFpqh/E0Q== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.0.tgz#f1a686b92da794020c26582eb852e9accd0d7882" + integrity sha512-9KuleLT0e77wFUku6TUkqZzCEymBdtuQQ27MhEKzf9UOOJu3cYj98kyaDAzxpC7lV6DGiZFuC8XqDsq8/Kl6aQ== dependencies: - "@babel/helper-explode-assignable-expression" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-explode-assignable-expression" "^7.16.0" + "@babel/types" "^7.16.0" "@babel/helper-compilation-targets@^7.13.0": version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz" integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== dependencies: "@babel/compat-data" "^7.13.15" @@ -97,48 +97,48 @@ browserslist "^4.14.5" semver "^6.3.0" -"@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== +"@babel/helper-compilation-targets@^7.16.0", "@babel/helper-compilation-targets@^7.16.3": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0" + integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA== dependencies: - "@babel/compat-data" "^7.15.0" + "@babel/compat-data" "^7.16.0" "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz#7f977c17bd12a5fba363cb19bea090394bf37d2e" - integrity sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw== +"@babel/helper-create-class-features-plugin@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.0.tgz#090d4d166b342a03a9fec37ef4fd5aeb9c7c6a4b" + integrity sha512-XLwWvqEaq19zFlF5PTgOod4bUA+XbkR4WLQBct1bkzmxJGB0ZEJaoKF4c8cgH9oBtCDuYJ8BP5NB9uFiEgO5QA== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-member-expression-to-functions" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" "@babel/helper-create-regexp-features-plugin@^7.12.13": version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.3.tgz#149aa6d78c016e318c43e2409a0ae9c136a86688" + resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.3.tgz" integrity sha512-JIB2+XJrb7v3zceV2XzDhGIB902CmKGSpSl4q2C6agU9SNLG/2V1RtFRGPG1Ajh9STj3+q6zJMOC+N/pp2P9DA== dependencies: "@babel/helper-annotate-as-pure" "^7.12.13" regexpu-core "^4.7.1" -"@babel/helper-create-regexp-features-plugin@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" - integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== +"@babel/helper-create-regexp-features-plugin@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz#06b2348ce37fccc4f5e18dcd8d75053f2a7c44ff" + integrity sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.0" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.2.2": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" - integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== +"@babel/helper-define-polyfill-provider@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz#c5b10cf4b324ff840140bb07e05b8564af2ae971" + integrity sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -149,358 +149,365 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-explode-assignable-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz#f9aec9d219f271eaf92b9f561598ca6b2682600c" - integrity sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g== +"@babel/helper-explode-assignable-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz#753017337a15f46f9c09f674cff10cee9b9d7778" + integrity sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" "@babel/helper-function-name@^7.14.2": version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz" integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== dependencies: "@babel/helper-get-function-arity" "^7.12.13" "@babel/template" "^7.12.13" "@babel/types" "^7.14.2" -"@babel/helper-function-name@^7.14.5", "@babel/helper-function-name@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" - integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== +"@babel/helper-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" + integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== dependencies: - "@babel/helper-get-function-arity" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-get-function-arity" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/types" "^7.16.0" "@babel/helper-get-function-arity@^7.12.13": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz" integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== dependencies: "@babel/types" "^7.12.13" -"@babel/helper-get-function-arity@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" - integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== +"@babel/helper-get-function-arity@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" + integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-hoist-variables@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" - integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== +"@babel/helper-hoist-variables@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" + integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== +"@babel/helper-member-expression-to-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" + integrity sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" "@babel/helper-module-imports@^7.12.13": version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz" integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== dependencies: "@babel/types" "^7.13.12" -"@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== +"@babel/helper-module-imports@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" + integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4", "@babel/helper-module-transforms@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" - integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== +"@babel/helper-module-transforms@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" + integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-module-imports" "^7.16.0" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-simple-access" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== +"@babel/helper-optimise-call-expression@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" + integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz" integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== "@babel/helper-plugin-utils@^7.14.5": version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz" integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== -"@babel/helper-remap-async-to-generator@^7.14.5", "@babel/helper-remap-async-to-generator@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.15.4.tgz#2637c0731e4c90fbf58ac58b50b2b5a192fc970f" - integrity sha512-v53MxgvMK/HCwckJ1bZrq6dNKlmwlyRNYM6ypaRTdXWGOE2c1/SCa6dL/HimhPulGhZKw9W0QhREM583F/t0vQ== +"@babel/helper-remap-async-to-generator@^7.16.0", "@babel/helper-remap-async-to-generator@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.4.tgz#5d7902f61349ff6b963e07f06a389ce139fbfe6e" + integrity sha512-vGERmmhR+s7eH5Y/cp8PCVzj4XEjerq8jooMfxFdA5xVtAk9Sh4AQsrWgiErUEBjtGrBtOFKDUcWQFW4/dFwMA== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-wrap-function" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-wrap-function" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-replace-supers@^7.14.5", "@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== +"@babel/helper-replace-supers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz#73055e8d3cf9bcba8ddb55cad93fedc860f68f17" + integrity sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA== dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-member-expression-to-functions" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== +"@babel/helper-simple-access@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" + integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" -"@babel/helper-skip-transparent-expression-wrappers@^7.14.5", "@babel/helper-skip-transparent-expression-wrappers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.15.4.tgz#707dbdba1f4ad0fa34f9114fc8197aec7d5da2eb" - integrity sha512-BMRLsdh+D1/aap19TycS4eD1qELGrCBJwzaY9IE8LrpJtJb+H7rQkPIdsfgnMtLBA6DJls7X9z93Z4U8h7xw0A== +"@babel/helper-skip-transparent-expression-wrappers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz#0ee3388070147c3ae051e487eca3ebb0e2e8bb09" + integrity sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" "@babel/helper-split-export-declaration@^7.12.13": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz" integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== dependencies: "@babel/types" "^7.12.13" -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== +"@babel/helper-split-export-declaration@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" + integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== dependencies: - "@babel/types" "^7.15.4" + "@babel/types" "^7.16.0" "@babel/helper-validator-identifier@^7.14.0": version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz" integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": +"@babel/helper-validator-identifier@^7.15.7": version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz" integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== "@babel/helper-validator-option@^7.12.17": version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz" integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== "@babel/helper-validator-option@^7.14.5": version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== -"@babel/helper-wrap-function@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.15.4.tgz#6f754b2446cfaf3d612523e6ab8d79c27c3a3de7" - integrity sha512-Y2o+H/hRV5W8QhIfTpRIBwl57y8PrZt6JM3V8FOo5qarjshHItyH5lXlpMfBfmBefOqSCpKZs/6Dxqp0E/U+uw== +"@babel/helper-wrap-function@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.0.tgz#b3cf318afce774dfe75b86767cd6d68f3482e57c" + integrity sha512-VVMGzYY3vkWgCJML+qVLvGIam902mJW0FvT7Avj1zEe0Gn7D93aWdLblYARTxEw+6DhZmtzhBM2zv0ekE5zg1g== dependencies: - "@babel/helper-function-name" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/helper-function-name" "^7.16.0" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.0" + "@babel/types" "^7.16.0" -"@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== +"@babel/helpers@^7.16.0": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.3.tgz#27fc64f40b996e7074dc73128c3e5c3e7f55c43c" + integrity sha512-Xn8IhDlBPhvYTvgewPKawhADichOsbkZuzN7qz2BusOM0brChsyXMDJvldWaYMMUNiCQdQzNEioXTp3sC8Nt8w== dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/template" "^7.16.0" + "@babel/traverse" "^7.16.3" + "@babel/types" "^7.16.0" "@babel/highlight@^7.12.13": version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.0.tgz#3197e375711ef6bf834e67d0daec88e4f46113cf" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz" integrity sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg== dependencies: "@babel/helper-validator-identifier" "^7.14.0" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== +"@babel/highlight@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" + integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" + "@babel/helper-validator-identifier" "^7.15.7" chalk "^2.0.0" js-tokens "^4.0.0" "@babel/parser@^7.12.13", "@babel/parser@^7.14.2": version "7.14.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.3.tgz#9b530eecb071fd0c93519df25c5ff9f14759f298" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz" integrity sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ== -"@babel/parser@^7.15.4", "@babel/parser@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" - integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== +"@babel/parser@^7.16.0", "@babel/parser@^7.16.3": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" + integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.2": + version "7.16.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz#2977fca9b212db153c195674e57cfab807733183" + integrity sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.15.4.tgz#dbdeabb1e80f622d9f0b583efb2999605e0a567e" - integrity sha512-eBnpsl9tlhPhpI10kU06JHnrYXwg3+V6CaP2idsCXNef0aeslpqyITXQ74Vfk5uHgY7IG7XP0yIH8b42KSzHog== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz#358972eaab006f5eb0826183b0c93cbcaf13e1e2" + integrity sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + "@babel/plugin-proposal-optional-chaining" "^7.16.0" -"@babel/plugin-proposal-async-generator-functions@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.8.tgz#a3100f785fab4357987c4223ab1b02b599048403" - integrity sha512-2Z5F2R2ibINTc63mY7FLqGfEbmofrHU9FitJW1Q7aPaKFhiPvSq6QEt/BoWN5oME3GVyjcRuNNSRbb9LC0CSWA== +"@babel/plugin-proposal-async-generator-functions@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.4.tgz#e606eb6015fec6fa5978c940f315eae4e300b081" + integrity sha512-/CUekqaAaZCQHleSK/9HajvcD/zdnJiKRiuUFq8ITE+0HsPzquf53cpFiqAwl/UfmJbR6n5uGPQSPdrmKOvHHg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.15.4" + "@babel/helper-remap-async-to-generator" "^7.16.4" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-class-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" - integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== +"@babel/plugin-proposal-class-properties@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.0.tgz#c029618267ddebc7280fa286e0f8ca2a278a2d1a" + integrity sha512-mCF3HcuZSY9Fcx56Lbn+CGdT44ioBMMvjNVldpKtj8tpniETdLjnxdHI1+sDWXIM1nNt+EanJOZ3IG9lzVjs7A== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-proposal-class-static-block@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.15.4.tgz#3e7ca6128453c089e8b477a99f970c63fc1cb8d7" - integrity sha512-M682XWrrLNk3chXCjoPUQWOyYsB93B9z3mRyjtqqYJWDf2mfCdIYgDrA11cgNVhAQieaq6F2fn2f3wI0U4aTjA== +"@babel/plugin-proposal-class-static-block@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.0.tgz#5296942c564d8144c83eea347d0aa8a0b89170e7" + integrity sha512-mAy3sdcY9sKAkf3lQbDiv3olOfiLqI51c9DR9b19uMoR2Z6r5pmGl7dfNFqEvqOyqbf1ta4lknK4gc5PJn3mfA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.15.4" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-proposal-dynamic-import@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" - integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== +"@babel/plugin-proposal-dynamic-import@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.0.tgz#783eca61d50526202f9b296095453977e88659f1" + integrity sha512-QGSA6ExWk95jFQgwz5GQ2Dr95cf7eI7TKutIXXTb7B1gCLTCz5hTjFTQGfLFBBiC5WSNi7udNwWsqbbMh1c4yQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" - integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== +"@babel/plugin-proposal-export-namespace-from@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.0.tgz#9c01dee40b9d6b847b656aaf4a3976a71740f222" + integrity sha512-CjI4nxM/D+5wCnhD11MHB1AwRSAYeDT+h8gCdcVJZ/OK7+wRzFsf7PFPWVpVpNRkHMmMkQWAHpTq+15IXQ1diA== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" - integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== +"@babel/plugin-proposal-json-strings@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.0.tgz#cae35a95ed1d2a7fa29c4dc41540b84a72e9ab25" + integrity sha512-kouIPuiv8mSi5JkEhzApg5Gn6hFyKPnlkO0a9YSzqRurH8wYzSlf6RJdzluAsbqecdW5pBvDJDfyDIUR/vLxvg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" - integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== +"@babel/plugin-proposal-logical-assignment-operators@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.0.tgz#a711b8ceb3ffddd3ef88d3a49e86dbd3cc7db3fd" + integrity sha512-pbW0fE30sVTYXXm9lpVQQ/Vc+iTeQKiXlaNRZPPN2A2VdlWyAtsUrsQ3xydSlDW00TFMK7a8m3cDTkBF5WnV3Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" - integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.0.tgz#44e1cce08fe2427482cf446a91bb451528ed0596" + integrity sha512-3bnHA8CAFm7cG93v8loghDYyQ8r97Qydf63BeYiGgYbjKKB/XP53W15wfRC7dvKfoiJ34f6Rbyyx2btExc8XsQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" - integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== +"@babel/plugin-proposal-numeric-separator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.0.tgz#5d418e4fbbf8b9b7d03125d3a52730433a373734" + integrity sha512-FAhE2I6mjispy+vwwd6xWPyEx3NYFS13pikDBWUAFGZvq6POGs5eNchw8+1CYoEgBl9n11I3NkzD7ghn25PQ9Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.15.6": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.15.6.tgz#ef68050c8703d07b25af402cb96cf7f34a68ed11" - integrity sha512-qtOHo7A1Vt+O23qEAX+GdBpqaIuD3i9VRrWgCJeq7WO6H2d14EK3q11urj5Te2MAeK97nMiIdRpwd/ST4JFbNg== +"@babel/plugin-proposal-object-rest-spread@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.0.tgz#5fb32f6d924d6e6712810362a60e12a2609872e6" + integrity sha512-LU/+jp89efe5HuWJLmMmFG0+xbz+I2rSI7iLc1AlaeSMDMOGzWlc5yJrMN1d04osXN4sSfpo4O+azkBNBes0jg== dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" + "@babel/compat-data" "^7.16.0" + "@babel/helper-compilation-targets" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.15.4" + "@babel/plugin-transform-parameters" "^7.16.0" -"@babel/plugin-proposal-optional-catch-binding@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" - integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== +"@babel/plugin-proposal-optional-catch-binding@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.0.tgz#5910085811ab4c28b00d6ebffa4ab0274d1e5f16" + integrity sha512-kicDo0A/5J0nrsCPbn89mTG3Bm4XgYi0CZtvex9Oyw7gGZE3HXGD0zpQNH+mo+tEfbo8wbmMvJftOwpmPy7aVw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" - integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== +"@babel/plugin-proposal-optional-chaining@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.0.tgz#56dbc3970825683608e9efb55ea82c2a2d6c8dc0" + integrity sha512-Y4rFpkZODfHrVo70Uaj6cC1JJOt3Pp0MdWSwIKtb8z1/lsjl9AmnB7ErRFV+QNGIfcY1Eruc2UMx5KaRnXjMyg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" - integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== +"@babel/plugin-proposal-private-methods@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.0.tgz#b4dafb9c717e4301c5776b30d080d6383c89aff6" + integrity sha512-IvHmcTHDFztQGnn6aWq4t12QaBXTKr1whF/dgp9kz84X6GUcwq9utj7z2wFCUfeOup/QKnOlt2k0zxkGFx9ubg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-proposal-private-property-in-object@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.15.4.tgz#55c5e3b4d0261fd44fe637e3f624cfb0f484e3e5" - integrity sha512-X0UTixkLf0PCCffxgu5/1RQyGGbgZuKoI+vXP4iSbJSYwPb7hu06omsFGBvQ9lJEvwgrxHdS8B5nbfcd8GyUNA== +"@babel/plugin-proposal-private-property-in-object@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.0.tgz#69e935b2c5c79d2488112d886f0c4e2790fee76f" + integrity sha512-3jQUr/HBbMVZmi72LpjQwlZ55i1queL8KcDTQEkAHihttJnAPrcvG9ZNXIfsd2ugpizZo595egYV6xy+pv4Ofw== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-create-class-features-plugin" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-create-class-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" -"@babel/plugin-proposal-unicode-property-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" - integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== +"@babel/plugin-proposal-unicode-property-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.0.tgz#890482dfc5ea378e42e19a71e709728cabf18612" + integrity sha512-ti7IdM54NXv29cA4+bNNKEMS4jLMCbJgl+Drv+FgYy0erJLAxNAIXcNjNjrRZEcWq0xJHsNVwQezskMFpF8N9g== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-proposal-unicode-property-regex@^7.4.4": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz#bebde51339be829c17aaaaced18641deb62b39ba" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz" integrity sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.12.13" @@ -508,395 +515,396 @@ "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-class-static-block@^7.14.5": version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz" integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-export-namespace-from@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz" integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== dependencies: "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-json-strings@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-numeric-separator@^7.10.4": version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-optional-chaining@^7.8.3": version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-private-property-in-object@^7.14.5": version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-top-level-await@^7.14.5": version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-arrow-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" - integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== +"@babel/plugin-transform-arrow-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.0.tgz#951706f8b449c834ed07bd474c0924c944b95a8e" + integrity sha512-vIFb5250Rbh7roWARvCLvIJ/PtAU5Lhv7BtZ1u24COwpI9Ypjsh+bZcKk6rlIyalK+r0jOc1XQ8I4ovNxNrWrA== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" - integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== +"@babel/plugin-transform-async-to-generator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.0.tgz#df12637f9630ddfa0ef9d7a11bc414d629d38604" + integrity sha512-PbIr7G9kR8tdH6g8Wouir5uVjklETk91GMVSUq+VaOgiinbCkBP6Q7NN/suM/QutZkMJMvcyAriogcYAdhg8Gw== dependencies: - "@babel/helper-module-imports" "^7.14.5" + "@babel/helper-module-imports" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" + "@babel/helper-remap-async-to-generator" "^7.16.0" -"@babel/plugin-transform-block-scoped-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" - integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== +"@babel/plugin-transform-block-scoped-functions@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.0.tgz#c618763233ad02847805abcac4c345ce9de7145d" + integrity sha512-V14As3haUOP4ZWrLJ3VVx5rCnrYhMSHN/jX7z6FAt5hjRkLsb0snPCmJwSOML5oxkKO4FNoNv7V5hw/y2bjuvg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-block-scoping@^7.15.3": - version "7.15.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz#94c81a6e2fc230bcce6ef537ac96a1e4d2b3afaf" - integrity sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q== +"@babel/plugin-transform-block-scoping@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.0.tgz#bcf433fb482fe8c3d3b4e8a66b1c4a8e77d37c16" + integrity sha512-27n3l67/R3UrXfizlvHGuTwsRIFyce3D/6a37GRxn28iyTPvNXaW4XvznexRh1zUNLPjbLL22Id0XQElV94ruw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-classes@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.15.4.tgz#50aee17aaf7f332ae44e3bce4c2e10534d5d3bf1" - integrity sha512-Yjvhex8GzBmmPQUvpXRPWQ9WnxXgAFuZSrqOK/eJlOGIXwvv8H3UEdUigl1gb/bnjTrln+e8bkZUYCBt/xYlBg== +"@babel/plugin-transform-classes@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.0.tgz#54cf5ff0b2242c6573d753cd4bfc7077a8b282f5" + integrity sha512-HUxMvy6GtAdd+GKBNYDWCIA776byUQH8zjnfjxwT1P1ARv/wFu8eBDpmXQcLS/IwRtrxIReGiplOwMeyO7nsDQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" + "@babel/helper-annotate-as-pure" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-optimise-call-expression" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" - integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== +"@babel/plugin-transform-computed-properties@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.0.tgz#e0c385507d21e1b0b076d66bed6d5231b85110b7" + integrity sha512-63l1dRXday6S8V3WFY5mXJwcRAnPYxvFfTlt67bwV1rTyVTM5zrp0DBBb13Kl7+ehkCVwIZPumPpFP/4u70+Tw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-destructuring@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" - integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== +"@babel/plugin-transform-destructuring@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.0.tgz#ad3d7e74584ad5ea4eadb1e6642146c590dee33c" + integrity sha512-Q7tBUwjxLTsHEoqktemHBMtb3NYwyJPTJdM+wDwb0g8PZ3kQUIzNvwD5lPaqW/p54TXBc/MXZu9Jr7tbUEUM8Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-dotall-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" - integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== +"@babel/plugin-transform-dotall-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.0.tgz#50bab00c1084b6162d0a58a818031cf57798e06f" + integrity sha512-FXlDZfQeLILfJlC6I1qyEwcHK5UpRCFkaoVyA1nk9A1L1Yu583YO4un2KsLBsu3IJb4CUbctZks8tD9xPQubLw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-transform-dotall-regex@^7.4.4": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz#3f1601cc29905bfcb67f53910f197aeafebb25ad" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz" integrity sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-duplicate-keys@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" - integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== +"@babel/plugin-transform-duplicate-keys@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.0.tgz#8bc2e21813e3e89e5e5bf3b60aa5fc458575a176" + integrity sha512-LIe2kcHKAZOJDNxujvmp6z3mfN6V9lJxubU4fJIGoQCkKe3Ec2OcbdlYP+vW++4MpxwG0d1wSDOJtQW5kLnkZQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-exponentiation-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" - integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== +"@babel/plugin-transform-exponentiation-operator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.0.tgz#a180cd2881e3533cef9d3901e48dad0fbeff4be4" + integrity sha512-OwYEvzFI38hXklsrbNivzpO3fh87skzx8Pnqi4LoSYeav0xHlueSoCJrSgTPfnbyzopo5b3YVAJkFIcUpK2wsw== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-for-of@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.15.4.tgz#25c62cce2718cfb29715f416e75d5263fb36a8c2" - integrity sha512-DRTY9fA751AFBDh2oxydvVm4SYevs5ILTWLs6xKXps4Re/KG5nfUkr+TdHCrRWB8C69TlzVgA9b3RmGWmgN9LA== +"@babel/plugin-transform-for-of@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.0.tgz#f7abaced155260e2461359bbc7c7248aca5e6bd2" + integrity sha512-5QKUw2kO+GVmKr2wMYSATCTTnHyscl6sxFRAY+rvN7h7WB0lcG0o4NoV6ZQU32OZGVsYUsfLGgPQpDFdkfjlJQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" - integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== +"@babel/plugin-transform-function-name@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.0.tgz#02e3699c284c6262236599f751065c5d5f1f400e" + integrity sha512-lBzMle9jcOXtSOXUpc7tvvTpENu/NuekNJVova5lCCWCV9/U1ho2HH2y0p6mBg8fPm/syEAbfaaemYGOHCY3mg== dependencies: - "@babel/helper-function-name" "^7.14.5" + "@babel/helper-function-name" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" - integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== +"@babel/plugin-transform-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.0.tgz#79711e670ffceb31bd298229d50f3621f7980cac" + integrity sha512-gQDlsSF1iv9RU04clgXqRjrPyyoJMTclFt3K1cjLmTKikc0s/6vE3hlDeEVC71wLTRu72Fq7650kABrdTc2wMQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-member-expression-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" - integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== +"@babel/plugin-transform-member-expression-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.0.tgz#5251b4cce01eaf8314403d21aedb269d79f5e64b" + integrity sha512-WRpw5HL4Jhnxw8QARzRvwojp9MIE7Tdk3ez6vRyUk1MwgjJN0aNpRoXainLR5SgxmoXx/vsXGZ6OthP6t/RbUg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-modules-amd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" - integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== +"@babel/plugin-transform-modules-amd@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.0.tgz#09abd41e18dcf4fd479c598c1cef7bd39eb1337e" + integrity sha512-rWFhWbCJ9Wdmzln1NmSCqn7P0RAD+ogXG/bd9Kg5c7PKWkJtkiXmYsMBeXjDlzHpVTJ4I/hnjs45zX4dEv81xw== dependencies: - "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.4.tgz#8201101240eabb5a76c08ef61b2954f767b6b4c1" - integrity sha512-qg4DPhwG8hKp4BbVDvX1s8cohM8a6Bvptu4l6Iingq5rW+yRUAhe/YRup/YcW2zCOlrysEWVhftIcKzrEZv3sA== +"@babel/plugin-transform-modules-commonjs@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.0.tgz#add58e638c8ddc4875bd9a9ecb5c594613f6c922" + integrity sha512-Dzi+NWqyEotgzk/sb7kgQPJQf7AJkQBWsVp1N6JWc1lBVo0vkElUnGdr1PzUBmfsCCN5OOFya3RtpeHk15oLKQ== dependencies: - "@babel/helper-module-transforms" "^7.15.4" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-simple-access" "^7.16.0" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.15.4.tgz#b42890c7349a78c827719f1d2d0cd38c7d268132" - integrity sha512-fJUnlQrl/mezMneR72CKCgtOoahqGJNVKpompKwzv3BrEXdlPspTcyxrZ1XmDTIr9PpULrgEQo3qNKp6dW7ssw== +"@babel/plugin-transform-modules-systemjs@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.0.tgz#a92cf240afeb605f4ca16670453024425e421ea4" + integrity sha512-yuGBaHS3lF1m/5R+6fjIke64ii5luRUg97N2wr+z1sF0V+sNSXPxXDdEEL/iYLszsN5VKxVB1IPfEqhzVpiqvg== dependencies: - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" - integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== +"@babel/plugin-transform-modules-umd@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.0.tgz#195f26c2ad6d6a391b70880effce18ce625e06a7" + integrity sha512-nx4f6no57himWiHhxDM5pjwhae5vLpTK2zCnDH8+wNLJy0TVER/LJRHl2bkt6w9Aad2sPD5iNNoUpY3X9sTGDg== dependencies: - "@babel/helper-module-transforms" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-named-capturing-groups-regex@^7.14.9": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz#c68f5c5d12d2ebaba3762e57c2c4f6347a46e7b2" - integrity sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA== +"@babel/plugin-transform-named-capturing-groups-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.0.tgz#d3db61cc5d5b97986559967cd5ea83e5c32096ca" + integrity sha512-LogN88uO+7EhxWc8WZuQ8vxdSyVGxhkh8WTC3tzlT8LccMuQdA81e9SGV6zY7kY2LjDhhDOFdQVxdGwPyBCnvg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" -"@babel/plugin-transform-new-target@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" - integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== +"@babel/plugin-transform-new-target@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.0.tgz#af823ab576f752215a49937779a41ca65825ab35" + integrity sha512-fhjrDEYv2DBsGN/P6rlqakwRwIp7rBGLPbrKxwh7oVt5NNkIhZVOY2GRV+ULLsQri1bDqwDWnU3vhlmx5B2aCw== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-object-super@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" - integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== +"@babel/plugin-transform-object-super@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.0.tgz#fb20d5806dc6491a06296ac14ea8e8d6fedda72b" + integrity sha512-fds+puedQHn4cPLshoHcR1DTMN0q1V9ou0mUjm8whx9pGcNvDrVVrgw+KJzzCaiTdaYhldtrUps8DWVMgrSEyg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-replace-supers" "^7.16.0" -"@babel/plugin-transform-parameters@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz#5f2285cc3160bf48c8502432716b48504d29ed62" - integrity sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ== +"@babel/plugin-transform-parameters@^7.16.0", "@babel/plugin-transform-parameters@^7.16.3": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.3.tgz#fa9e4c874ee5223f891ee6fa8d737f4766d31d15" + integrity sha512-3MaDpJrOXT1MZ/WCmkOFo7EtmVVC8H4EUZVrHvFOsmwkk4lOjQj8rzv8JKUZV4YoQKeoIgk07GO+acPU9IMu/w== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-property-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" - integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== +"@babel/plugin-transform-property-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.0.tgz#a95c552189a96a00059f6776dc4e00e3690c78d1" + integrity sha512-XLldD4V8+pOqX2hwfWhgwXzGdnDOThxaNTgqagOcpBgIxbUvpgU2FMvo5E1RyHbk756WYgdbS0T8y0Cj9FKkWQ== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-regenerator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" - integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== +"@babel/plugin-transform-regenerator@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.0.tgz#eaee422c84b0232d03aea7db99c97deeaf6125a4" + integrity sha512-JAvGxgKuwS2PihiSFaDrp94XOzzTUeDeOQlcKzVAyaPap7BnZXK/lvMDiubkPTdotPKOIZq9xWXWnggUMYiExg== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" - integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== +"@babel/plugin-transform-reserved-words@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.0.tgz#fff4b9dcb19e12619394bda172d14f2d04c0379c" + integrity sha512-Dgs8NNCehHSvXdhEhln8u/TtJxfVwGYCgP2OOr5Z3Ar+B+zXicEOKNTyc+eca2cuEOMtjW6m9P9ijOt8QdqWkg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-runtime@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.15.8.tgz#9d15b1e94e1c7f6344f65a8d573597d93c6cd886" - integrity sha512-+6zsde91jMzzvkzuEA3k63zCw+tm/GvuuabkpisgbDMTPQsIMHllE3XczJFFtEHLjjhKQFZmGQVRdELetlWpVw== +"@babel/plugin-transform-runtime@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.16.4.tgz#f9ba3c7034d429c581e1bd41b4952f3db3c2c7e8" + integrity sha512-pru6+yHANMTukMtEZGC4fs7XPwg35v8sj5CIEmE+gEkFljFiVJxEWxx/7ZDkTK+iZRYo1bFXBtfIN95+K3cJ5A== dependencies: - "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-module-imports" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" - babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.5" - babel-plugin-polyfill-regenerator "^0.2.2" + babel-plugin-polyfill-corejs2 "^0.3.0" + babel-plugin-polyfill-corejs3 "^0.4.0" + babel-plugin-polyfill-regenerator "^0.3.0" semver "^6.3.0" -"@babel/plugin-transform-shorthand-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" - integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== +"@babel/plugin-transform-shorthand-properties@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.0.tgz#090372e3141f7cc324ed70b3daf5379df2fa384d" + integrity sha512-iVb1mTcD8fuhSv3k99+5tlXu5N0v8/DPm2mO3WACLG6al1CGZH7v09HJyUb1TtYl/Z+KrM6pHSIJdZxP5A+xow== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-spread@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.15.8.tgz#79d5aa27f68d700449b2da07691dfa32d2f6d468" - integrity sha512-/daZ8s2tNaRekl9YJa9X4bzjpeRZLt122cpgFnQPLGUe61PH8zMEBmYqKkW5xF5JUEh5buEGXJoQpqBmIbpmEQ== +"@babel/plugin-transform-spread@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.0.tgz#d21ca099bbd53ab307a8621e019a7bd0f40cdcfb" + integrity sha512-Ao4MSYRaLAQczZVp9/7E7QHsCuK92yHRrmVNRe/SlEJjhzivq0BSn8mEraimL8wizHZ3fuaHxKH0iwzI13GyGg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" -"@babel/plugin-transform-sticky-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" - integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== +"@babel/plugin-transform-sticky-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.0.tgz#c35ea31a02d86be485f6aa510184b677a91738fd" + integrity sha512-/ntT2NljR9foobKk4E/YyOSwcGUXtYWv5tinMK/3RkypyNBNdhHUaq6Orw5DWq9ZcNlS03BIlEALFeQgeVAo4Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-template-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" - integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== +"@babel/plugin-transform-template-literals@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.0.tgz#a8eced3a8e7b8e2d40ec4ec4548a45912630d302" + integrity sha512-Rd4Ic89hA/f7xUSJQk5PnC+4so50vBoBfxjdQAdvngwidM8jYIBVxBZ/sARxD4e0yMXRbJVDrYf7dyRtIIKT6Q== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-typeof-symbol@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" - integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== +"@babel/plugin-transform-typeof-symbol@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.0.tgz#8b19a244c6f8c9d668dca6a6f754ad6ead1128f2" + integrity sha512-++V2L8Bdf4vcaHi2raILnptTBjGEFxn5315YU+e8+EqXIucA+q349qWngCLpUYqqv233suJ6NOienIVUpS9cqg== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-unicode-escapes@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" - integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== +"@babel/plugin-transform-unicode-escapes@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.0.tgz#1a354064b4c45663a32334f46fa0cf6100b5b1f3" + integrity sha512-VFi4dhgJM7Bpk8lRc5CMaRGlKZ29W9C3geZjt9beuzSUrlJxsNwX7ReLwaL6WEvsOf2EQkyIJEPtF8EXjB/g2A== dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-unicode-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" - integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== +"@babel/plugin-transform-unicode-regex@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.0.tgz#293b80950177c8c85aede87cef280259fb995402" + integrity sha512-jHLK4LxhHjvCeZDWyA9c+P9XH1sOxRd1RO9xMtDVRAOND/PczPqizEtVdx4TQF/wyPaewqpT+tgQFYMnN/P94A== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.0" "@babel/helper-plugin-utils" "^7.14.5" -"@babel/preset-env@^7.15.8": - version "7.15.8" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.8.tgz#f527ce5bcb121cd199f6b502bf23e420b3ff8dba" - integrity sha512-rCC0wH8husJgY4FPbHsiYyiLxSY8oMDJH7Rl6RQMknbN9oDDHhM9RDFvnGM2MgkbUJzSQB4gtuwygY5mCqGSsA== +"@babel/preset-env@^7.16.4": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.4.tgz#4f6ec33b2a3fe72d6bfdcdf3859500232563a2e3" + integrity sha512-v0QtNd81v/xKj4gNKeuAerQ/azeNn/G1B1qMLeXOcV8+4TWlD2j3NV1u8q29SDFBXx/NBq5kyEAO+0mpRgacjA== dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" + "@babel/compat-data" "^7.16.4" + "@babel/helper-compilation-targets" "^7.16.3" "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.15.4" - "@babel/plugin-proposal-async-generator-functions" "^7.15.8" - "@babel/plugin-proposal-class-properties" "^7.14.5" - "@babel/plugin-proposal-class-static-block" "^7.15.4" - "@babel/plugin-proposal-dynamic-import" "^7.14.5" - "@babel/plugin-proposal-export-namespace-from" "^7.14.5" - "@babel/plugin-proposal-json-strings" "^7.14.5" - "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" - "@babel/plugin-proposal-numeric-separator" "^7.14.5" - "@babel/plugin-proposal-object-rest-spread" "^7.15.6" - "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-private-methods" "^7.14.5" - "@babel/plugin-proposal-private-property-in-object" "^7.15.4" - "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.2" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.0" + "@babel/plugin-proposal-async-generator-functions" "^7.16.4" + "@babel/plugin-proposal-class-properties" "^7.16.0" + "@babel/plugin-proposal-class-static-block" "^7.16.0" + "@babel/plugin-proposal-dynamic-import" "^7.16.0" + "@babel/plugin-proposal-export-namespace-from" "^7.16.0" + "@babel/plugin-proposal-json-strings" "^7.16.0" + "@babel/plugin-proposal-logical-assignment-operators" "^7.16.0" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.0" + "@babel/plugin-proposal-numeric-separator" "^7.16.0" + "@babel/plugin-proposal-object-rest-spread" "^7.16.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.16.0" + "@babel/plugin-proposal-optional-chaining" "^7.16.0" + "@babel/plugin-proposal-private-methods" "^7.16.0" + "@babel/plugin-proposal-private-property-in-object" "^7.16.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.16.0" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" @@ -911,50 +919,50 @@ "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.14.5" - "@babel/plugin-transform-async-to-generator" "^7.14.5" - "@babel/plugin-transform-block-scoped-functions" "^7.14.5" - "@babel/plugin-transform-block-scoping" "^7.15.3" - "@babel/plugin-transform-classes" "^7.15.4" - "@babel/plugin-transform-computed-properties" "^7.14.5" - "@babel/plugin-transform-destructuring" "^7.14.7" - "@babel/plugin-transform-dotall-regex" "^7.14.5" - "@babel/plugin-transform-duplicate-keys" "^7.14.5" - "@babel/plugin-transform-exponentiation-operator" "^7.14.5" - "@babel/plugin-transform-for-of" "^7.15.4" - "@babel/plugin-transform-function-name" "^7.14.5" - "@babel/plugin-transform-literals" "^7.14.5" - "@babel/plugin-transform-member-expression-literals" "^7.14.5" - "@babel/plugin-transform-modules-amd" "^7.14.5" - "@babel/plugin-transform-modules-commonjs" "^7.15.4" - "@babel/plugin-transform-modules-systemjs" "^7.15.4" - "@babel/plugin-transform-modules-umd" "^7.14.5" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.9" - "@babel/plugin-transform-new-target" "^7.14.5" - "@babel/plugin-transform-object-super" "^7.14.5" - "@babel/plugin-transform-parameters" "^7.15.4" - "@babel/plugin-transform-property-literals" "^7.14.5" - "@babel/plugin-transform-regenerator" "^7.14.5" - "@babel/plugin-transform-reserved-words" "^7.14.5" - "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.15.8" - "@babel/plugin-transform-sticky-regex" "^7.14.5" - "@babel/plugin-transform-template-literals" "^7.14.5" - "@babel/plugin-transform-typeof-symbol" "^7.14.5" - "@babel/plugin-transform-unicode-escapes" "^7.14.5" - "@babel/plugin-transform-unicode-regex" "^7.14.5" - "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.15.6" - babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.5" - babel-plugin-polyfill-regenerator "^0.2.2" - core-js-compat "^3.16.0" + "@babel/plugin-transform-arrow-functions" "^7.16.0" + "@babel/plugin-transform-async-to-generator" "^7.16.0" + "@babel/plugin-transform-block-scoped-functions" "^7.16.0" + "@babel/plugin-transform-block-scoping" "^7.16.0" + "@babel/plugin-transform-classes" "^7.16.0" + "@babel/plugin-transform-computed-properties" "^7.16.0" + "@babel/plugin-transform-destructuring" "^7.16.0" + "@babel/plugin-transform-dotall-regex" "^7.16.0" + "@babel/plugin-transform-duplicate-keys" "^7.16.0" + "@babel/plugin-transform-exponentiation-operator" "^7.16.0" + "@babel/plugin-transform-for-of" "^7.16.0" + "@babel/plugin-transform-function-name" "^7.16.0" + "@babel/plugin-transform-literals" "^7.16.0" + "@babel/plugin-transform-member-expression-literals" "^7.16.0" + "@babel/plugin-transform-modules-amd" "^7.16.0" + "@babel/plugin-transform-modules-commonjs" "^7.16.0" + "@babel/plugin-transform-modules-systemjs" "^7.16.0" + "@babel/plugin-transform-modules-umd" "^7.16.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.0" + "@babel/plugin-transform-new-target" "^7.16.0" + "@babel/plugin-transform-object-super" "^7.16.0" + "@babel/plugin-transform-parameters" "^7.16.3" + "@babel/plugin-transform-property-literals" "^7.16.0" + "@babel/plugin-transform-regenerator" "^7.16.0" + "@babel/plugin-transform-reserved-words" "^7.16.0" + "@babel/plugin-transform-shorthand-properties" "^7.16.0" + "@babel/plugin-transform-spread" "^7.16.0" + "@babel/plugin-transform-sticky-regex" "^7.16.0" + "@babel/plugin-transform-template-literals" "^7.16.0" + "@babel/plugin-transform-typeof-symbol" "^7.16.0" + "@babel/plugin-transform-unicode-escapes" "^7.16.0" + "@babel/plugin-transform-unicode-regex" "^7.16.0" + "@babel/preset-modules" "^0.1.5" + "@babel/types" "^7.16.0" + babel-plugin-polyfill-corejs2 "^0.3.0" + babel-plugin-polyfill-corejs3 "^0.4.0" + babel-plugin-polyfill-regenerator "^0.3.0" + core-js-compat "^3.19.1" semver "^6.3.0" -"@babel/preset-modules@^0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" - integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== +"@babel/preset-modules@^0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" + integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" @@ -962,41 +970,41 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/runtime@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" - integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== +"@babel/runtime@^7.16.3": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" + integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== dependencies: regenerator-runtime "^0.13.4" "@babel/runtime@^7.8.4": version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz" integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA== dependencies: regenerator-runtime "^0.13.4" "@babel/template@^7.12.13": version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz" integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== dependencies: "@babel/code-frame" "^7.12.13" "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/template@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== +"@babel/template@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" + integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" + "@babel/code-frame" "^7.16.0" + "@babel/parser" "^7.16.0" + "@babel/types" "^7.16.0" "@babel/traverse@^7.13.0": version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz" integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== dependencies: "@babel/code-frame" "^7.12.13" @@ -1008,45 +1016,45 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" +"@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3": + version "7.16.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" + integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== + dependencies: + "@babel/code-frame" "^7.16.0" + "@babel/generator" "^7.16.0" + "@babel/helper-function-name" "^7.16.0" + "@babel/helper-hoist-variables" "^7.16.0" + "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/parser" "^7.16.3" + "@babel/types" "^7.16.0" debug "^4.1.0" globals "^11.1.0" "@babel/types@^7.12.13", "@babel/types@^7.13.12", "@babel/types@^7.14.2", "@babel/types@^7.4.4": version "7.14.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.2.tgz#4208ae003107ef8a057ea8333e56eb64d2f6a2c3" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz" integrity sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw== dependencies: "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" -"@babel/types@^7.15.4", "@babel/types@^7.15.6": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== +"@babel/types@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" + integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== dependencies: - "@babel/helper-validator-identifier" "^7.14.9" + "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" "@discoveryjs/json-ext@^0.5.0": version "0.5.3" - resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz#90420f9f9c6d3987f176a19a7d8e764271a2f55d" + resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz" integrity sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g== "@types/eslint-scope@^3.7.0": version "3.7.0" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.0.tgz#4792816e31119ebd506902a482caec4951fabd86" + resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz" integrity sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw== dependencies: "@types/eslint" "*" @@ -1054,7 +1062,7 @@ "@types/eslint@*": version "7.2.11" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.11.tgz#180b58f5bb7d7376e39d22496e2b08901aa52fd2" + resolved "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.11.tgz" integrity sha512-WYhv//5K8kQtsSc9F1Kn2vHzhYor6KpwPbARH7hwYe3C3ETD0EVx/3P5qQybUoaBEuUa9f/02JjBiXFWalYUmw== dependencies: "@types/estree" "*" @@ -1062,37 +1070,37 @@ "@types/estree@*": version "0.0.47" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4" + resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.47.tgz" integrity sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg== "@types/estree@^0.0.50": version "0.0.50" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz" integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== "@types/json-schema@*", "@types/json-schema@^7.0.5": version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz" integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== "@types/json-schema@^7.0.8": version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== "@types/node@*", "@types/node@^15.6.0": version "15.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.6.0.tgz#f0ddca5a61e52627c9dcb771a6039d44694597bc" + resolved "https://registry.npmjs.org/@types/node/-/node-15.6.0.tgz" integrity sha512-gCYSfQpy+LYhOFTKAeE8BkyGqaxmlFxe+n4DKM6DR0wzw/HISUE/hAmkC/KT8Sw5PCJblqg062b3z9gucv3k0A== -"@types/three@^0.133.0": - version "0.133.0" - resolved "https://registry.yarnpkg.com/@types/three/-/three-0.133.0.tgz#2e344ce10bc81dc89295b79a98c09932b3f0c294" - integrity sha512-neDN9L64GK1fhT2raWXYIFvIr6ktM6XYgssfTh4zZp+XRgowD1qJ4/w79hLrLQ0w87u1E91ZfvHB0198wBsuHg== +"@types/three@^0.134.0": + version "0.134.0" + resolved "https://registry.yarnpkg.com/@types/three/-/three-0.134.0.tgz#22ae9892f4490faaf35f0ccea127df18407b8ab3" + integrity sha512-4YB+99Rgqq27EjiYTItEoZtdjLnTh8W9LxowgpC9eWsjaQJIL4Kn/ZcUKAnW3gB/jS4hqGN8iqmid+RcUZDzpA== "@webassemblyjs/ast@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz" integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== dependencies: "@webassemblyjs/helper-numbers" "1.11.1" @@ -1100,22 +1108,22 @@ "@webassemblyjs/floating-point-hex-parser@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz" integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== "@webassemblyjs/helper-api-error@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz" integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== "@webassemblyjs/helper-buffer@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz" integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== "@webassemblyjs/helper-numbers@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz" integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== dependencies: "@webassemblyjs/floating-point-hex-parser" "1.11.1" @@ -1124,12 +1132,12 @@ "@webassemblyjs/helper-wasm-bytecode@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz" integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== "@webassemblyjs/helper-wasm-section@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz" integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== dependencies: "@webassemblyjs/ast" "1.11.1" @@ -1139,26 +1147,26 @@ "@webassemblyjs/ieee754@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz" integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== dependencies: "@xtuc/ieee754" "^1.2.0" "@webassemblyjs/leb128@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz" integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== dependencies: "@xtuc/long" "4.2.2" "@webassemblyjs/utf8@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz" integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== "@webassemblyjs/wasm-edit@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz" integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== dependencies: "@webassemblyjs/ast" "1.11.1" @@ -1172,7 +1180,7 @@ "@webassemblyjs/wasm-gen@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz" integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== dependencies: "@webassemblyjs/ast" "1.11.1" @@ -1183,7 +1191,7 @@ "@webassemblyjs/wasm-opt@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz" integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== dependencies: "@webassemblyjs/ast" "1.11.1" @@ -1193,7 +1201,7 @@ "@webassemblyjs/wasm-parser@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz" integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== dependencies: "@webassemblyjs/ast" "1.11.1" @@ -1205,7 +1213,7 @@ "@webassemblyjs/wast-printer@1.11.1": version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz" integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== dependencies: "@webassemblyjs/ast" "1.11.1" @@ -1213,49 +1221,49 @@ "@webpack-cli/configtest@^1.1.0": version "1.1.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.0.tgz#8342bef0badfb7dfd3b576f2574ab80c725be043" + resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.0.tgz" integrity sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg== "@webpack-cli/info@^1.4.0": version "1.4.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.0.tgz#b9179c3227ab09cbbb149aa733475fcf99430223" + resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.0.tgz" integrity sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw== dependencies: envinfo "^7.7.3" "@webpack-cli/serve@^1.6.0": version "1.6.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.0.tgz#2c275aa05c895eccebbfc34cfb223c6e8bd591a2" + resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.0.tgz" integrity sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA== "@xtuc/ieee754@^1.2.0": version "1.2.0" - resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz" integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== "@xtuc/long@4.2.2": version "4.2.2" - resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== acorn-import-assertions@^1.7.6: version "1.8.0" - resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" + resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== acorn@^8.4.1: version "8.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz" integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== ajv-keywords@^3.5.2: version "3.5.2" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" @@ -1265,21 +1273,21 @@ ajv@^6.12.4, ajv@^6.12.5: ansi-styles@^3.2.1: version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-styles@^4.1.0: version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" babel-loader@^8.2.2: version "8.2.2" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" + resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.2.tgz" integrity sha512-JvTd0/D889PQBtUXJ2PXaKU/pjZDMtHA9V2ecm+eNRmmBCMR09a+fmpGTNwnJtFmFl5Ei7Vy47LjBb+L0wQ99g== dependencies: find-cache-dir "^3.3.1" @@ -1289,48 +1297,48 @@ babel-loader@^8.2.2: babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" - resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" + resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz" integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== dependencies: object.assign "^4.1.0" -babel-plugin-polyfill-corejs2@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" - integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== +babel-plugin-polyfill-corejs2@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz#407082d0d355ba565af24126fb6cb8e9115251fd" + integrity sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.3.0" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.5.tgz#2779846a16a1652244ae268b1e906ada107faf92" - integrity sha512-ninF5MQNwAX9Z7c9ED+H2pGt1mXdP4TqzlHKyPIYmJIYz0N+++uwdM7RnJukklhzJ54Q84vA4ZJkgs7lu5vqcw== +babel-plugin-polyfill-corejs3@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz#0b571f4cf3d67f911512f5c04842a7b8e8263087" + integrity sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" - core-js-compat "^3.16.2" + "@babel/helper-define-polyfill-provider" "^0.3.0" + core-js-compat "^3.18.0" -babel-plugin-polyfill-regenerator@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" - integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== +babel-plugin-polyfill-regenerator@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz#9ebbcd7186e1a33e21c5e20cae4e7983949533be" + integrity sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" + "@babel/helper-define-polyfill-provider" "^0.3.0" balanced-match@^1.0.0: version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== big.js@^5.2.2: version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== brace-expansion@^1.1.7: version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" @@ -1338,14 +1346,14 @@ brace-expansion@^1.1.7: braces@^3.0.1: version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" -browserslist@^4.14.5, browserslist@^4.16.6: +browserslist@^4.14.5: version "4.16.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz" integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== dependencies: caniuse-lite "^1.0.30001219" @@ -1354,43 +1362,38 @@ browserslist@^4.14.5, browserslist@^4.16.6: escalade "^3.1.1" node-releases "^1.1.71" -browserslist@^4.17.3: - version "4.17.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.3.tgz#2844cd6eebe14d12384b0122d217550160d2d624" - integrity sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ== +browserslist@^4.17.5, browserslist@^4.17.6: + version "4.18.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.18.1.tgz#60d3920f25b6860eb917c6c7b185576f4d8b017f" + integrity sha512-8ScCzdpPwR2wQh8IT82CA2VgDwjHyqMovPBZSNH54+tm4Jk2pCuv90gmAdH6J84OCRWi0b4gMe6O6XPXuJnjgQ== dependencies: - caniuse-lite "^1.0.30001264" - electron-to-chromium "^1.3.857" + caniuse-lite "^1.0.30001280" + electron-to-chromium "^1.3.896" escalade "^3.1.1" - node-releases "^1.1.77" - picocolors "^0.2.1" + node-releases "^2.0.1" + picocolors "^1.0.0" buffer-from@^1.0.0: version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== call-bind@^1.0.0: version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== dependencies: function-bind "^1.1.1" get-intrinsic "^1.0.2" -caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001264: - version "1.0.30001279" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001279.tgz" - integrity sha512-VfEHpzHEXj6/CxggTwSFoZBBYGQfQv9Cf42KPlO79sWXCD1QNKWKsKzFeWL7QpZHJQYAvocqV6Rty1yJMkqWLQ== - -caniuse-lite@^1.0.30001264: - version "1.0.30001265" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz#0613c9e6c922e422792e6fcefdf9a3afeee4f8c3" - integrity sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw== +caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001280: + version "1.0.30001282" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001282.tgz#38c781ee0a90ccfe1fe7fefd00e43f5ffdcb96fd" + integrity sha512-YhF/hG6nqBEllymSIjLtR2iWDDnChvhnVJqp+vloyt2tEHFG1yBR+ac2B/rOw0qOK0m0lEXU2dv4E/sMk5P9Kg== chalk@^2.0.0: version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" @@ -1399,7 +1402,7 @@ chalk@^2.0.0: chalk@^4.1.0: version "4.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz" integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== dependencies: ansi-styles "^4.1.0" @@ -1407,12 +1410,12 @@ chalk@^4.1.0: chrome-trace-event@^1.0.2: version "1.0.3" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz" integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== clone-deep@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== dependencies: is-plain-object "^2.0.4" @@ -1421,76 +1424,76 @@ clone-deep@^4.0.1: color-convert@^1.9.0: version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@1.1.3: version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= color-name@~1.1.4: version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== colorette@^1.2.2: version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== colorette@^2.0.14: version "2.0.16" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz" integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== commander@^2.20.0: version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commander@^7.0.0: version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== commondir@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz" integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= concat-map@0.0.1: version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= convert-source-map@^1.7.0: version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz" integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== dependencies: safe-buffer "~5.1.1" -core-js-compat@^3.16.0, core-js-compat@^3.16.2: - version "3.18.2" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.2.tgz#e40c266fbd613948dd8d2d2156345da8ac03c142" - integrity sha512-25VJYCJtGjZwLguj7d66oiHfmnVw3TMOZ0zV8DyMJp/aeQ3OjR519iOOeck08HMyVVRAqXxafc2Hl+5QstJrsQ== +core-js-compat@^3.18.0, core-js-compat@^3.19.1: + version "3.19.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.19.1.tgz#fe598f1a9bf37310d77c3813968e9f7c7bb99476" + integrity sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g== dependencies: - browserslist "^4.17.3" + browserslist "^4.17.6" semver "7.0.0" cross-spawn@^7.0.3: version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" @@ -1499,36 +1502,36 @@ cross-spawn@^7.0.3: debug@^4.1.0, debug@^4.1.1: version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== dependencies: ms "2.1.2" define-properties@^1.1.3: version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: object-keys "^1.0.12" electron-to-chromium@^1.3.723: version "1.3.736" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.736.tgz#f632d900a1f788dab22fec9c62ec5c9c8f0c4052" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.736.tgz" integrity sha512-DY8dA7gR51MSo66DqitEQoUMQ0Z+A2DSXFi7tK304bdTVqczCAfUuyQw6Wdg8hIoo5zIxkU1L24RQtUce1Ioig== -electron-to-chromium@^1.3.857: - version "1.3.864" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.864.tgz#6a993bcc196a2b8b3df84d28d5d4dd912393885f" - integrity sha512-v4rbad8GO6/yVI92WOeU9Wgxc4NA0n4f6P1FvZTY+jyY7JHEhw3bduYu60v3Q1h81Cg6eo4ApZrFPuycwd5hGw== +electron-to-chromium@^1.3.896: + version "1.3.900" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.900.tgz#5be2c5818a2a012c511b4b43e87b6ab7a296d4f5" + integrity sha512-SuXbQD8D4EjsaBaJJxySHbC+zq8JrFfxtb4GIr4E9n1BcROyMcRrJCYQNpJ9N+Wjf5mFp7Wp0OHykd14JNEzzQ== emojis-list@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== enhanced-resolve@^5.0.0: version "5.8.2" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz" integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA== dependencies: graceful-fs "^4.2.4" @@ -1536,7 +1539,7 @@ enhanced-resolve@^5.0.0: enhanced-resolve@^5.8.3: version "5.8.3" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz" integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== dependencies: graceful-fs "^4.2.4" @@ -1544,27 +1547,27 @@ enhanced-resolve@^5.8.3: envinfo@^7.7.3: version "7.8.1" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" + resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== es-module-lexer@^0.9.0: version "0.9.3" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== escalade@^3.1.1: version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== escape-string-regexp@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= eslint-scope@5.1.1: version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== dependencies: esrecurse "^4.3.0" @@ -1572,34 +1575,34 @@ eslint-scope@5.1.1: esrecurse@^4.3.0: version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== dependencies: estraverse "^5.2.0" estraverse@^4.1.1: version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.2.0: version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz" integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== esutils@^2.0.2: version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== events@^3.2.0: version "3.3.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== execa@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" + resolved "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz" integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== dependencies: cross-spawn "^7.0.3" @@ -1614,29 +1617,29 @@ execa@^5.0.0: fast-deep-equal@^3.1.1: version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-json-stable-stringify@^2.0.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fastest-levenshtein@^1.0.12: version "1.0.12" - resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" + resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz" integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== fill-range@^7.0.1: version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== dependencies: to-regex-range "^5.0.1" find-cache-dir@^3.3.1: version "3.3.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz" integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== dependencies: commondir "^1.0.1" @@ -1645,7 +1648,7 @@ find-cache-dir@^3.3.1: find-up@^4.0.0: version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: locate-path "^5.0.0" @@ -1653,22 +1656,22 @@ find-up@^4.0.0: fs.realpath@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= function-bind@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== gensync@^1.0.0-beta.2: version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== get-intrinsic@^1.0.2: version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== dependencies: function-bind "^1.1.1" @@ -1677,17 +1680,17 @@ get-intrinsic@^1.0.2: get-stream@^6.0.0: version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== glob-to-regexp@^0.4.1: version "0.4.1" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== glob@^7.2.0: version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" @@ -1699,44 +1702,44 @@ glob@^7.2.0: globals@^11.1.0: version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== graceful-fs@^4.1.2, graceful-fs@^4.2.4: version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== has-flag@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-flag@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== has-symbols@^1.0.1: version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== has@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" human-signals@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== import-local@^3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6" + resolved "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz" integrity sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA== dependencies: pkg-dir "^4.2.0" @@ -1744,7 +1747,7 @@ import-local@^3.0.2: inflight@^1.0.4: version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" @@ -1752,51 +1755,51 @@ inflight@^1.0.4: inherits@2: version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== interpret@^2.2.0: version "2.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" + resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== is-core-module@^2.2.0: version "2.4.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz" integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== dependencies: has "^1.0.3" is-number@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-plain-object@^2.0.4: version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-stream@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== isexe@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^3.0.1: version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= jest-worker@^27.0.6: version "27.2.5" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.2.5.tgz#ed42865661959488aa020e8a325df010597c36d4" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.5.tgz" integrity sha512-HTjEPZtcNKZ4LnhSp02NEH4vE+5OpJ0EsOWYvGQpHgUMLngydESAAMH5Wd/asPf29+XUDQZszxpLg1BkIIA2aw== dependencies: "@types/node" "*" @@ -1805,61 +1808,61 @@ jest-worker@^27.0.6: js-tokens@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== jsesc@^2.5.1: version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== jsesc@~0.5.0: version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json-parse-better-errors@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== json-schema-traverse@^0.4.1: version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json5@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz" integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== dependencies: minimist "^1.2.0" json5@^2.1.2: version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== dependencies: minimist "^1.2.5" jsonc-parser@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.0.0.tgz#abdd785701c7e7eaca8a9ec8cf070ca51a745a22" + resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz" integrity sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA== kind-of@^6.0.2: version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== loader-runner@^4.2.0: version "4.2.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" + resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== loader-utils@^1.4.0: version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz" integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== dependencies: big.js "^5.2.2" @@ -1868,55 +1871,55 @@ loader-utils@^1.4.0: locate-path@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== dependencies: p-locate "^4.1.0" lodash.debounce@^4.0.8: version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= lru-cache@^5.1.1: version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== dependencies: yallist "^3.0.2" lru-cache@^6.0.0: version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== dependencies: yallist "^4.0.0" lunr@^2.3.9: version "2.3.9" - resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" + resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz" integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== dependencies: semver "^6.0.0" -marked@^3.0.4: - version "3.0.7" - resolved "https://registry.yarnpkg.com/marked/-/marked-3.0.7.tgz#343aad9e91b96249b495c99c512ea09cfe06de1e" - integrity sha512-ctKqbnLuNbsHbI26cfMyOlKgXGfl1orOv1AvWWDX7AkgfMOwCWvmuYc+mVLeWhQ9W6hdWVBynOs96VkcscKo0Q== +marked@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/marked/-/marked-3.0.8.tgz#2785f0dc79cbdc6034be4bb4f0f0a396bd3f8aeb" + integrity sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw== merge-stream@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== micromatch@^4.0.0: version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== dependencies: braces "^3.0.1" @@ -1924,68 +1927,68 @@ micromatch@^4.0.0: mime-db@1.47.0: version "1.47.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.47.0.tgz#8cb313e59965d3c05cfbf898915a267af46a335c" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz" integrity sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw== mime-types@^2.1.27: version "2.1.30" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.30.tgz#6e7be8b4c479825f85ed6326695db73f9305d62d" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz" integrity sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg== dependencies: mime-db "1.47.0" mimic-fn@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== minimatch@^3.0.4: version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== ms@2.1.2: version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== neo-async@^2.6.2: version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== node-releases@^1.1.71: version "1.1.72" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz" integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw== -node-releases@^1.1.77: - version "1.1.77" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" - integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== +node-releases@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== npm-run-path@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== dependencies: path-key "^3.0.0" object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object.assign@^4.1.0: version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz" integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== dependencies: call-bind "^1.0.0" @@ -1995,139 +1998,139 @@ object.assign@^4.1.0: once@^1.3.0: version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" onetime@^5.1.2: version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: mimic-fn "^2.1.0" onigasm@^2.2.5: version "2.2.5" - resolved "https://registry.yarnpkg.com/onigasm/-/onigasm-2.2.5.tgz#cc4d2a79a0fa0b64caec1f4c7ea367585a676892" + resolved "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz" integrity sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA== dependencies: lru-cache "^5.1.1" p-limit@^2.2.0: version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" p-limit@^3.1.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" p-locate@^4.1.0: version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== dependencies: p-limit "^2.2.0" p-try@^2.0.0: version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== path-exists@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== -picocolors@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" - integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== picomatch@^2.2.3: version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== dependencies: find-up "^4.0.0" prettier@^2.4.1: version "2.4.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c" + resolved "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz" integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA== punycode@^2.1.0: version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== randombytes@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" rechoir@^0.7.0: version "0.7.0" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz" integrity sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q== dependencies: resolve "^1.9.0" regenerate-unicode-properties@^8.2.0: version "8.2.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" + resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz" integrity sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA== dependencies: regenerate "^1.4.0" regenerate@^1.4.0: version "1.4.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== regenerator-runtime@^0.13.4: version "0.13.7" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz" integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== regenerator-transform@^0.14.2: version "0.14.5" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4" + resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz" integrity sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw== dependencies: "@babel/runtime" "^7.8.4" regexpu-core@^4.7.1: version "4.7.1" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.1.tgz#2dea5a9a07233298fbf0db91fa9abc4c6e0f8ad6" + resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz" integrity sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ== dependencies: regenerate "^1.4.0" @@ -2139,31 +2142,31 @@ regexpu-core@^4.7.1: regjsgen@^0.5.1: version "0.5.2" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" + resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz" integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== regjsparser@^0.6.4: version "0.6.9" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.9.tgz#b489eef7c9a2ce43727627011429cf833a7183e6" + resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz" integrity sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ== dependencies: jsesc "~0.5.0" resolve-cwd@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== dependencies: resolve-from "^5.0.0" resolve-from@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve@^1.14.2, resolve@^1.9.0: version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== dependencies: is-core-module "^2.2.0" @@ -2171,17 +2174,17 @@ resolve@^1.14.2, resolve@^1.9.0: safe-buffer@^5.1.0: version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== safe-buffer@~5.1.1: version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== schema-utils@^2.6.5: version "2.7.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz" integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== dependencies: "@types/json-schema" "^7.0.5" @@ -2190,7 +2193,7 @@ schema-utils@^2.6.5: schema-utils@^3.1.0, schema-utils@^3.1.1: version "3.1.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz" integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== dependencies: "@types/json-schema" "^7.0.8" @@ -2199,51 +2202,51 @@ schema-utils@^3.1.0, schema-utils@^3.1.1: semver@7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" + resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== semver@^7.3.4: version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz" integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" serialize-javascript@^6.0.0: version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" shallow-clone@^3.0.0: version "3.0.1" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz" integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== dependencies: kind-of "^6.0.2" shebang-command@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== dependencies: shebang-regex "^3.0.0" shebang-regex@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shiki@^0.9.11: - version "0.9.11" - resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.9.11.tgz#07d75dab2abb6dc12a01f79a397cb1c391fa22d8" - integrity sha512-tjruNTLFhU0hruCPoJP0y+B9LKOmcqUhTpxn7pcJB3fa+04gFChuEmxmrUfOJ7ZO6Jd+HwMnDHgY3lv3Tqonuw== +shiki@^0.9.12: + version "0.9.12" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.9.12.tgz#70cbc8c1bb78ff7b356f84a7eecdb040efddd247" + integrity sha512-VXcROdldv0/Qu0w2XvzU4IrvTeBNs/Kj/FCmtcEXGz7Tic/veQzliJj6tEiAgoKianhQstpYmbPDStHU5Opqcw== dependencies: jsonc-parser "^3.0.0" onigasm "^2.2.5" @@ -2251,12 +2254,12 @@ shiki@^0.9.11: signal-exit@^3.0.3: version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== source-map-support@~0.5.20: version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz" integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== dependencies: buffer-from "^1.0.0" @@ -2264,53 +2267,53 @@ source-map-support@~0.5.20: source-map@^0.5.0: version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@~0.7.2: version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== strip-final-newline@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== supports-color@^5.3.0: version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" supports-color@^7.1.0: version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" supports-color@^8.0.0: version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" tapable@^2.1.1, tapable@^2.2.0: version "2.2.0" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b" + resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz" integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw== terser-webpack-plugin@^5.1.3: version "5.2.4" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz#ad1be7639b1cbe3ea49fab995cbe7224b31747a1" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz" integrity sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA== dependencies: jest-worker "^27.0.6" @@ -2322,33 +2325,33 @@ terser-webpack-plugin@^5.1.3: terser@^5.7.2: version "5.9.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" + resolved "https://registry.npmjs.org/terser/-/terser-5.9.0.tgz" integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== dependencies: commander "^2.20.0" source-map "~0.7.2" source-map-support "~0.5.20" -three@^0.133.0: - version "0.133.1" - resolved "https://registry.yarnpkg.com/three/-/three-0.133.1.tgz#5606f4817d67a09d9212d4ccbd6826564774f8f4" - integrity sha512-WydohO8ll949B0FTD6MGz59Yv2Lwj8hvObg/0Heh2r42S6+tQC1WByfCNRdmG4D7+odfGod+n8JPV1I2xrboWw== +three@^0.134.0: + version "0.134.0" + resolved "https://registry.npmjs.org/three/-/three-0.134.0.tgz" + integrity sha512-LbBerg7GaSPjYtTOnu41AMp7tV6efUNR3p4Wk5NzkSsNTBuA5mDGOfwwZL1jhhVMLx9V20HolIUo0+U3AXehbg== to-fast-properties@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" ts-loader@^9.2.6: version "9.2.6" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.6.tgz#9937c4dd0a1e3dbbb5e433f8102a6601c6615d74" + resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz" integrity sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw== dependencies: chalk "^4.1.0" @@ -2356,30 +2359,30 @@ ts-loader@^9.2.6: micromatch "^4.0.0" semver "^7.3.4" -typedoc@^0.22.5: - version "0.22.5" - resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.5.tgz#c1a7c33fcdc808f57c766584a6afb47762944229" - integrity sha512-KFrWGU1iKiTGw0RcyjLNYDmhd7uICU14HgBNPmFKY/sT4Pm/fraaLyWyisst9vGTUAKxqibqoDITR7+ZcAkhHg== +typedoc@^0.22.9: + version "0.22.9" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.9.tgz#7e3f4f72586bbef4c2382f0afcea8e0f9270b712" + integrity sha512-84PjudoXVcap6bwdZFbYIUWlgdz/iLV09ZHwrCzhtHWXaDQG6mlosJ8te6DSThuRkRvQjp46HO+qY/P7Gpm78g== dependencies: glob "^7.2.0" lunr "^2.3.9" - marked "^3.0.4" + marked "^3.0.8" minimatch "^3.0.4" - shiki "^0.9.11" + shiki "^0.9.12" typescript@^4.2.4: version "4.2.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz" integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + resolved "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz" integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== unicode-match-property-ecmascript@^1.0.4: version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + resolved "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz" integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== dependencies: unicode-canonical-property-names-ecmascript "^1.0.4" @@ -2387,43 +2390,38 @@ unicode-match-property-ecmascript@^1.0.4: unicode-match-property-value-ecmascript@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz#0d91f600eeeb3096aa962b1d6fc88876e64ea531" + resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz" integrity sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ== unicode-property-aliases-ecmascript@^1.0.4: version "1.1.0" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz#dd57a99f6207bedff4628abefb94c50db941c8f4" + resolved "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz" integrity sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg== uri-js@^4.2.2: version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" -v8-compile-cache@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - vscode-textmate@5.2.0: version "5.2.0" - resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e" + resolved "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz" integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ== watchpack@^2.2.0: version "2.2.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.2.0.tgz#47d78f5415fe550ecd740f99fe2882323a58b1ce" + resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.2.0.tgz" integrity sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" -webpack-cli@^4.9.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.0.tgz#dc43e6e0f80dd52e89cbf73d5294bcd7ad6eb343" - integrity sha512-n/jZZBMzVEl4PYIBs+auy2WI0WTQ74EnJDiyD98O2JZY6IVIHJNitkYp/uTXOviIOMfgzrNvC9foKv/8o8KSZw== +webpack-cli@^4.9.1: + version "4.9.1" + resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.1.tgz" + integrity sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ== dependencies: "@discoveryjs/json-ext" "^0.5.0" "@webpack-cli/configtest" "^1.1.0" @@ -2436,26 +2434,25 @@ webpack-cli@^4.9.0: import-local "^3.0.2" interpret "^2.2.0" rechoir "^0.7.0" - v8-compile-cache "^2.2.0" webpack-merge "^5.7.3" webpack-merge@^5.7.3: version "5.7.3" - resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.7.3.tgz#2a0754e1877a25a8bbab3d2475ca70a052708213" + resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz" integrity sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA== dependencies: clone-deep "^4.0.1" wildcard "^2.0.0" -webpack-sources@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.1.tgz#251a7d9720d75ada1469ca07dbb62f3641a05b6d" - integrity sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA== +webpack-sources@^3.2.2: + version "3.2.2" + resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.2.tgz" + integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw== -webpack@^5.58.1: - version "5.58.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.58.1.tgz#df8aad72b617a9d0db8c89d4f410784ee93320d7" - integrity sha512-4Z/dmbTU+VmkCb2XNgW7wkE5TfEcSooclprn/UEuVeAkwHhn07OcgUsyaKHGtCY/VobjnsYBlyhKeMLiSoOqPg== +webpack@^5.64.1: + version "5.64.1" + resolved "https://registry.npmjs.org/webpack/-/webpack-5.64.1.tgz" + integrity sha512-b4FHmRgaaAjP+aVOVz41a9Qa5SmkUPQ+u8FntTQ1roPHahSComB6rXnLwc976VhUY4CqTaLu5mCswuHiNhOfVw== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.50" @@ -2480,36 +2477,36 @@ webpack@^5.58.1: tapable "^2.1.1" terser-webpack-plugin "^5.1.3" watchpack "^2.2.0" - webpack-sources "^3.2.0" + webpack-sources "^3.2.2" which@^2.0.1: version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" wildcard@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" + resolved "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz" integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== wrappy@1: version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= yallist@^3.0.2: version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== yallist@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yocto-queue@^0.1.0: version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From a84277554face35739be8327b42aa21cf75ffd3b Mon Sep 17 00:00:00 2001 From: kalwalt Date: Wed, 17 Nov 2021 12:49:15 +0100 Subject: [PATCH 10/11] format with prettier --- dist/ARnftThreejs.js | 121 ++++++++++++++++++------- src/filters/ARnftFilter.ts | 45 ++++++---- src/filters/DelayableSignalFilter.ts | 4 +- src/filters/OneEuroFilter.ts | 20 ++--- src/markermedia/NFTaddTJS.ts | 129 ++++++++++++++------------- 5 files changed, 191 insertions(+), 128 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index 1f85223..737c251 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -986,6 +986,12 @@ class GLTFLoader extends three__WEBPACK_IMPORTED_MODULE_0__.Loader { } ); + this.register( function ( parser ) { + + return new GLTFMaterialsSheenExtension( parser ); + + } ); + this.register( function ( parser ) { return new GLTFMaterialsTransmissionExtension( parser ); @@ -1320,6 +1326,7 @@ const EXTENSIONS = { KHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat', KHR_MATERIALS_IOR: 'KHR_materials_ior', KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness', + KHR_MATERIALS_SHEEN: 'KHR_materials_sheen', KHR_MATERIALS_SPECULAR: 'KHR_materials_specular', KHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission', KHR_MATERIALS_UNLIT: 'KHR_materials_unlit', @@ -1596,6 +1603,80 @@ class GLTFMaterialsClearcoatExtension { } +/** + * Sheen Materials Extension + * + * Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen + */ +class GLTFMaterialsSheenExtension { + + constructor( parser ) { + + this.parser = parser; + this.name = EXTENSIONS.KHR_MATERIALS_SHEEN; + + } + + getMaterialType( materialIndex ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; + + return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; + + } + + extendMaterialParams( materialIndex, materialParams ) { + + const parser = this.parser; + const materialDef = parser.json.materials[ materialIndex ]; + + if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { + + return Promise.resolve(); + + } + + const pending = []; + + materialParams.sheenColor = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 0, 0, 0 ); + materialParams.sheenRoughness = 0; + materialParams.sheen = 1; + + const extension = materialDef.extensions[ this.name ]; + + if ( extension.sheenColorFactor !== undefined ) { + + materialParams.sheenColor.fromArray( extension.sheenColorFactor ); + + } + + if ( extension.sheenRoughnessFactor !== undefined ) { + + materialParams.sheenRoughness = extension.sheenRoughnessFactor; + + } + + if ( extension.sheenColorTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'sheenColorMap', extension.sheenColorTexture ) ); + + } + + if ( extension.sheenRoughnessTexture !== undefined ) { + + pending.push( parser.assignTexture( materialParams, 'sheenRoughnessMap', extension.sheenRoughnessTexture ) ); + + } + + return Promise.all( pending ); + + } + +} + /** * Transmission Materials Extension * @@ -1706,7 +1787,7 @@ class GLTFMaterialsVolumeExtension { materialParams.attenuationDistance = extension.attenuationDistance || 0; const colorArray = extension.attenuationColor || [ 1, 1, 1 ]; - materialParams.attenuationTint = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); + materialParams.attenuationColor = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); return Promise.all( pending ); @@ -1809,11 +1890,11 @@ class GLTFMaterialsSpecularExtension { } const colorArray = extension.specularColorFactor || [ 1, 1, 1 ]; - materialParams.specularTint = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); + materialParams.specularColor = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); if ( extension.specularColorTexture !== undefined ) { - pending.push( parser.assignTexture( materialParams, 'specularTintMap', extension.specularColorTexture ).then( function ( texture ) { + pending.push( parser.assignTexture( materialParams, 'specularColorMap', extension.specularColorTexture ).then( function ( texture ) { texture.encoding = three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding; @@ -2779,34 +2860,6 @@ const ALPHA_MODES = { BLEND: 'BLEND' }; -/* UTILITY FUNCTIONS */ - -function resolveURL( url, path ) { - - // Invalid URL - if ( typeof url !== 'string' || url === '' ) return ''; - - // Host Relative URL - if ( /^https?:\/\//i.test( path ) && /^\//.test( url ) ) { - - path = path.replace( /(^https?:\/\/[^\/]+).*/i, '$1' ); - - } - - // Absolute URL http://,https://,// - if ( /^(https?:)?\/\//i.test( url ) ) return url; - - // Data URI - if ( /^data:.*,.*$/i.test( url ) ) return url; - - // Blob URL - if ( /^blob:.*$/i.test( url ) ) return url; - - // Relative URL - return path + url; - -} - /** * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material */ @@ -3466,7 +3519,7 @@ class GLTFParser { return new Promise( function ( resolve, reject ) { - loader.load( resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () { + loader.load( three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () { reject( new Error( 'THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".' ) ); @@ -3712,7 +3765,7 @@ class GLTFParser { } - loader.load( resolveURL( sourceURI, options.path ), onLoad, undefined, reject ); + loader.load( three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.resolveURL( sourceURI, options.path ), onLoad, undefined, reject ); } ); @@ -5284,4 +5337,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO0FBQ3BDLFlBQU0sRUFBRSxVQUQ0QjtBQUVwQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FGTztBQUdwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FIUztBQUlwQyx3QkFBa0IsRUFBRSxVQUFVLENBQUMsUUFBWCxDQUFvQixrQkFKSjtBQUtwQyxlQUFTLEVBQUUsVUFBVSxDQUFDLFFBQVg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Muc2NlbmU7XG4gICAgICAgIGlmIChjYW1lcmFCb29sID09PSB0cnVlKSB7XG4gICAgICAgICAgICB0aGlzLmNhbWVyYSA9IG5ldyBUSFJFRS5QZXJzcGVjdGl2ZUNhbWVyYShcbiAgICAgICAgICAgICAgICBjb25maWdEYXRhLmNhbWVyYS5mb3YsXG4gICAgICAgICAgICAgICAgY29uZmlnRGF0YS5jYW1lcmEucmF0aW8sXG4gICAgICAgICAgICAgICAgY29uZmlnRGF0YS5jYW1lcmEubmVhcixcbiAgICAgICAgICAgICAgICBjb25maWdEYXRhLmNhbWVyYS5mYXJcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNhbWVyYSA9IG5ldyBUSFJFRS5DYW1lcmEoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZlcnNpb24gPSBcIjAuNC4wXCI7XG4gICAgICAgIGNvbnNvbGUubG9nKFwiQVJuZnRUaHJlZWpzIHZlcnNpb246IFwiLCB0aGlzLnZlcnNpb24pO1xuICAgIH1cblxuICAgIGluaXRSZW5kZXJlcigpIHtcbiAgICAgICAgdGhpcy5jYW1lcmEubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0UHJvamVjdGlvbk1hdHJpeFwiLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHRoaXMuY2FtZXJhLnByb2plY3Rpb25NYXRyaXgsIGV2LmRldGFpbC5wcm9qKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMuc2NlbmUuYWRkKHRoaXMuY2FtZXJhKTtcblxuICAgICAgICBjb25zdCBsaWdodCA9IG5ldyBUSFJFRS5BbWJpZW50TGlnaHQoMHhmZmZmZmYpO1xuICAgICAgICB0aGlzLnNjZW5lLmFkZChsaWdodCk7XG5cbiAgICAgICAgdGhpcy50Y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41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgIG1lc2gucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgY29uc3Qgcm9vdCA9IG5ldyBPYmplY3QzRCgpO1xuICAgICAgICByb290Lm5hbWUgPSBcInJvb3QtXCIgKyBuYW1lO1xuICAgICAgICB0aGlzLnNjZW5lLmFkZChyb290KTtcbiAgICAgICAgcm9vdC5hZGQobWVzaCk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtZXNoLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgaWYodGhpcy5fb2VmID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IFtuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApXTtcbiAgICAgICAgICAgICAgICBmaWx0ZXIgPSB0aGlzLl9maWx0ZXIudXBkYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCkgICAgICAgXG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRYKChmaWx0ZXJbMF0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WSgoZmlsdGVyWzBdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooKGZpbHRlclswXS56KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5yb3RhdGlvbi5zZXRGcm9tVmVjdG9yMyhmaWx0ZXJbMV0pO1xuICAgICAgICAgICAgICAgIHJvb3Quc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y5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0gKChtc2cud2lkdGggLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJvb3QuYWRkKG1vZGVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmKHRoaXMuX29lZiA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBbbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKV07XG4gICAgICAgICAgICAgICAgZmlsdGVyID0gdGhpcy5fZmlsdGVyLnVwZGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpICAgIFxuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WCgoZmlsdGVyWzBdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKChmaWx0ZXJbMF0ueikpO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRZKChmaWx0ZXJbMl0ueSkpO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bi54ID0gKChtc2cud2lkdGggLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGNhbGxiYWNrKGdsdGYpO1xuICAgICAgICAgICAgcm9vdC5hZGQobW9kZWwpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcImdldE1hdHJpeEdMX1JILVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIG1vZGVsLnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgaWYodGhpcy5fb2VmID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IFtuZXcgVmVjdG9yMygwLDAsMCksIG5ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApXTtcbiAgICAgICAgICAgICAgICBmaWx0ZXIgPSB0aGlzLl9maWx0ZXIudXBkYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCkgIFxuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WCgoZmlsdGVyWzBdLngpKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFkoKGZpbHRlclswXS55KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKChmaWx0ZXJbMF0ueikpO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoKGZpbHRlclsyXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRZKChmaWx0ZXJbMl0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0Wigo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KHBsYW5lR2VvbSwgbWF0KTtcbiAgICAgICAgcGxhbmUuc2NhbGUuc2V0KHNjYWxlLCBzY2FsZSwgc2NhbGUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TkZURGF0YS1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICBwbGFuZS5wb3NpdGlvbi55ID0gKChtc2cuaGVpZ2h0IC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgcGxhbmUucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICB9KTtcbiAgICAgICAgcm9vdC5hZGQocGxhbmUpO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwiZ2V0TWF0cml4R0xfUkgtXCIgKyB0aGlzLnV1aWQgKyBcIi1cIiArIG5hbWUsIChldjogYW55KSA9PiB7XG4gICAgICAgICAgICByb290LnZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgcGxhbmUudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBpZih0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsMCwwKSwgbmV3IFZlY3RvcjMoMCwwLDApLCBuZXcgVmVjdG9yMygwLDAsMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKSAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoKGZpbHRlclswXS54KSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKChmaWx0ZXJbMF0ueSkpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WigoZmlsdGVyWzBdLnopKTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKChmaWx0ZXJbMl0ueCkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WSgoZmlsdGVyWzJdLnkpKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFooKGZpbHRlclsyXS56KSk7IFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290Lm1hdHJpeEF1dG9VcGRhdGUgPSBmYWxzZTsgICAgICAgICBcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRyaXggPSBVdGlscy5pbnRlcnBvbGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgICAgIFV0aWxzLnNldE1hdHJpeChyb290Lm1hdHJpeCwgbWF0cml4KTsgXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIHBsYW5lLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFlvdSBjYW4gZ2V0IHRoZSBuYW1lcyBvZiB0aGUgZW50aXRpZXMgdXNlZCBpbiB5b3VyIHByb2plY3QuXG4gICAgICogQHJldHVybnMgdGhlIG5hb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gICAgY29uc3QgaW50ZXJwb2xhdGlvbkZhY3RvciA9IDI0O1xuXG4gICAgICAgIC8vIGludGVycG9sYXRlIG1hdHJpeFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDE2OyBpKyspIHtcbiAgICAgICAgICAgIHRoaXMudHJhY2tlZE1hdHJpeC5kZWx0YVtpXSA9IHdvcmxkW2ldIC0gdGhpcy50cmFja2VkTWF0cml4LmludGVycG9sYXRlZFtpXTtcbiAgICAgICAgICAgIHRoaXMudHJhY2tlZE1hdHJpeC5pbnRlcnBvbGF0ZWRbaV0gPVxuICAgICAgICAgICAgICAgIHRoaXMudHJhY2tlZE1hdHJpeC5pbnRlcnBvbGF0ZWRbaV0gKyB0aGlzLnRyYWNrZWRNYXRyaXguZGVsdGFbaV0gLyBpbnRlcnBvbGF0aW9uRmFjdG9yO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnRyYWNrZWRNYXRyaXguaW50ZXJwb2xhdGVkO1xuICAgIH1cblxuICAgIHN0YXRpYyBpc01vYmlsZSgpIHtcbiAgICAgICAgcmV0dXJuIC9BbmRyb2lkfG1vYmlsZXxpUGFkfGlQaG9uZS9pLnRlc3QobmF2aWdhdG9yLnVzZXJBZ2VudCk7XG4gICAgfVxuXG4gICAgc3RhdGljIHNldE1hdHJpeChtYXRyaXg6IGFueSwgdmFsdWU6IGFueSkge1xuICAgICAgICBjb25zdCBhcnJheTogYW55ID0gW107XG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIHZhbHVlKSB7XG4gICAgICAgICAgICBhcnJheVtrZXldID0gdmFsdWVba2V5XTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIG1hdHJpeC5lbGVtZW50cy5zZXQgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgbWF0cml4LmVsZW1lbnRzLnNldChhcnJheSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtYXRyaXguZWxlbWVudHMgPSB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vcmxkTWF0cml4KTtcbiAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMoX2N1cnJlbnRUcmFuc2xhdGlvbi5kaXN0YW5jZVRvKHRoaXMuX2xhc3RUcmFuc2xhdGlvbikpID4gdGhpcy5fZGVsdGFBY2N1cmFjeSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZURyb3BzICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZURyb3BzID4gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gX2N1cnJlbnRUcmFuc2xhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW3Bvcywgcm90YXRpb25WZWMsIHNjYWxlXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5fZnJhbWVEcm9wcyA9IDA7XG4gICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gX2N1cnJlbnRUcmFuc2xhdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX3Bvc2l0aW9uRmlsdGVyLlVwZGF0ZVBhcmFtcyhcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlckZyZXF1ZW5jeSxcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlck1pbkN1dG9mZixcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlckJldGEsXG4gICAgICAgICAgICAgICAgdGhpcy5maWx0ZXJEY3V0b2ZmXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgdGhpcy5fcm90YXRpb25GaWx0ZXIuVXBkYXRlUGFyYW1zKFxuICAgICAgICAgICAgICAgIHRoaXMuZmlsdGVyRnJlcXVlbmN5ICogMixcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlck1pbkN1dG9mZixcbiAgICAgICAgICAgICAgICB0aGlzL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peEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtZXNoLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgICAgICB0aGlzLmVudGl0aWVzLnB1c2goeyBuYW1lIH0pO1xuICA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9uLnggPSBNYXRoLlBJIC8gMjtcbiAgICAgICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRORlREYXRhLVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0gKChtc2cud2lkdGggLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJvb3QuYWRkKG1vZGVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsIDAsIDApLCBuZXcgVmVjdG9yMygwLCAwLCAwKSwgbmV3IFZlY3RvcjMoMCwgMCwgMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgYWRkTW9kZWxXaXRoQ2FsbGJhY2sgZnVuY3Rpb24gd2lsbCBhZGQgYSBtb2RlbCB0byB0aGUgUmVuZGVyZXIgcm9vdC4gWW91IG5lZWQgdG8gYXNzb2NpYXRlIGEgbmFtZSBvZi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XRpb24uc2V0WChmaWx0ZXJbMF0ueCk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKGZpbHRlclswXS55KTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooZmlsdGVyWzBdLnopO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoZmlsdGVyWzJdLngpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WShmaWx0ZXJbMl0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRaKGZpbHRlclsyXS56KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm9vdC5tYXRyaXhBdXRvVXBkYXRlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICBVdGlscy5zZXRNYXRyaXgocm9vdC5tYXRyaXgsIG1hdHJpeCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIHBsYW5lLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRWaWRlbyBmdW5jdGlvbiB3aWxsIGFkZCBhIHZpZGVvIHR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vcjMoMCwgMCwgMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbGFuZS52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfS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QgeyBTY2VuZVJlbmRlcmVyVEpTLCBORlRhZGRUSlMgfTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/src/filters/ARnftFilter.ts b/src/filters/ARnftFilter.ts index a03a406..a4a3b08 100644 --- a/src/filters/ARnftFilter.ts +++ b/src/filters/ARnftFilter.ts @@ -37,7 +37,7 @@ export class ARnftFilter { public update(world: any): Vector3[] { let pos: Vector3 = new Vector3(); let rotationVec: Vector3 = new Vector3(); - let scale: Vector3 = new Vector3(); + let scale: Vector3 = new Vector3(); if (!world) { this._hasFound = false; this._frameDrops = 0; @@ -46,12 +46,11 @@ export class ARnftFilter { let worldMatrix: Matrix4 = matrixW.fromArray(this.getArrayMatrix(world)); if (!this._hasFound) { this._hasFound = true; - let vecTrans: Vector3 = new Vector3() - this._lastTranslation = vecTrans.setFromMatrixPosition(worldMatrix) - } - else { - let vecTrans: Vector3 = new Vector3() - let _currentTranslation: Vector3 = vecTrans.setFromMatrixPosition(worldMatrix) + let vecTrans: Vector3 = new Vector3(); + this._lastTranslation = vecTrans.setFromMatrixPosition(worldMatrix); + } else { + let vecTrans: Vector3 = new Vector3(); + let _currentTranslation: Vector3 = vecTrans.setFromMatrixPosition(worldMatrix); if (Math.abs(_currentTranslation.distanceTo(this._lastTranslation)) > this._deltaAccuracy) { this._frameDrops += 1; if (this._frameDrops > 3) { @@ -62,24 +61,34 @@ export class ARnftFilter { this._frameDrops = 0; this._lastTranslation = _currentTranslation; } - this._positionFilter.UpdateParams(this.filterFrequency, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); - this._rotationFilter.UpdateParams(this.filterFrequency * 2, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); + this._positionFilter.UpdateParams( + this.filterFrequency, + this.filterMinCutoff, + this.filterBeta, + this.filterDcutoff + ); + this._rotationFilter.UpdateParams( + this.filterFrequency * 2, + this.filterMinCutoff, + this.filterBeta, + this.filterDcutoff + ); let matrix: Matrix4 = new Matrix4(); - + matrix = worldMatrix; - let rotation: Quaternion = new Quaternion() + let rotation: Quaternion = new Quaternion(); let eulerRot: Euler = new Euler(); let position: Vector3 = new Vector3(0, 0, 0); - // or even simple decompose the worldMatrix into position, quaternion and scale with decompose - worldMatrix.decompose(position, rotation, scale) - let eRot = eulerRot.setFromQuaternion(rotation) + // or even simple decompose the worldMatrix into position, quaternion and scale with decompose + worldMatrix.decompose(position, rotation, scale); + let eRot = eulerRot.setFromQuaternion(rotation); rotationVec = this._rotationFilter.Filter(eRot.toVector3()); - - pos = this._positionFilter.Filter(position) + + pos = this._positionFilter.Filter(position); } - return [pos, rotationVec, scale] + return [pos, rotationVec, scale]; } protected getArrayMatrix(value: any): any { var array: any = []; @@ -88,4 +97,4 @@ export class ARnftFilter { } return array; } -} \ No newline at end of file +} diff --git a/src/filters/DelayableSignalFilter.ts b/src/filters/DelayableSignalFilter.ts index 07989be..fdffa42 100644 --- a/src/filters/DelayableSignalFilter.ts +++ b/src/filters/DelayableSignalFilter.ts @@ -1,7 +1,6 @@ import { getTime } from "../utils/Utils"; export class DelayableSignalFilter { - private _inDelay: boolean; private _totalTime: number; private _prevTime: number; @@ -36,5 +35,4 @@ export class DelayableSignalFilter { return false; } - -} \ No newline at end of file +} diff --git a/src/filters/OneEuroFilter.ts b/src/filters/OneEuroFilter.ts index 91df8a3..388ebe9 100644 --- a/src/filters/OneEuroFilter.ts +++ b/src/filters/OneEuroFilter.ts @@ -95,7 +95,6 @@ export default class OneEuroFilter { } public Filter(x: number, timestamp: number | null = null): number { - this.prevValue = this.currValue; if (this.lasttime && timestamp) { this.freq = 1.0 / (timestamp - this.lasttime); @@ -105,12 +104,11 @@ export default class OneEuroFilter { const dx = !prevX ? 0.0 : (x - prevX) * this.freq; const edx = this.dx.filter(dx, timestamp!, this.alpha(this.dCutOff)); const cutOff = this.minCutOff + this.beta * Math.abs(edx); - return this.currValue = this.x.filter(x, timestamp!, this.alpha(cutOff)); + return (this.currValue = this.x.filter(x, timestamp!, this.alpha(cutOff))); } } export class OneEuroFilterVector3 { - // containst the type of T // the array of filters private oneEuroFilters: Array; @@ -134,7 +132,6 @@ export class OneEuroFilterVector3 { return this._mincutoff; } - // currValue contains the latest value which have been succesfully filtered // prevValue contains the previous filtered value @@ -143,8 +140,6 @@ export class OneEuroFilterVector3 { // initialization of our filter(s) constructor(_freq: number, _mincutoff: number = 1, _beta: number = 0, _dcutoff: number = 1) { - - this.currValue = new Vector3(); this.prevValue = new Vector3(); @@ -154,9 +149,9 @@ export class OneEuroFilterVector3 { this._dcutoff = _dcutoff; this.oneEuroFilters = []; - this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)) - this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)) - this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)) + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); + this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); } // updates the filter parameters @@ -170,7 +165,6 @@ export class OneEuroFilterVector3 { this.oneEuroFilters[i].UpdateParams(this._freq, this._mincutoff, this._beta, this._dcutoff); } - // filters the provided _value and returns the result. // Note: a timestamp can also be provided - will override filter frequency. public Filter(_value: Vector3, timestamp: number = -1.0): Vector3 { @@ -185,10 +179,10 @@ export class OneEuroFilterVector3 { this.oneEuroFilters.forEach((filters, idx) => { output[idx] = filters.Filter(input[idx], timestamp); - }) + }); let arr: Vector3 = new Vector3(); - return this.currValue = arr.fromArray(output); + return (this.currValue = arr.fromArray(output)); } -} \ No newline at end of file +} diff --git a/src/markermedia/NFTaddTJS.ts b/src/markermedia/NFTaddTJS.ts index b283306..7ff4214 100644 --- a/src/markermedia/NFTaddTJS.ts +++ b/src/markermedia/NFTaddTJS.ts @@ -1,7 +1,16 @@ -import { Object3D, PlaneGeometry, Scene, TextureLoader, VideoTexture, Mesh, MeshStandardMaterial, Vector3 } from "three"; +import { + Object3D, + PlaneGeometry, + Scene, + TextureLoader, + VideoTexture, + Mesh, + MeshStandardMaterial, + Vector3, +} from "three"; import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; import { Utils } from "../utils/Utils"; -import { ARnftFilter } from '../filters/ARnftFilter' +import { ARnftFilter } from "../filters/ARnftFilter"; import SceneRendererTJS from "../SceneRendererTJS"; /** @@ -78,20 +87,20 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; mesh.visible = true; - if(this._oef === true) { - let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - filter = this._filter.update(ev.detail.matrixGL_RH) - root.position.setX((filter[0].x)); - root.position.setY((filter[0].y)); - root.position.setZ((filter[0].z)); + if (this._oef === true) { + let filter = [new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0, 0, 0)]; + filter = this._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); root.rotation.setFromVector3(filter[1]); - root.scale.setX((filter[2].x)); - root.scale.setY((filter[2].y)); - root.scale.setZ((filter[2].z)); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); } else { - root.matrixAutoUpdate = false; + root.matrixAutoUpdate = false; const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + Utils.setMatrix(root.matrix, matrix); } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { @@ -130,20 +139,20 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; model.visible = true; - if(this._oef === true) { - let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - filter = this._filter.update(ev.detail.matrixGL_RH) - root.position.setX((filter[0].x)); - root.position.setY((filter[0].y)); - root.position.setZ((filter[0].z)); + if (this._oef === true) { + let filter = [new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0, 0, 0)]; + filter = this._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); root.rotation.setFromVector3(filter[1]); - root.scale.setX((filter[2].x)); - root.scale.setY((filter[2].y)); - root.scale.setZ((filter[2].z)); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); } else { - root.matrixAutoUpdate = false; + root.matrixAutoUpdate = false; const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + Utils.setMatrix(root.matrix, matrix); } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { @@ -161,7 +170,7 @@ export default class NFTaddTJS { * @param callback modify the model in the callback. * @param objVisibility set true or false if the mesh wll stay visible or not after tracking. */ - public addModelWithCallback(url: string, name: string, callback: (gltf: any) =>{} , objVisibility: boolean) { + public addModelWithCallback(url: string, name: string, callback: (gltf: any) => {}, objVisibility: boolean) { const root = new Object3D(); root.name = "root-" + name; this.scene.add(root); @@ -181,20 +190,20 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; model.visible = true; - if(this._oef === true) { - let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - filter = this._filter.update(ev.detail.matrixGL_RH) - root.position.setX((filter[0].x)); - root.position.setY((filter[0].y)); - root.position.setZ((filter[0].z)); + if (this._oef === true) { + let filter = [new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0, 0, 0)]; + filter = this._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); root.rotation.setFromVector3(filter[1]); - root.scale.setX((filter[2].x)); - root.scale.setY((filter[2].y)); - root.scale.setZ((filter[2].z)); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); } else { - root.matrixAutoUpdate = false; + root.matrixAutoUpdate = false; const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + Utils.setMatrix(root.matrix, matrix); } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { @@ -238,20 +247,20 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; plane.visible = true; - if(this._oef === true) { - let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - filter = this._filter.update(ev.detail.matrixGL_RH) - root.position.setX((filter[0].x)); - root.position.setY((filter[0].y)); - root.position.setZ((filter[0].z)); + if (this._oef === true) { + let filter = [new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0, 0, 0)]; + filter = this._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); root.rotation.setFromVector3(filter[1]); - root.scale.setX((filter[2].x)); - root.scale.setY((filter[2].y)); - root.scale.setZ((filter[2].z)); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); } else { - root.matrixAutoUpdate = false; + root.matrixAutoUpdate = false; const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + Utils.setMatrix(root.matrix, matrix); } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { @@ -289,20 +298,20 @@ export default class NFTaddTJS { this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, (ev: any) => { root.visible = true; plane.visible = true; - if(this._oef === true) { - let filter = [new Vector3(0,0,0), new Vector3(0,0,0), new Vector3(0,0,0)]; - filter = this._filter.update(ev.detail.matrixGL_RH) - root.position.setX((filter[0].x)); - root.position.setY((filter[0].y)); - root.position.setZ((filter[0].z)); + if (this._oef === true) { + let filter = [new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(0, 0, 0)]; + filter = this._filter.update(ev.detail.matrixGL_RH); + root.position.setX(filter[0].x); + root.position.setY(filter[0].y); + root.position.setZ(filter[0].z); root.rotation.setFromVector3(filter[1]); - root.scale.setX((filter[2].x)); - root.scale.setY((filter[2].y)); - root.scale.setZ((filter[2].z)); + root.scale.setX(filter[2].x); + root.scale.setY(filter[2].y); + root.scale.setZ(filter[2].z); } else { - root.matrixAutoUpdate = false; + root.matrixAutoUpdate = false; const matrix = Utils.interpolate(ev.detail.matrixGL_RH); - Utils.setMatrix(root.matrix, matrix); + Utils.setMatrix(root.matrix, matrix); } }); this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, (ev: any) => { @@ -320,14 +329,14 @@ export default class NFTaddTJS { return this.names; } - /** + /** * Enable or not the OneEuroFilter routine. */ public set oef(enable: boolean) { this._oef = enable; } - /** + /** * Check if OneEuroFilter is enabled or not. * @returns (boolean) true or false */ From e34cef9c7fbd544e98023364fe3e0f0f79c8b19d Mon Sep 17 00:00:00 2001 From: kalwalt Date: Wed, 17 Nov 2021 12:52:54 +0100 Subject: [PATCH 11/11] 0.4.5 version --- dist/ARnftThreejs.js | 5342 +-------------------------------------- package.json | 2 +- src/SceneRendererTJS.ts | 2 +- 3 files changed, 4 insertions(+), 5342 deletions(-) diff --git a/dist/ARnftThreejs.js b/dist/ARnftThreejs.js index 737c251..67d06fc 100644 --- a/dist/ARnftThreejs.js +++ b/dist/ARnftThreejs.js @@ -1,5340 +1,2 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("three")); - else if(typeof define === 'function' && define.amd) - define(["three"], factory); - else if(typeof exports === 'object') - exports["ARnftThreejs"] = factory(require("three")); - else - root["ARnftThreejs"] = factory(root["THREE"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_three__) { -return /******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/SceneRendererTJS.ts": -/*!*********************************!*\ - !*** ./src/SceneRendererTJS.ts ***! - \*********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ SceneRendererTJS) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); -/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three */ "three"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/Utils */ "./src/utils/Utils.ts"); - - - - - -var SceneRendererTJS = /*#__PURE__*/function () { - function SceneRendererTJS(configData, canvasDraw, uuid, cameraBool) { - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, SceneRendererTJS); - - this.configData = configData; - this.uuid = uuid; - this.target = window || __webpack_require__.g; - this.renderer = new three__WEBPACK_IMPORTED_MODULE_2__.WebGLRenderer({ - canvas: canvasDraw, - context: configData.renderer.context, - alpha: configData.renderer.alpha, - premultipliedAlpha: configData.renderer.premultipliedAlpha, - antialias: configData.renderer.antialias, - stencil: configData.renderer.stencil, - precision: configData.renderer.precision, - depth: configData.renderer.depth, - logarithmicDepthBuffer: configData.renderer.logarithmicDepthBuffer - }); - this.renderer.setPixelRatio(window.devicePixelRatio); - this.scene = new three__WEBPACK_IMPORTED_MODULE_2__.Scene(); - SceneRendererTJS.globalScene = this.scene; - - if (cameraBool === true) { - this.camera = new three__WEBPACK_IMPORTED_MODULE_2__.PerspectiveCamera(configData.camera.fov, configData.camera.ratio, configData.camera.near, configData.camera.far); - } else { - this.camera = new three__WEBPACK_IMPORTED_MODULE_2__.Camera(); - } - - this.version = "0.4.0"; - console.log("ARnftThreejs version: ", this.version); - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(SceneRendererTJS, [{ - key: "initRenderer", - value: function initRenderer() { - var _this = this; - - this.camera.matrixAutoUpdate = false; - this.target.addEventListener("getProjectionMatrix", function (ev) { - _utils_Utils__WEBPACK_IMPORTED_MODULE_3__.Utils.setMatrix(_this.camera.projectionMatrix, ev.detail.proj); - }); - this.scene.add(this.camera); - var light = new three__WEBPACK_IMPORTED_MODULE_2__.AmbientLight(0xffffff); - this.scene.add(light); - this.target.addEventListener("getWindowSize", function (_ev) { - _this.renderer.setSize(_ev.detail.sw, _ev.detail.sh); - }); - var setInitRendererEvent = new CustomEvent("onInitThreejsRendering", { - detail: { - renderer: this.renderer, - scene: this.scene, - camera: this.camera - } - }); - this.target.dispatchEvent(setInitRendererEvent); - } - }, { - key: "draw", - value: function draw() { - this.renderer.render(this.scene, this.camera); - } - }, { - key: "getRenderer", - value: function getRenderer() { - return this.renderer; - } - }, { - key: "getScene", - value: function getScene() { - return this.scene; - } - }, { - key: "getCamera", - value: function getCamera() { - return this.camera; - } - }, { - key: "setRenderer", - value: function setRenderer(renderer) { - this.renderer = renderer; - } - }, { - key: "setScene", - value: function setScene(scene) { - this.scene = scene; - } - }, { - key: "setCamera", - value: function setCamera(camera) { - this.camera = camera; - } - }], [{ - key: "getGlobalScene", - value: function getGlobalScene() { - return SceneRendererTJS.globalScene; - } - }]); - - return SceneRendererTJS; -}(); - - - -/***/ }), - -/***/ "./src/filters/ARnftFilter.ts": -/*!************************************!*\ - !*** ./src/filters/ARnftFilter.ts ***! - \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ARnftFilter": () => (/* binding */ ARnftFilter) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); -/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var _OneEuroFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OneEuroFilter */ "./src/filters/OneEuroFilter.ts"); -/* harmony import */ var _DelayableSignalFilter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DelayableSignalFilter */ "./src/filters/DelayableSignalFilter.ts"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ "three"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_4__); - - - - - -var ARnftFilter = /*#__PURE__*/function () { - function ARnftFilter() { - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, ARnftFilter); - - this._hasFound = false; - this._frameDrops = 0; - this._deltaAccuracy = 10; - this.filterFrequency = 30.0; - this.filterMinCutoff = 1.0; - this.filterBeta = 0.0; - this.filterDcutoff = 1.0; - this.delayEnterCheck = new _DelayableSignalFilter__WEBPACK_IMPORTED_MODULE_3__.DelayableSignalFilter(2); - this.delayExitCheck = new _DelayableSignalFilter__WEBPACK_IMPORTED_MODULE_3__.DelayableSignalFilter(0); - this._positionFilter = new _OneEuroFilter__WEBPACK_IMPORTED_MODULE_2__.OneEuroFilterVector3(this.filterFrequency); - this._rotationFilter = new _OneEuroFilter__WEBPACK_IMPORTED_MODULE_2__.OneEuroFilterVector3(this.filterFrequency * 2); - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(ARnftFilter, [{ - key: "update", - value: function update(world) { - var pos = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); - var rotationVec = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); - var scale = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); - - if (!world) { - this._hasFound = false; - this._frameDrops = 0; - } else { - var matrixW = new three__WEBPACK_IMPORTED_MODULE_4__.Matrix4(); - var worldMatrix = matrixW.fromArray(this.getArrayMatrix(world)); - - if (!this._hasFound) { - this._hasFound = true; - var vecTrans = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); - this._lastTranslation = vecTrans.setFromMatrixPosition(worldMatrix); - } else { - var _vecTrans = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(); - - var _currentTranslation = _vecTrans.setFromMatrixPosition(worldMatrix); - - if (Math.abs(_currentTranslation.distanceTo(this._lastTranslation)) > this._deltaAccuracy) { - this._frameDrops += 1; - - if (this._frameDrops > 3) { - this._lastTranslation = _currentTranslation; - } - - return [pos, rotationVec, scale]; - } - - this._frameDrops = 0; - this._lastTranslation = _currentTranslation; - } - - this._positionFilter.UpdateParams(this.filterFrequency, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); - - this._rotationFilter.UpdateParams(this.filterFrequency * 2, this.filterMinCutoff, this.filterBeta, this.filterDcutoff); - - var matrix = new three__WEBPACK_IMPORTED_MODULE_4__.Matrix4(); - matrix = worldMatrix; - var rotation = new three__WEBPACK_IMPORTED_MODULE_4__.Quaternion(); - var eulerRot = new three__WEBPACK_IMPORTED_MODULE_4__.Euler(); - var position = new three__WEBPACK_IMPORTED_MODULE_4__.Vector3(0, 0, 0); - worldMatrix.decompose(position, rotation, scale); - var eRot = eulerRot.setFromQuaternion(rotation); - rotationVec = this._rotationFilter.Filter(eRot.toVector3()); - pos = this._positionFilter.Filter(position); - } - - return [pos, rotationVec, scale]; - } - }, { - key: "getArrayMatrix", - value: function getArrayMatrix(value) { - var array = []; - - for (var key in value) { - array[key] = value[key]; - } - - return array; - } - }]); - - return ARnftFilter; -}(); - -/***/ }), - -/***/ "./src/filters/DelayableSignalFilter.ts": -/*!**********************************************!*\ - !*** ./src/filters/DelayableSignalFilter.ts ***! - \**********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "DelayableSignalFilter": () => (/* binding */ DelayableSignalFilter) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); -/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/Utils */ "./src/utils/Utils.ts"); - - - -var DelayableSignalFilter = /*#__PURE__*/function () { - function DelayableSignalFilter(timeOut) { - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, DelayableSignalFilter); - - this._timeOut = timeOut; - this._inDelay = false; - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(DelayableSignalFilter, [{ - key: "Update", - value: function Update(tick) { - var time = (0,_utils_Utils__WEBPACK_IMPORTED_MODULE_2__.getTime)(); - - if (!this._inDelay) { - this._prevTime = time; - this._totalTime = 0; - } - - this._totalTime += time - this._prevTime; - - if (this._inDelay && this._totalTime > this._timeOut) { - this._inDelay = false; - return true; - } - - if (tick) { - this._inDelay = true; - return false; - } - - this._inDelay = false; - return false; - } - }]); - - return DelayableSignalFilter; -}(); - -/***/ }), - -/***/ "./src/filters/OneEuroFilter.ts": -/*!**************************************!*\ - !*** ./src/filters/OneEuroFilter.ts ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ OneEuroFilter), -/* harmony export */ "OneEuroFilterVector3": () => (/* binding */ OneEuroFilterVector3) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); -/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three */ "three"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_2__); - - - - -var LowPassFilter = /*#__PURE__*/function () { - function LowPassFilter(alpha) { - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, LowPassFilter); - - this.alpha = 0; - this.setAlpha(alpha); - this.y = null; - this.s = null; - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(LowPassFilter, [{ - key: "setAlpha", - value: function setAlpha(alpha) { - if (alpha <= 0 || alpha > 1.0) { - throw new Error(); - } - - this.alpha = alpha; - } - }, { - key: "filter", - value: function filter(value, timestamp, alpha) { - if (alpha) { - this.setAlpha(alpha); - } - - var s; - - if (!this.y) { - s = value; - } else { - s = this.alpha * value + (1.0 - this.alpha) * this.s; - } - - this.y = value; - this.s = s; - return s; - } - }, { - key: "lastValue", - value: function lastValue() { - return this.y; - } - }]); - - return LowPassFilter; -}(); - -var OneEuroFilter = /*#__PURE__*/function () { - function OneEuroFilter(freq) { - var minCutOff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1.0; - var beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.0; - var dCutOff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1.0; - - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, OneEuroFilter); - - if (freq <= 0 || minCutOff <= 0 || dCutOff <= 0) { - throw new Error(); - } - - this.freq = freq; - this.minCutOff = minCutOff; - this.beta = beta; - this.dCutOff = dCutOff; - this.x = new LowPassFilter(this.alpha(this.minCutOff)); - this.dx = new LowPassFilter(this.alpha(this.dCutOff)); - this.lasttime = null; - this.currValue = 0.0; - this.prevValue = this.currValue; - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(OneEuroFilter, [{ - key: "alpha", - value: function alpha(cutOff) { - var te = 1.0 / this.freq; - var tau = 1.0 / (2 * Math.PI * cutOff); - return 1.0 / (1.0 + tau / te); - } - }, { - key: "UpdateParams", - value: function UpdateParams(_freq) { - var _mincutoff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1.0; - - var _beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - var _dcutoff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - - this.freq = _freq; - this.minCutOff = _mincutoff; - this.beta = _beta; - this.dCutOff = _dcutoff; - this.x.setAlpha(this.alpha(this.minCutOff)); - this.dx.setAlpha(this.alpha(this.dCutOff)); - } - }, { - key: "Filter", - value: function Filter(x) { - var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - this.prevValue = this.currValue; - - if (this.lasttime && timestamp) { - this.freq = 1.0 / (timestamp - this.lasttime); - } - - this.lasttime = timestamp; - var prevX = this.x.lastValue(); - var dx = !prevX ? 0.0 : (x - prevX) * this.freq; - var edx = this.dx.filter(dx, timestamp, this.alpha(this.dCutOff)); - var cutOff = this.minCutOff + this.beta * Math.abs(edx); - return this.currValue = this.x.filter(x, timestamp, this.alpha(cutOff)); - } - }]); - - return OneEuroFilter; -}(); - - -var OneEuroFilterVector3 = /*#__PURE__*/function () { - function OneEuroFilterVector3(_freq) { - var _mincutoff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - - var _beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - var _dcutoff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, OneEuroFilterVector3); - - this.currValue = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); - this.prevValue = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); - this._freq = _freq; - this._mincutoff = _mincutoff; - this._beta = _beta; - this._dcutoff = _dcutoff; - this.oneEuroFilters = []; - this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); - this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); - this.oneEuroFilters.push(new OneEuroFilter(_freq, _mincutoff, _beta, _dcutoff)); - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(OneEuroFilterVector3, [{ - key: "freq", - get: function get() { - return this._freq; - } - }, { - key: "beta", - get: function get() { - return this._beta; - } - }, { - key: "dcutoff", - get: function get() { - return this._dcutoff; - } - }, { - key: "mincutoff_1", - get: function get() { - return this._mincutoff; - } - }, { - key: "UpdateParams", - value: function UpdateParams(_freq) { - var _mincutoff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1.0; - - var _beta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - var _dcutoff = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - - this._freq = _freq; - this._mincutoff = _mincutoff; - this._beta = _beta; - this._dcutoff = _dcutoff; - - for (var i = 0; i < this.oneEuroFilters.length; i++) { - this.oneEuroFilters[i].UpdateParams(this._freq, this._mincutoff, this._beta, this._dcutoff); - } - } - }, { - key: "Filter", - value: function Filter(_value) { - var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1.0; - this.prevValue = this.currValue; - var out = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); - var output = out.toArray(); - - var input = _value.toArray(); - - this.oneEuroFilters.forEach(function (filters, idx) { - output[idx] = filters.Filter(input[idx], timestamp); - }); - var arr = new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(); - return this.currValue = arr.fromArray(output); - } - }]); - - return OneEuroFilterVector3; -}(); - -/***/ }), - -/***/ "./src/markermedia/NFTaddTJS.ts": -/*!**************************************!*\ - !*** ./src/markermedia/NFTaddTJS.ts ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ NFTaddTJS) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); -/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three */ "three"); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader */ "./node_modules/three/examples/jsm/loaders/GLTFLoader.js"); -/* harmony import */ var _utils_Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/Utils */ "./src/utils/Utils.ts"); -/* harmony import */ var _filters_ARnftFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../filters/ARnftFilter */ "./src/filters/ARnftFilter.ts"); -/* harmony import */ var _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../SceneRendererTJS */ "./src/SceneRendererTJS.ts"); - - - - - - - - -var NFTaddTJS = /*#__PURE__*/function () { - function NFTaddTJS(uuid) { - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, NFTaddTJS); - - this.entities = []; - this.scene = _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_6__["default"].getGlobalScene(); - this.target = window || __webpack_require__.g; - this.uuid = uuid; - this.names = []; - this._filter = new _filters_ARnftFilter__WEBPACK_IMPORTED_MODULE_5__.ARnftFilter(); - this._oef = false; - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(NFTaddTJS, [{ - key: "add", - value: function add(mesh, name, objVisibility) { - var _this = this; - - this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { - var msg = ev.detail; - mesh.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; - mesh.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; - }); - var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); - root.name = "root-" + name; - this.scene.add(root); - root.add(mesh); - this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { - root.visible = true; - mesh.visible = true; - - if (_this._oef === true) { - var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; - filter = _this._filter.update(ev.detail.matrixGL_RH); - root.position.setX(filter[0].x); - root.position.setY(filter[0].y); - root.position.setZ(filter[0].z); - root.rotation.setFromVector3(filter[1]); - root.scale.setX(filter[2].x); - root.scale.setY(filter[2].y); - root.scale.setZ(filter[2].z); - } else { - root.matrixAutoUpdate = false; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); - } - }); - this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { - root.visible = objVisibility; - mesh.visible = objVisibility; - }); - this.names.push(name); - this.entities.push({ - name: name - }); - } - }, { - key: "addModel", - value: function addModel(url, name, scale, objVisibility) { - var _this2 = this; - - var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); - root.name = "root-" + name; - this.scene.add(root); - var model; - var threeGLTFLoader = new three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__.GLTFLoader(); - threeGLTFLoader.load(url, function (gltf) { - model = gltf.scene; - model.scale.set(scale, scale, scale); - model.rotation.x = Math.PI / 2; - - _this2.target.addEventListener("getNFTData-" + _this2.uuid + "-" + name, function (ev) { - var msg = ev.detail; - model.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; - model.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; - }); - - root.add(model); - }); - this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { - root.visible = true; - model.visible = true; - - if (_this2._oef === true) { - var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; - filter = _this2._filter.update(ev.detail.matrixGL_RH); - root.position.setX(filter[0].x); - root.position.setY(filter[0].y); - root.position.setZ(filter[0].z); - root.rotation.setFromVector3(filter[1]); - root.scale.setX(filter[2].x); - root.scale.setY(filter[2].y); - root.scale.setZ(filter[2].z); - } else { - root.matrixAutoUpdate = false; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); - } - }); - this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { - root.visible = objVisibility; - model.visible = objVisibility; - }); - this.names.push(name); - } - }, { - key: "addModelWithCallback", - value: function addModelWithCallback(url, name, callback, objVisibility) { - var _this3 = this; - - var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); - root.name = "root-" + name; - this.scene.add(root); - var model; - var threeGLTFLoader = new three_examples_jsm_loaders_GLTFLoader__WEBPACK_IMPORTED_MODULE_3__.GLTFLoader(); - threeGLTFLoader.load(url, function (gltf) { - model = gltf.scene; - - _this3.target.addEventListener("getNFTData-" + _this3.uuid + "-" + name, function (ev) { - var msg = ev.detail; - model.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; - model.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; - }); - - callback(gltf); - root.add(model); - }); - this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { - root.visible = true; - model.visible = true; - - if (_this3._oef === true) { - var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; - filter = _this3._filter.update(ev.detail.matrixGL_RH); - root.position.setX(filter[0].x); - root.position.setY(filter[0].y); - root.position.setZ(filter[0].z); - root.rotation.setFromVector3(filter[1]); - root.scale.setX(filter[2].x); - root.scale.setY(filter[2].y); - root.scale.setZ(filter[2].z); - } else { - root.matrixAutoUpdate = false; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); - } - }); - this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { - root.visible = objVisibility; - model.visible = objVisibility; - }); - this.names.push(name); - } - }, { - key: "addImage", - value: function addImage(imageUrl, name, color, scale, configs, objVisibility) { - var _this4 = this; - - var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); - root.name = "root-" + name; - this.scene.add(root); - var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(configs.w, configs.h, configs.ws, configs.hs); - var texture = new three__WEBPACK_IMPORTED_MODULE_2__.TextureLoader().load(imageUrl); - var material = new three__WEBPACK_IMPORTED_MODULE_2__.MeshStandardMaterial({ - color: color, - map: texture - }); - var plane = new three__WEBPACK_IMPORTED_MODULE_2__.Mesh(planeGeom, material); - plane.scale.set(scale, scale, scale); - this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { - var msg = ev.detail; - plane.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; - plane.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; - }); - root.add(plane); - this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { - root.visible = true; - plane.visible = true; - - if (_this4._oef === true) { - var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; - filter = _this4._filter.update(ev.detail.matrixGL_RH); - root.position.setX(filter[0].x); - root.position.setY(filter[0].y); - root.position.setZ(filter[0].z); - root.rotation.setFromVector3(filter[1]); - root.scale.setX(filter[2].x); - root.scale.setY(filter[2].y); - root.scale.setZ(filter[2].z); - } else { - root.matrixAutoUpdate = false; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); - } - }); - this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { - root.visible = objVisibility; - plane.visible = objVisibility; - }); - this.names.push(name); - } - }, { - key: "addVideo", - value: function addVideo(id, name, scale, configs, objVisibility) { - var _this5 = this; - - var root = new three__WEBPACK_IMPORTED_MODULE_2__.Object3D(); - root.name = "root-" + name; - this.scene.add(root); - var ARVideo = document.getElementById(id); - var texture = new three__WEBPACK_IMPORTED_MODULE_2__.VideoTexture(ARVideo); - var mat = new three__WEBPACK_IMPORTED_MODULE_2__.MeshStandardMaterial({ - color: 0xbbbbff, - map: texture - }); - ARVideo.play(); - var planeGeom = new three__WEBPACK_IMPORTED_MODULE_2__.PlaneGeometry(configs.w, configs.h, configs.ws, configs.hs); - var plane = new three__WEBPACK_IMPORTED_MODULE_2__.Mesh(planeGeom, mat); - plane.scale.set(scale, scale, scale); - this.target.addEventListener("getNFTData-" + this.uuid + "-" + name, function (ev) { - var msg = ev.detail; - plane.position.y = msg.height / msg.dpi * 2.54 * 10 / 2.0; - plane.position.x = msg.width / msg.dpi * 2.54 * 10 / 2.0; - }); - root.add(plane); - this.target.addEventListener("getMatrixGL_RH-" + this.uuid + "-" + name, function (ev) { - root.visible = true; - plane.visible = true; - - if (_this5._oef === true) { - var filter = [new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0), new three__WEBPACK_IMPORTED_MODULE_2__.Vector3(0, 0, 0)]; - filter = _this5._filter.update(ev.detail.matrixGL_RH); - root.position.setX(filter[0].x); - root.position.setY(filter[0].y); - root.position.setZ(filter[0].z); - root.rotation.setFromVector3(filter[1]); - root.scale.setX(filter[2].x); - root.scale.setY(filter[2].y); - root.scale.setZ(filter[2].z); - } else { - root.matrixAutoUpdate = false; - var matrix = _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.interpolate(ev.detail.matrixGL_RH); - _utils_Utils__WEBPACK_IMPORTED_MODULE_4__.Utils.setMatrix(root.matrix, matrix); - } - }); - this.target.addEventListener("nftTrackingLost-" + this.uuid + "-" + name, function (ev) { - root.visible = objVisibility; - plane.visible = objVisibility; - }); - this.names.push(name); - } - }, { - key: "getNames", - value: function getNames() { - return this.names; - } - }, { - key: "oef", - get: function get() { - return this._oef; - }, - set: function set(enable) { - this._oef = enable; - } - }]); - - return NFTaddTJS; -}(); - - - -/***/ }), - -/***/ "./src/utils/Utils.ts": -/*!****************************!*\ - !*** ./src/utils/Utils.ts ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getTime": () => (/* binding */ getTime), -/* harmony export */ "Utils": () => (/* binding */ Utils) -/* harmony export */ }); -/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js"); -/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/esm/createClass.js"); - - -function getTime() { - return Math.floor(Date.now() / 1000); -} -var Utils = /*#__PURE__*/function () { - function Utils() { - (0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Utils); - } - - (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Utils, null, [{ - key: "interpolate", - value: function interpolate(world) { - var interpolationFactor = 24; - - for (var i = 0; i < 16; i++) { - this.trackedMatrix.delta[i] = world[i] - this.trackedMatrix.interpolated[i]; - this.trackedMatrix.interpolated[i] = this.trackedMatrix.interpolated[i] + this.trackedMatrix.delta[i] / interpolationFactor; - } - - return this.trackedMatrix.interpolated; - } - }, { - key: "isMobile", - value: function isMobile() { - return /Android|mobile|iPad|iPhone/i.test(navigator.userAgent); - } - }, { - key: "setMatrix", - value: function setMatrix(matrix, value) { - var array = []; - - for (var key in value) { - array[key] = value[key]; - } - - if (typeof matrix.elements.set === "function") { - matrix.elements.set(array); - } else { - matrix.elements = [].slice.call(array); - } - } - }]); - - return Utils; -}(); -Utils.trackedMatrix = { - delta: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - interpolated: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] -}; - -/***/ }), - -/***/ "three": -/*!**************************************************************************************!*\ - !*** external {"commonjs":"three","commonjs2":"three","amd":"three","root":"THREE"} ***! - \**************************************************************************************/ -/***/ ((module) => { - -module.exports = __WEBPACK_EXTERNAL_MODULE_three__; - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _classCallCheck) -/* harmony export */ }); -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ _createClass) -/* harmony export */ }); -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -/***/ }), - -/***/ "./node_modules/three/examples/jsm/loaders/GLTFLoader.js": -/*!***************************************************************!*\ - !*** ./node_modules/three/examples/jsm/loaders/GLTFLoader.js ***! - \***************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "GLTFLoader": () => (/* binding */ GLTFLoader) -/* harmony export */ }); -/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ "three"); - - -class GLTFLoader extends three__WEBPACK_IMPORTED_MODULE_0__.Loader { - - constructor( manager ) { - - super( manager ); - - this.dracoLoader = null; - this.ktx2Loader = null; - this.meshoptDecoder = null; - - this.pluginCallbacks = []; - - this.register( function ( parser ) { - - return new GLTFMaterialsClearcoatExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFTextureBasisUExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFTextureWebPExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFMaterialsSheenExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFMaterialsTransmissionExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFMaterialsVolumeExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFMaterialsIorExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFMaterialsSpecularExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFLightsExtension( parser ); - - } ); - - this.register( function ( parser ) { - - return new GLTFMeshoptCompression( parser ); - - } ); - - } - - load( url, onLoad, onProgress, onError ) { - - const scope = this; - - let resourcePath; - - if ( this.resourcePath !== '' ) { - - resourcePath = this.resourcePath; - - } else if ( this.path !== '' ) { - - resourcePath = this.path; - - } else { - - resourcePath = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.extractUrlBase( url ); - - } - - // Tells the LoadingManager to track an extra item, which resolves after - // the model is fully loaded. This means the count of items loaded will - // be incorrect, but ensures manager.onLoad() does not fire early. - this.manager.itemStart( url ); - - const _onError = function ( e ) { - - if ( onError ) { - - onError( e ); - - } else { - - console.error( e ); - - } - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - }; - - const loader = new three__WEBPACK_IMPORTED_MODULE_0__.FileLoader( this.manager ); - - loader.setPath( this.path ); - loader.setResponseType( 'arraybuffer' ); - loader.setRequestHeader( this.requestHeader ); - loader.setWithCredentials( this.withCredentials ); - - loader.load( url, function ( data ) { - - try { - - scope.parse( data, resourcePath, function ( gltf ) { - - onLoad( gltf ); - - scope.manager.itemEnd( url ); - - }, _onError ); - - } catch ( e ) { - - _onError( e ); - - } - - }, onProgress, _onError ); - - } - - setDRACOLoader( dracoLoader ) { - - this.dracoLoader = dracoLoader; - return this; - - } - - setDDSLoader() { - - throw new Error( - - 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' - - ); - - } - - setKTX2Loader( ktx2Loader ) { - - this.ktx2Loader = ktx2Loader; - return this; - - } - - setMeshoptDecoder( meshoptDecoder ) { - - this.meshoptDecoder = meshoptDecoder; - return this; - - } - - register( callback ) { - - if ( this.pluginCallbacks.indexOf( callback ) === - 1 ) { - - this.pluginCallbacks.push( callback ); - - } - - return this; - - } - - unregister( callback ) { - - if ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) { - - this.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 ); - - } - - return this; - - } - - parse( data, path, onLoad, onError ) { - - let content; - const extensions = {}; - const plugins = {}; - - if ( typeof data === 'string' ) { - - content = data; - - } else { - - const magic = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) ); - - if ( magic === BINARY_EXTENSION_HEADER_MAGIC ) { - - try { - - extensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data ); - - } catch ( error ) { - - if ( onError ) onError( error ); - return; - - } - - content = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content; - - } else { - - content = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( new Uint8Array( data ) ); - - } - - } - - const json = JSON.parse( content ); - - if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) { - - if ( onError ) onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) ); - return; - - } - - const parser = new GLTFParser( json, { - - path: path || this.resourcePath || '', - crossOrigin: this.crossOrigin, - requestHeader: this.requestHeader, - manager: this.manager, - ktx2Loader: this.ktx2Loader, - meshoptDecoder: this.meshoptDecoder - - } ); - - parser.fileLoader.setRequestHeader( this.requestHeader ); - - for ( let i = 0; i < this.pluginCallbacks.length; i ++ ) { - - const plugin = this.pluginCallbacks[ i ]( parser ); - plugins[ plugin.name ] = plugin; - - // Workaround to avoid determining as unknown extension - // in addUnknownExtensionsToUserData(). - // Remove this workaround if we move all the existing - // extension handlers to plugin system - extensions[ plugin.name ] = true; - - } - - if ( json.extensionsUsed ) { - - for ( let i = 0; i < json.extensionsUsed.length; ++ i ) { - - const extensionName = json.extensionsUsed[ i ]; - const extensionsRequired = json.extensionsRequired || []; - - switch ( extensionName ) { - - case EXTENSIONS.KHR_MATERIALS_UNLIT: - extensions[ extensionName ] = new GLTFMaterialsUnlitExtension(); - break; - - case EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: - extensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension(); - break; - - case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION: - extensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader ); - break; - - case EXTENSIONS.KHR_TEXTURE_TRANSFORM: - extensions[ extensionName ] = new GLTFTextureTransformExtension(); - break; - - case EXTENSIONS.KHR_MESH_QUANTIZATION: - extensions[ extensionName ] = new GLTFMeshQuantizationExtension(); - break; - - default: - - if ( extensionsRequired.indexOf( extensionName ) >= 0 && plugins[ extensionName ] === undefined ) { - - console.warn( 'THREE.GLTFLoader: Unknown extension "' + extensionName + '".' ); - - } - - } - - } - - } - - parser.setExtensions( extensions ); - parser.setPlugins( plugins ); - parser.parse( onLoad, onError ); - - } - -} - -/* GLTFREGISTRY */ - -function GLTFRegistry() { - - let objects = {}; - - return { - - get: function ( key ) { - - return objects[ key ]; - - }, - - add: function ( key, object ) { - - objects[ key ] = object; - - }, - - remove: function ( key ) { - - delete objects[ key ]; - - }, - - removeAll: function () { - - objects = {}; - - } - - }; - -} - -/*********************************/ -/********** EXTENSIONS ***********/ -/*********************************/ - -const EXTENSIONS = { - KHR_BINARY_GLTF: 'KHR_binary_glTF', - KHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression', - KHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual', - KHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat', - KHR_MATERIALS_IOR: 'KHR_materials_ior', - KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness', - KHR_MATERIALS_SHEEN: 'KHR_materials_sheen', - KHR_MATERIALS_SPECULAR: 'KHR_materials_specular', - KHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission', - KHR_MATERIALS_UNLIT: 'KHR_materials_unlit', - KHR_MATERIALS_VOLUME: 'KHR_materials_volume', - KHR_TEXTURE_BASISU: 'KHR_texture_basisu', - KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', - KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization', - EXT_TEXTURE_WEBP: 'EXT_texture_webp', - EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression' -}; - -/** - * Punctual Lights Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual - */ -class GLTFLightsExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL; - - // Object3D instance caches - this.cache = { refs: {}, uses: {} }; - - } - - _markDefs() { - - const parser = this.parser; - const nodeDefs = this.parser.json.nodes || []; - - for ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) { - - const nodeDef = nodeDefs[ nodeIndex ]; - - if ( nodeDef.extensions - && nodeDef.extensions[ this.name ] - && nodeDef.extensions[ this.name ].light !== undefined ) { - - parser._addNodeRef( this.cache, nodeDef.extensions[ this.name ].light ); - - } - - } - - } - - _loadLight( lightIndex ) { - - const parser = this.parser; - const cacheKey = 'light:' + lightIndex; - let dependency = parser.cache.get( cacheKey ); - - if ( dependency ) return dependency; - - const json = parser.json; - const extensions = ( json.extensions && json.extensions[ this.name ] ) || {}; - const lightDefs = extensions.lights || []; - const lightDef = lightDefs[ lightIndex ]; - let lightNode; - - const color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 0xffffff ); - - if ( lightDef.color !== undefined ) color.fromArray( lightDef.color ); - - const range = lightDef.range !== undefined ? lightDef.range : 0; - - switch ( lightDef.type ) { - - case 'directional': - lightNode = new three__WEBPACK_IMPORTED_MODULE_0__.DirectionalLight( color ); - lightNode.target.position.set( 0, 0, - 1 ); - lightNode.add( lightNode.target ); - break; - - case 'point': - lightNode = new three__WEBPACK_IMPORTED_MODULE_0__.PointLight( color ); - lightNode.distance = range; - break; - - case 'spot': - lightNode = new three__WEBPACK_IMPORTED_MODULE_0__.SpotLight( color ); - lightNode.distance = range; - // Handle spotlight properties. - lightDef.spot = lightDef.spot || {}; - lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0; - lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0; - lightNode.angle = lightDef.spot.outerConeAngle; - lightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle; - lightNode.target.position.set( 0, 0, - 1 ); - lightNode.add( lightNode.target ); - break; - - default: - throw new Error( 'THREE.GLTFLoader: Unexpected light type: ' + lightDef.type ); - - } - - // Some lights (e.g. spot) default to a position other than the origin. Reset the position - // here, because node-level parsing will only override position if explicitly specified. - lightNode.position.set( 0, 0, 0 ); - - lightNode.decay = 2; - - if ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity; - - lightNode.name = parser.createUniqueName( lightDef.name || ( 'light_' + lightIndex ) ); - - dependency = Promise.resolve( lightNode ); - - parser.cache.add( cacheKey, dependency ); - - return dependency; - - } - - createNodeAttachment( nodeIndex ) { - - const self = this; - const parser = this.parser; - const json = parser.json; - const nodeDef = json.nodes[ nodeIndex ]; - const lightDef = ( nodeDef.extensions && nodeDef.extensions[ this.name ] ) || {}; - const lightIndex = lightDef.light; - - if ( lightIndex === undefined ) return null; - - return this._loadLight( lightIndex ).then( function ( light ) { - - return parser._getNodeRef( self.cache, lightIndex, light ); - - } ); - - } - -} - -/** - * Unlit Materials Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit - */ -class GLTFMaterialsUnlitExtension { - - constructor() { - - this.name = EXTENSIONS.KHR_MATERIALS_UNLIT; - - } - - getMaterialType() { - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial; - - } - - extendParams( materialParams, materialDef, parser ) { - - const pending = []; - - materialParams.color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); - materialParams.opacity = 1.0; - - const metallicRoughness = materialDef.pbrMetallicRoughness; - - if ( metallicRoughness ) { - - if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { - - const array = metallicRoughness.baseColorFactor; - - materialParams.color.fromArray( array ); - materialParams.opacity = array[ 3 ]; - - } - - if ( metallicRoughness.baseColorTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) ); - - } - - } - - return Promise.all( pending ); - - } - -} - -/** - * Clearcoat Materials Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat - */ -class GLTFMaterialsClearcoatExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_CLEARCOAT; - - } - - getMaterialType( materialIndex ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; - - } - - extendMaterialParams( materialIndex, materialParams ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { - - return Promise.resolve(); - - } - - const pending = []; - - const extension = materialDef.extensions[ this.name ]; - - if ( extension.clearcoatFactor !== undefined ) { - - materialParams.clearcoat = extension.clearcoatFactor; - - } - - if ( extension.clearcoatTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) ); - - } - - if ( extension.clearcoatRoughnessFactor !== undefined ) { - - materialParams.clearcoatRoughness = extension.clearcoatRoughnessFactor; - - } - - if ( extension.clearcoatRoughnessTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) ); - - } - - if ( extension.clearcoatNormalTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) ); - - if ( extension.clearcoatNormalTexture.scale !== undefined ) { - - const scale = extension.clearcoatNormalTexture.scale; - - materialParams.clearcoatNormalScale = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2( scale, scale ); - - } - - } - - return Promise.all( pending ); - - } - -} - -/** - * Sheen Materials Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen - */ -class GLTFMaterialsSheenExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_SHEEN; - - } - - getMaterialType( materialIndex ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; - - } - - extendMaterialParams( materialIndex, materialParams ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { - - return Promise.resolve(); - - } - - const pending = []; - - materialParams.sheenColor = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 0, 0, 0 ); - materialParams.sheenRoughness = 0; - materialParams.sheen = 1; - - const extension = materialDef.extensions[ this.name ]; - - if ( extension.sheenColorFactor !== undefined ) { - - materialParams.sheenColor.fromArray( extension.sheenColorFactor ); - - } - - if ( extension.sheenRoughnessFactor !== undefined ) { - - materialParams.sheenRoughness = extension.sheenRoughnessFactor; - - } - - if ( extension.sheenColorTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'sheenColorMap', extension.sheenColorTexture ) ); - - } - - if ( extension.sheenRoughnessTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'sheenRoughnessMap', extension.sheenRoughnessTexture ) ); - - } - - return Promise.all( pending ); - - } - -} - -/** - * Transmission Materials Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission - * Draft: https://github.com/KhronosGroup/glTF/pull/1698 - */ -class GLTFMaterialsTransmissionExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_TRANSMISSION; - - } - - getMaterialType( materialIndex ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; - - } - - extendMaterialParams( materialIndex, materialParams ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { - - return Promise.resolve(); - - } - - const pending = []; - - const extension = materialDef.extensions[ this.name ]; - - if ( extension.transmissionFactor !== undefined ) { - - materialParams.transmission = extension.transmissionFactor; - - } - - if ( extension.transmissionTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) ); - - } - - return Promise.all( pending ); - - } - -} - -/** - * Materials Volume Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume - */ -class GLTFMaterialsVolumeExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_VOLUME; - - } - - getMaterialType( materialIndex ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; - - } - - extendMaterialParams( materialIndex, materialParams ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { - - return Promise.resolve(); - - } - - const pending = []; - - const extension = materialDef.extensions[ this.name ]; - - materialParams.thickness = extension.thicknessFactor !== undefined ? extension.thicknessFactor : 0; - - if ( extension.thicknessTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) ); - - } - - materialParams.attenuationDistance = extension.attenuationDistance || 0; - - const colorArray = extension.attenuationColor || [ 1, 1, 1 ]; - materialParams.attenuationColor = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); - - return Promise.all( pending ); - - } - -} - -/** - * Materials ior Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior - */ -class GLTFMaterialsIorExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_IOR; - - } - - getMaterialType( materialIndex ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; - - } - - extendMaterialParams( materialIndex, materialParams ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { - - return Promise.resolve(); - - } - - const extension = materialDef.extensions[ this.name ]; - - materialParams.ior = extension.ior !== undefined ? extension.ior : 1.5; - - return Promise.resolve(); - - } - -} - -/** - * Materials specular Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular - */ -class GLTFMaterialsSpecularExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_SPECULAR; - - } - - getMaterialType( materialIndex ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null; - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshPhysicalMaterial; - - } - - extendMaterialParams( materialIndex, materialParams ) { - - const parser = this.parser; - const materialDef = parser.json.materials[ materialIndex ]; - - if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) { - - return Promise.resolve(); - - } - - const pending = []; - - const extension = materialDef.extensions[ this.name ]; - - materialParams.specularIntensity = extension.specularFactor !== undefined ? extension.specularFactor : 1.0; - - if ( extension.specularTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) ); - - } - - const colorArray = extension.specularColorFactor || [ 1, 1, 1 ]; - materialParams.specularColor = new three__WEBPACK_IMPORTED_MODULE_0__.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] ); - - if ( extension.specularColorTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'specularColorMap', extension.specularColorTexture ).then( function ( texture ) { - - texture.encoding = three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding; - - } ) ); - - } - - return Promise.all( pending ); - - } - -} - -/** - * BasisU Texture Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu - */ -class GLTFTextureBasisUExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.KHR_TEXTURE_BASISU; - - } - - loadTexture( textureIndex ) { - - const parser = this.parser; - const json = parser.json; - - const textureDef = json.textures[ textureIndex ]; - - if ( ! textureDef.extensions || ! textureDef.extensions[ this.name ] ) { - - return null; - - } - - const extension = textureDef.extensions[ this.name ]; - const source = json.images[ extension.source ]; - const loader = parser.options.ktx2Loader; - - if ( ! loader ) { - - if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) { - - throw new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' ); - - } else { - - // Assumes that the extension is optional and that a fallback texture is present - return null; - - } - - } - - return parser.loadTextureImage( textureIndex, source, loader ); - - } - -} - -/** - * WebP Texture Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp - */ -class GLTFTextureWebPExtension { - - constructor( parser ) { - - this.parser = parser; - this.name = EXTENSIONS.EXT_TEXTURE_WEBP; - this.isSupported = null; - - } - - loadTexture( textureIndex ) { - - const name = this.name; - const parser = this.parser; - const json = parser.json; - - const textureDef = json.textures[ textureIndex ]; - - if ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) { - - return null; - - } - - const extension = textureDef.extensions[ name ]; - const source = json.images[ extension.source ]; - - let loader = parser.textureLoader; - if ( source.uri ) { - - const handler = parser.options.manager.getHandler( source.uri ); - if ( handler !== null ) loader = handler; - - } - - return this.detectSupport().then( function ( isSupported ) { - - if ( isSupported ) return parser.loadTextureImage( textureIndex, source, loader ); - - if ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) { - - throw new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' ); - - } - - // Fall back to PNG or JPEG. - return parser.loadTexture( textureIndex ); - - } ); - - } - - detectSupport() { - - if ( ! this.isSupported ) { - - this.isSupported = new Promise( function ( resolve ) { - - const image = new Image(); - - // Lossy test image. Support for lossy images doesn't guarantee support for all - // WebP images, unfortunately. - image.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'; - - image.onload = image.onerror = function () { - - resolve( image.height === 1 ); - - }; - - } ); - - } - - return this.isSupported; - - } - -} - -/** - * meshopt BufferView Compression Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression - */ -class GLTFMeshoptCompression { - - constructor( parser ) { - - this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION; - this.parser = parser; - - } - - loadBufferView( index ) { - - const json = this.parser.json; - const bufferView = json.bufferViews[ index ]; - - if ( bufferView.extensions && bufferView.extensions[ this.name ] ) { - - const extensionDef = bufferView.extensions[ this.name ]; - - const buffer = this.parser.getDependency( 'buffer', extensionDef.buffer ); - const decoder = this.parser.options.meshoptDecoder; - - if ( ! decoder || ! decoder.supported ) { - - if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) { - - throw new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' ); - - } else { - - // Assumes that the extension is optional and that fallback buffer data is present - return null; - - } - - } - - return Promise.all( [ buffer, decoder.ready ] ).then( function ( res ) { - - const byteOffset = extensionDef.byteOffset || 0; - const byteLength = extensionDef.byteLength || 0; - - const count = extensionDef.count; - const stride = extensionDef.byteStride; - - const result = new ArrayBuffer( count * stride ); - const source = new Uint8Array( res[ 0 ], byteOffset, byteLength ); - - decoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter ); - return result; - - } ); - - } else { - - return null; - - } - - } - -} - -/* BINARY EXTENSION */ -const BINARY_EXTENSION_HEADER_MAGIC = 'glTF'; -const BINARY_EXTENSION_HEADER_LENGTH = 12; -const BINARY_EXTENSION_CHUNK_TYPES = { JSON: 0x4E4F534A, BIN: 0x004E4942 }; - -class GLTFBinaryExtension { - - constructor( data ) { - - this.name = EXTENSIONS.KHR_BINARY_GLTF; - this.content = null; - this.body = null; - - const headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH ); - - this.header = { - magic: three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ), - version: headerView.getUint32( 4, true ), - length: headerView.getUint32( 8, true ) - }; - - if ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) { - - throw new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' ); - - } else if ( this.header.version < 2.0 ) { - - throw new Error( 'THREE.GLTFLoader: Legacy binary file detected.' ); - - } - - const chunkContentsLength = this.header.length - BINARY_EXTENSION_HEADER_LENGTH; - const chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH ); - let chunkIndex = 0; - - while ( chunkIndex < chunkContentsLength ) { - - const chunkLength = chunkView.getUint32( chunkIndex, true ); - chunkIndex += 4; - - const chunkType = chunkView.getUint32( chunkIndex, true ); - chunkIndex += 4; - - if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) { - - const contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength ); - this.content = three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.decodeText( contentArray ); - - } else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) { - - const byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex; - this.body = data.slice( byteOffset, byteOffset + chunkLength ); - - } - - // Clients must ignore chunks with unknown types. - - chunkIndex += chunkLength; - - } - - if ( this.content === null ) { - - throw new Error( 'THREE.GLTFLoader: JSON content not found.' ); - - } - - } - -} - -/** - * DRACO Mesh Compression Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression - */ -class GLTFDracoMeshCompressionExtension { - - constructor( json, dracoLoader ) { - - if ( ! dracoLoader ) { - - throw new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' ); - - } - - this.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION; - this.json = json; - this.dracoLoader = dracoLoader; - this.dracoLoader.preload(); - - } - - decodePrimitive( primitive, parser ) { - - const json = this.json; - const dracoLoader = this.dracoLoader; - const bufferViewIndex = primitive.extensions[ this.name ].bufferView; - const gltfAttributeMap = primitive.extensions[ this.name ].attributes; - const threeAttributeMap = {}; - const attributeNormalizedMap = {}; - const attributeTypeMap = {}; - - for ( const attributeName in gltfAttributeMap ) { - - const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); - - threeAttributeMap[ threeAttributeName ] = gltfAttributeMap[ attributeName ]; - - } - - for ( const attributeName in primitive.attributes ) { - - const threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase(); - - if ( gltfAttributeMap[ attributeName ] !== undefined ) { - - const accessorDef = json.accessors[ primitive.attributes[ attributeName ] ]; - const componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; - - attributeTypeMap[ threeAttributeName ] = componentType; - attributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true; - - } - - } - - return parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) { - - return new Promise( function ( resolve ) { - - dracoLoader.decodeDracoFile( bufferView, function ( geometry ) { - - for ( const attributeName in geometry.attributes ) { - - const attribute = geometry.attributes[ attributeName ]; - const normalized = attributeNormalizedMap[ attributeName ]; - - if ( normalized !== undefined ) attribute.normalized = normalized; - - } - - resolve( geometry ); - - }, threeAttributeMap, attributeTypeMap ); - - } ); - - } ); - - } - -} - -/** - * Texture Transform Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform - */ -class GLTFTextureTransformExtension { - - constructor() { - - this.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM; - - } - - extendTexture( texture, transform ) { - - if ( transform.texCoord !== undefined ) { - - console.warn( 'THREE.GLTFLoader: Custom UV sets in "' + this.name + '" extension not yet supported.' ); - - } - - if ( transform.offset === undefined && transform.rotation === undefined && transform.scale === undefined ) { - - // See https://github.com/mrdoob/three.js/issues/21819. - return texture; - - } - - texture = texture.clone(); - - if ( transform.offset !== undefined ) { - - texture.offset.fromArray( transform.offset ); - - } - - if ( transform.rotation !== undefined ) { - - texture.rotation = transform.rotation; - - } - - if ( transform.scale !== undefined ) { - - texture.repeat.fromArray( transform.scale ); - - } - - texture.needsUpdate = true; - - return texture; - - } - -} - -/** - * Specular-Glossiness Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness - */ - -/** - * A sub class of StandardMaterial with some of the functionality - * changed via the `onBeforeCompile` callback - * @pailhead - */ -class GLTFMeshStandardSGMaterial extends three__WEBPACK_IMPORTED_MODULE_0__.MeshStandardMaterial { - - constructor( params ) { - - super(); - - this.isGLTFSpecularGlossinessMaterial = true; - - //various chunks that need replacing - const specularMapParsFragmentChunk = [ - '#ifdef USE_SPECULARMAP', - ' uniform sampler2D specularMap;', - '#endif' - ].join( '\n' ); - - const glossinessMapParsFragmentChunk = [ - '#ifdef USE_GLOSSINESSMAP', - ' uniform sampler2D glossinessMap;', - '#endif' - ].join( '\n' ); - - const specularMapFragmentChunk = [ - 'vec3 specularFactor = specular;', - '#ifdef USE_SPECULARMAP', - ' vec4 texelSpecular = texture2D( specularMap, vUv );', - ' texelSpecular = sRGBToLinear( texelSpecular );', - ' // reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture', - ' specularFactor *= texelSpecular.rgb;', - '#endif' - ].join( '\n' ); - - const glossinessMapFragmentChunk = [ - 'float glossinessFactor = glossiness;', - '#ifdef USE_GLOSSINESSMAP', - ' vec4 texelGlossiness = texture2D( glossinessMap, vUv );', - ' // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture', - ' glossinessFactor *= texelGlossiness.a;', - '#endif' - ].join( '\n' ); - - const lightPhysicalFragmentChunk = [ - 'PhysicalMaterial material;', - 'material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );', - 'vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );', - 'float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );', - 'material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.', - 'material.roughness += geometryRoughness;', - 'material.roughness = min( material.roughness, 1.0 );', - 'material.specularColor = specularFactor;', - ].join( '\n' ); - - const uniforms = { - specular: { value: new three__WEBPACK_IMPORTED_MODULE_0__.Color().setHex( 0xffffff ) }, - glossiness: { value: 1 }, - specularMap: { value: null }, - glossinessMap: { value: null } - }; - - this._extraUniforms = uniforms; - - this.onBeforeCompile = function ( shader ) { - - for ( const uniformName in uniforms ) { - - shader.uniforms[ uniformName ] = uniforms[ uniformName ]; - - } - - shader.fragmentShader = shader.fragmentShader - .replace( 'uniform float roughness;', 'uniform vec3 specular;' ) - .replace( 'uniform float metalness;', 'uniform float glossiness;' ) - .replace( '#include ', specularMapParsFragmentChunk ) - .replace( '#include ', glossinessMapParsFragmentChunk ) - .replace( '#include ', specularMapFragmentChunk ) - .replace( '#include ', glossinessMapFragmentChunk ) - .replace( '#include ', lightPhysicalFragmentChunk ); - - }; - - Object.defineProperties( this, { - - specular: { - get: function () { - - return uniforms.specular.value; - - }, - set: function ( v ) { - - uniforms.specular.value = v; - - } - }, - - specularMap: { - get: function () { - - return uniforms.specularMap.value; - - }, - set: function ( v ) { - - uniforms.specularMap.value = v; - - if ( v ) { - - this.defines.USE_SPECULARMAP = ''; // USE_UV is set by the renderer for specular maps - - } else { - - delete this.defines.USE_SPECULARMAP; - - } - - } - }, - - glossiness: { - get: function () { - - return uniforms.glossiness.value; - - }, - set: function ( v ) { - - uniforms.glossiness.value = v; - - } - }, - - glossinessMap: { - get: function () { - - return uniforms.glossinessMap.value; - - }, - set: function ( v ) { - - uniforms.glossinessMap.value = v; - - if ( v ) { - - this.defines.USE_GLOSSINESSMAP = ''; - this.defines.USE_UV = ''; - - } else { - - delete this.defines.USE_GLOSSINESSMAP; - delete this.defines.USE_UV; - - } - - } - } - - } ); - - delete this.metalness; - delete this.roughness; - delete this.metalnessMap; - delete this.roughnessMap; - - this.setValues( params ); - - } - - copy( source ) { - - super.copy( source ); - - this.specularMap = source.specularMap; - this.specular.copy( source.specular ); - this.glossinessMap = source.glossinessMap; - this.glossiness = source.glossiness; - delete this.metalness; - delete this.roughness; - delete this.metalnessMap; - delete this.roughnessMap; - return this; - - } - -} - - -class GLTFMaterialsPbrSpecularGlossinessExtension { - - constructor() { - - this.name = EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS; - - this.specularGlossinessParams = [ - 'color', - 'map', - 'lightMap', - 'lightMapIntensity', - 'aoMap', - 'aoMapIntensity', - 'emissive', - 'emissiveIntensity', - 'emissiveMap', - 'bumpMap', - 'bumpScale', - 'normalMap', - 'normalMapType', - 'displacementMap', - 'displacementScale', - 'displacementBias', - 'specularMap', - 'specular', - 'glossinessMap', - 'glossiness', - 'alphaMap', - 'envMap', - 'envMapIntensity', - 'refractionRatio', - ]; - - } - - getMaterialType() { - - return GLTFMeshStandardSGMaterial; - - } - - extendParams( materialParams, materialDef, parser ) { - - const pbrSpecularGlossiness = materialDef.extensions[ this.name ]; - - materialParams.color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); - materialParams.opacity = 1.0; - - const pending = []; - - if ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) { - - const array = pbrSpecularGlossiness.diffuseFactor; - - materialParams.color.fromArray( array ); - materialParams.opacity = array[ 3 ]; - - } - - if ( pbrSpecularGlossiness.diffuseTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'map', pbrSpecularGlossiness.diffuseTexture ) ); - - } - - materialParams.emissive = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 0.0, 0.0, 0.0 ); - materialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0; - materialParams.specular = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); - - if ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) { - - materialParams.specular.fromArray( pbrSpecularGlossiness.specularFactor ); - - } - - if ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) { - - const specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture; - pending.push( parser.assignTexture( materialParams, 'glossinessMap', specGlossMapDef ) ); - pending.push( parser.assignTexture( materialParams, 'specularMap', specGlossMapDef ) ); - - } - - return Promise.all( pending ); - - } - - createMaterial( materialParams ) { - - const material = new GLTFMeshStandardSGMaterial( materialParams ); - material.fog = true; - - material.color = materialParams.color; - - material.map = materialParams.map === undefined ? null : materialParams.map; - - material.lightMap = null; - material.lightMapIntensity = 1.0; - - material.aoMap = materialParams.aoMap === undefined ? null : materialParams.aoMap; - material.aoMapIntensity = 1.0; - - material.emissive = materialParams.emissive; - material.emissiveIntensity = 1.0; - material.emissiveMap = materialParams.emissiveMap === undefined ? null : materialParams.emissiveMap; - - material.bumpMap = materialParams.bumpMap === undefined ? null : materialParams.bumpMap; - material.bumpScale = 1; - - material.normalMap = materialParams.normalMap === undefined ? null : materialParams.normalMap; - material.normalMapType = three__WEBPACK_IMPORTED_MODULE_0__.TangentSpaceNormalMap; - - if ( materialParams.normalScale ) material.normalScale = materialParams.normalScale; - - material.displacementMap = null; - material.displacementScale = 1; - material.displacementBias = 0; - - material.specularMap = materialParams.specularMap === undefined ? null : materialParams.specularMap; - material.specular = materialParams.specular; - - material.glossinessMap = materialParams.glossinessMap === undefined ? null : materialParams.glossinessMap; - material.glossiness = materialParams.glossiness; - - material.alphaMap = null; - - material.envMap = materialParams.envMap === undefined ? null : materialParams.envMap; - material.envMapIntensity = 1.0; - - material.refractionRatio = 0.98; - - return material; - - } - -} - -/** - * Mesh Quantization Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization - */ -class GLTFMeshQuantizationExtension { - - constructor() { - - this.name = EXTENSIONS.KHR_MESH_QUANTIZATION; - - } - -} - -/*********************************/ -/********** INTERPOLATION ********/ -/*********************************/ - -// Spline Interpolation -// Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation -class GLTFCubicSplineInterpolant extends three__WEBPACK_IMPORTED_MODULE_0__.Interpolant { - - constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - - super( parameterPositions, sampleValues, sampleSize, resultBuffer ); - - } - - copySampleValue_( index ) { - - // Copies a sample value to the result buffer. See description of glTF - // CUBICSPLINE values layout in interpolate_() function below. - - const result = this.resultBuffer, - values = this.sampleValues, - valueSize = this.valueSize, - offset = index * valueSize * 3 + valueSize; - - for ( let i = 0; i !== valueSize; i ++ ) { - - result[ i ] = values[ offset + i ]; - - } - - return result; - - } - -} - -GLTFCubicSplineInterpolant.prototype.beforeStart_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_; - -GLTFCubicSplineInterpolant.prototype.afterEnd_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_; - -GLTFCubicSplineInterpolant.prototype.interpolate_ = function ( i1, t0, t, t1 ) { - - const result = this.resultBuffer; - const values = this.sampleValues; - const stride = this.valueSize; - - const stride2 = stride * 2; - const stride3 = stride * 3; - - const td = t1 - t0; - - const p = ( t - t0 ) / td; - const pp = p * p; - const ppp = pp * p; - - const offset1 = i1 * stride3; - const offset0 = offset1 - stride3; - - const s2 = - 2 * ppp + 3 * pp; - const s3 = ppp - pp; - const s0 = 1 - s2; - const s1 = s3 - pp + p; - - // Layout of keyframe output values for CUBICSPLINE animations: - // [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ] - for ( let i = 0; i !== stride; i ++ ) { - - const p0 = values[ offset0 + i + stride ]; // splineVertex_k - const m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k) - const p1 = values[ offset1 + i + stride ]; // splineVertex_k+1 - const m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k) - - result[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1; - - } - - return result; - -}; - -const _q = new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion(); - -class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant { - - interpolate_( i1, t0, t, t1 ) { - - const result = super.interpolate_( i1, t0, t, t1 ); - - _q.fromArray( result ).normalize().toArray( result ); - - return result; - - } - -} - - -/*********************************/ -/********** INTERNALS ************/ -/*********************************/ - -/* CONSTANTS */ - -const WEBGL_CONSTANTS = { - FLOAT: 5126, - //FLOAT_MAT2: 35674, - FLOAT_MAT3: 35675, - FLOAT_MAT4: 35676, - FLOAT_VEC2: 35664, - FLOAT_VEC3: 35665, - FLOAT_VEC4: 35666, - LINEAR: 9729, - REPEAT: 10497, - SAMPLER_2D: 35678, - POINTS: 0, - LINES: 1, - LINE_LOOP: 2, - LINE_STRIP: 3, - TRIANGLES: 4, - TRIANGLE_STRIP: 5, - TRIANGLE_FAN: 6, - UNSIGNED_BYTE: 5121, - UNSIGNED_SHORT: 5123 -}; - -const WEBGL_COMPONENT_TYPES = { - 5120: Int8Array, - 5121: Uint8Array, - 5122: Int16Array, - 5123: Uint16Array, - 5125: Uint32Array, - 5126: Float32Array -}; - -const WEBGL_FILTERS = { - 9728: three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter, - 9729: three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter, - 9984: three__WEBPACK_IMPORTED_MODULE_0__.NearestMipmapNearestFilter, - 9985: three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapNearestFilter, - 9986: three__WEBPACK_IMPORTED_MODULE_0__.NearestMipmapLinearFilter, - 9987: three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapLinearFilter -}; - -const WEBGL_WRAPPINGS = { - 33071: three__WEBPACK_IMPORTED_MODULE_0__.ClampToEdgeWrapping, - 33648: three__WEBPACK_IMPORTED_MODULE_0__.MirroredRepeatWrapping, - 10497: three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping -}; - -const WEBGL_TYPE_SIZES = { - 'SCALAR': 1, - 'VEC2': 2, - 'VEC3': 3, - 'VEC4': 4, - 'MAT2': 4, - 'MAT3': 9, - 'MAT4': 16 -}; - -const ATTRIBUTES = { - POSITION: 'position', - NORMAL: 'normal', - TANGENT: 'tangent', - TEXCOORD_0: 'uv', - TEXCOORD_1: 'uv2', - COLOR_0: 'color', - WEIGHTS_0: 'skinWeight', - JOINTS_0: 'skinIndex', -}; - -const PATH_PROPERTIES = { - scale: 'scale', - translation: 'position', - rotation: 'quaternion', - weights: 'morphTargetInfluences' -}; - -const INTERPOLATION = { - CUBICSPLINE: undefined, // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each - // keyframe track will be initialized with a default interpolation type, then modified. - LINEAR: three__WEBPACK_IMPORTED_MODULE_0__.InterpolateLinear, - STEP: three__WEBPACK_IMPORTED_MODULE_0__.InterpolateDiscrete -}; - -const ALPHA_MODES = { - OPAQUE: 'OPAQUE', - MASK: 'MASK', - BLEND: 'BLEND' -}; - -/** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material - */ -function createDefaultMaterial( cache ) { - - if ( cache[ 'DefaultMaterial' ] === undefined ) { - - cache[ 'DefaultMaterial' ] = new three__WEBPACK_IMPORTED_MODULE_0__.MeshStandardMaterial( { - color: 0xFFFFFF, - emissive: 0x000000, - metalness: 1, - roughness: 1, - transparent: false, - depthTest: true, - side: three__WEBPACK_IMPORTED_MODULE_0__.FrontSide - } ); - - } - - return cache[ 'DefaultMaterial' ]; - -} - -function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) { - - // Add unknown glTF extensions to an object's userData. - - for ( const name in objectDef.extensions ) { - - if ( knownExtensions[ name ] === undefined ) { - - object.userData.gltfExtensions = object.userData.gltfExtensions || {}; - object.userData.gltfExtensions[ name ] = objectDef.extensions[ name ]; - - } - - } - -} - -/** - * @param {Object3D|Material|BufferGeometry} object - * @param {GLTF.definition} gltfDef - */ -function assignExtrasToUserData( object, gltfDef ) { - - if ( gltfDef.extras !== undefined ) { - - if ( typeof gltfDef.extras === 'object' ) { - - Object.assign( object.userData, gltfDef.extras ); - - } else { - - console.warn( 'THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras ); - - } - - } - -} - -/** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets - * - * @param {BufferGeometry} geometry - * @param {Array} targets - * @param {GLTFParser} parser - * @return {Promise} - */ -function addMorphTargets( geometry, targets, parser ) { - - let hasMorphPosition = false; - let hasMorphNormal = false; - - for ( let i = 0, il = targets.length; i < il; i ++ ) { - - const target = targets[ i ]; - - if ( target.POSITION !== undefined ) hasMorphPosition = true; - if ( target.NORMAL !== undefined ) hasMorphNormal = true; - - if ( hasMorphPosition && hasMorphNormal ) break; - - } - - if ( ! hasMorphPosition && ! hasMorphNormal ) return Promise.resolve( geometry ); - - const pendingPositionAccessors = []; - const pendingNormalAccessors = []; - - for ( let i = 0, il = targets.length; i < il; i ++ ) { - - const target = targets[ i ]; - - if ( hasMorphPosition ) { - - const pendingAccessor = target.POSITION !== undefined - ? parser.getDependency( 'accessor', target.POSITION ) - : geometry.attributes.position; - - pendingPositionAccessors.push( pendingAccessor ); - - } - - if ( hasMorphNormal ) { - - const pendingAccessor = target.NORMAL !== undefined - ? parser.getDependency( 'accessor', target.NORMAL ) - : geometry.attributes.normal; - - pendingNormalAccessors.push( pendingAccessor ); - - } - - } - - return Promise.all( [ - Promise.all( pendingPositionAccessors ), - Promise.all( pendingNormalAccessors ) - ] ).then( function ( accessors ) { - - const morphPositions = accessors[ 0 ]; - const morphNormals = accessors[ 1 ]; - - if ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions; - if ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals; - geometry.morphTargetsRelative = true; - - return geometry; - - } ); - -} - -/** - * @param {Mesh} mesh - * @param {GLTF.Mesh} meshDef - */ -function updateMorphTargets( mesh, meshDef ) { - - mesh.updateMorphTargets(); - - if ( meshDef.weights !== undefined ) { - - for ( let i = 0, il = meshDef.weights.length; i < il; i ++ ) { - - mesh.morphTargetInfluences[ i ] = meshDef.weights[ i ]; - - } - - } - - // .extras has user-defined data, so check that .extras.targetNames is an array. - if ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) { - - const targetNames = meshDef.extras.targetNames; - - if ( mesh.morphTargetInfluences.length === targetNames.length ) { - - mesh.morphTargetDictionary = {}; - - for ( let i = 0, il = targetNames.length; i < il; i ++ ) { - - mesh.morphTargetDictionary[ targetNames[ i ] ] = i; - - } - - } else { - - console.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' ); - - } - - } - -} - -function createPrimitiveKey( primitiveDef ) { - - const dracoExtension = primitiveDef.extensions && primitiveDef.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ]; - let geometryKey; - - if ( dracoExtension ) { - - geometryKey = 'draco:' + dracoExtension.bufferView - + ':' + dracoExtension.indices - + ':' + createAttributesKey( dracoExtension.attributes ); - - } else { - - geometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + ':' + primitiveDef.mode; - - } - - return geometryKey; - -} - -function createAttributesKey( attributes ) { - - let attributesKey = ''; - - const keys = Object.keys( attributes ).sort(); - - for ( let i = 0, il = keys.length; i < il; i ++ ) { - - attributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';'; - - } - - return attributesKey; - -} - -function getNormalizedComponentScale( constructor ) { - - // Reference: - // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data - - switch ( constructor ) { - - case Int8Array: - return 1 / 127; - - case Uint8Array: - return 1 / 255; - - case Int16Array: - return 1 / 32767; - - case Uint16Array: - return 1 / 65535; - - default: - throw new Error( 'THREE.GLTFLoader: Unsupported normalized accessor component type.' ); - - } - -} - -/* GLTF PARSER */ - -class GLTFParser { - - constructor( json = {}, options = {} ) { - - this.json = json; - this.extensions = {}; - this.plugins = {}; - this.options = options; - - // loader object cache - this.cache = new GLTFRegistry(); - - // associations between Three.js objects and glTF elements - this.associations = new Map(); - - // BufferGeometry caching - this.primitiveCache = {}; - - // Object3D instance caches - this.meshCache = { refs: {}, uses: {} }; - this.cameraCache = { refs: {}, uses: {} }; - this.lightCache = { refs: {}, uses: {} }; - - this.textureCache = {}; - - // Track node names, to ensure no duplicates - this.nodeNamesUsed = {}; - - // Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the - // expensive work of uploading a texture to the GPU off the main thread. - if ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) { - - this.textureLoader = new three__WEBPACK_IMPORTED_MODULE_0__.ImageBitmapLoader( this.options.manager ); - - } else { - - this.textureLoader = new three__WEBPACK_IMPORTED_MODULE_0__.TextureLoader( this.options.manager ); - - } - - this.textureLoader.setCrossOrigin( this.options.crossOrigin ); - this.textureLoader.setRequestHeader( this.options.requestHeader ); - - this.fileLoader = new three__WEBPACK_IMPORTED_MODULE_0__.FileLoader( this.options.manager ); - this.fileLoader.setResponseType( 'arraybuffer' ); - - if ( this.options.crossOrigin === 'use-credentials' ) { - - this.fileLoader.setWithCredentials( true ); - - } - - } - - setExtensions( extensions ) { - - this.extensions = extensions; - - } - - setPlugins( plugins ) { - - this.plugins = plugins; - - } - - parse( onLoad, onError ) { - - const parser = this; - const json = this.json; - const extensions = this.extensions; - - // Clear the loader cache - this.cache.removeAll(); - - // Mark the special nodes/meshes in json for efficient parse - this._invokeAll( function ( ext ) { - - return ext._markDefs && ext._markDefs(); - - } ); - - Promise.all( this._invokeAll( function ( ext ) { - - return ext.beforeRoot && ext.beforeRoot(); - - } ) ).then( function () { - - return Promise.all( [ - - parser.getDependencies( 'scene' ), - parser.getDependencies( 'animation' ), - parser.getDependencies( 'camera' ), - - ] ); - - } ).then( function ( dependencies ) { - - const result = { - scene: dependencies[ 0 ][ json.scene || 0 ], - scenes: dependencies[ 0 ], - animations: dependencies[ 1 ], - cameras: dependencies[ 2 ], - asset: json.asset, - parser: parser, - userData: {} - }; - - addUnknownExtensionsToUserData( extensions, result, json ); - - assignExtrasToUserData( result, json ); - - Promise.all( parser._invokeAll( function ( ext ) { - - return ext.afterRoot && ext.afterRoot( result ); - - } ) ).then( function () { - - onLoad( result ); - - } ); - - } ).catch( onError ); - - } - - /** - * Marks the special nodes/meshes in json for efficient parse. - */ - _markDefs() { - - const nodeDefs = this.json.nodes || []; - const skinDefs = this.json.skins || []; - const meshDefs = this.json.meshes || []; - - // Nothing in the node definition indicates whether it is a Bone or an - // Object3D. Use the skins' joint references to mark bones. - for ( let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) { - - const joints = skinDefs[ skinIndex ].joints; - - for ( let i = 0, il = joints.length; i < il; i ++ ) { - - nodeDefs[ joints[ i ] ].isBone = true; - - } - - } - - // Iterate over all nodes, marking references to shared resources, - // as well as skeleton joints. - for ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) { - - const nodeDef = nodeDefs[ nodeIndex ]; - - if ( nodeDef.mesh !== undefined ) { - - this._addNodeRef( this.meshCache, nodeDef.mesh ); - - // Nothing in the mesh definition indicates whether it is - // a SkinnedMesh or Mesh. Use the node's mesh reference - // to mark SkinnedMesh if node has skin. - if ( nodeDef.skin !== undefined ) { - - meshDefs[ nodeDef.mesh ].isSkinnedMesh = true; - - } - - } - - if ( nodeDef.camera !== undefined ) { - - this._addNodeRef( this.cameraCache, nodeDef.camera ); - - } - - } - - } - - /** - * Counts references to shared node / Object3D resources. These resources - * can be reused, or "instantiated", at multiple nodes in the scene - * hierarchy. Mesh, Camera, and Light instances are instantiated and must - * be marked. Non-scenegraph resources (like Materials, Geometries, and - * Textures) can be reused directly and are not marked here. - * - * Example: CesiumMilkTruck sample model reuses "Wheel" meshes. - */ - _addNodeRef( cache, index ) { - - if ( index === undefined ) return; - - if ( cache.refs[ index ] === undefined ) { - - cache.refs[ index ] = cache.uses[ index ] = 0; - - } - - cache.refs[ index ] ++; - - } - - /** Returns a reference to a shared resource, cloning it if necessary. */ - _getNodeRef( cache, index, object ) { - - if ( cache.refs[ index ] <= 1 ) return object; - - const ref = object.clone(); - - // Propagates mappings to the cloned object, prevents mappings on the - // original object from being lost. - const updateMappings = ( original, clone ) => { - - const mappings = this.associations.get( original ); - if ( mappings != null ) { - - this.associations.set( clone, mappings ); - - } - - for ( const [ i, child ] of original.children.entries() ) { - - updateMappings( child, clone.children[ i ] ); - - } - - }; - - updateMappings( object, ref ); - - ref.name += '_instance_' + ( cache.uses[ index ] ++ ); - - return ref; - - } - - _invokeOne( func ) { - - const extensions = Object.values( this.plugins ); - extensions.push( this ); - - for ( let i = 0; i < extensions.length; i ++ ) { - - const result = func( extensions[ i ] ); - - if ( result ) return result; - - } - - return null; - - } - - _invokeAll( func ) { - - const extensions = Object.values( this.plugins ); - extensions.unshift( this ); - - const pending = []; - - for ( let i = 0; i < extensions.length; i ++ ) { - - const result = func( extensions[ i ] ); - - if ( result ) pending.push( result ); - - } - - return pending; - - } - - /** - * Requests the specified dependency asynchronously, with caching. - * @param {string} type - * @param {number} index - * @return {Promise} - */ - getDependency( type, index ) { - - const cacheKey = type + ':' + index; - let dependency = this.cache.get( cacheKey ); - - if ( ! dependency ) { - - switch ( type ) { - - case 'scene': - dependency = this.loadScene( index ); - break; - - case 'node': - dependency = this.loadNode( index ); - break; - - case 'mesh': - dependency = this._invokeOne( function ( ext ) { - - return ext.loadMesh && ext.loadMesh( index ); - - } ); - break; - - case 'accessor': - dependency = this.loadAccessor( index ); - break; - - case 'bufferView': - dependency = this._invokeOne( function ( ext ) { - - return ext.loadBufferView && ext.loadBufferView( index ); - - } ); - break; - - case 'buffer': - dependency = this.loadBuffer( index ); - break; - - case 'material': - dependency = this._invokeOne( function ( ext ) { - - return ext.loadMaterial && ext.loadMaterial( index ); - - } ); - break; - - case 'texture': - dependency = this._invokeOne( function ( ext ) { - - return ext.loadTexture && ext.loadTexture( index ); - - } ); - break; - - case 'skin': - dependency = this.loadSkin( index ); - break; - - case 'animation': - dependency = this.loadAnimation( index ); - break; - - case 'camera': - dependency = this.loadCamera( index ); - break; - - default: - throw new Error( 'Unknown type: ' + type ); - - } - - this.cache.add( cacheKey, dependency ); - - } - - return dependency; - - } - - /** - * Requests all dependencies of the specified type asynchronously, with caching. - * @param {string} type - * @return {Promise>} - */ - getDependencies( type ) { - - let dependencies = this.cache.get( type ); - - if ( ! dependencies ) { - - const parser = this; - const defs = this.json[ type + ( type === 'mesh' ? 'es' : 's' ) ] || []; - - dependencies = Promise.all( defs.map( function ( def, index ) { - - return parser.getDependency( type, index ); - - } ) ); - - this.cache.add( type, dependencies ); - - } - - return dependencies; - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views - * @param {number} bufferIndex - * @return {Promise} - */ - loadBuffer( bufferIndex ) { - - const bufferDef = this.json.buffers[ bufferIndex ]; - const loader = this.fileLoader; - - if ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) { - - throw new Error( 'THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.' ); - - } - - // If present, GLB container is required to be the first buffer. - if ( bufferDef.uri === undefined && bufferIndex === 0 ) { - - return Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body ); - - } - - const options = this.options; - - return new Promise( function ( resolve, reject ) { - - loader.load( three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () { - - reject( new Error( 'THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".' ) ); - - } ); - - } ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views - * @param {number} bufferViewIndex - * @return {Promise} - */ - loadBufferView( bufferViewIndex ) { - - const bufferViewDef = this.json.bufferViews[ bufferViewIndex ]; - - return this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) { - - const byteLength = bufferViewDef.byteLength || 0; - const byteOffset = bufferViewDef.byteOffset || 0; - return buffer.slice( byteOffset, byteOffset + byteLength ); - - } ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors - * @param {number} accessorIndex - * @return {Promise} - */ - loadAccessor( accessorIndex ) { - - const parser = this; - const json = this.json; - - const accessorDef = this.json.accessors[ accessorIndex ]; - - if ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) { - - // Ignore empty accessors, which may be used to declare runtime - // information about attributes coming from another source (e.g. Draco - // compression extension). - return Promise.resolve( null ); - - } - - const pendingBufferViews = []; - - if ( accessorDef.bufferView !== undefined ) { - - pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.bufferView ) ); - - } else { - - pendingBufferViews.push( null ); - - } - - if ( accessorDef.sparse !== undefined ) { - - pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.indices.bufferView ) ); - pendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.values.bufferView ) ); - - } - - return Promise.all( pendingBufferViews ).then( function ( bufferViews ) { - - const bufferView = bufferViews[ 0 ]; - - const itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ]; - const TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; - - // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12. - const elementBytes = TypedArray.BYTES_PER_ELEMENT; - const itemBytes = elementBytes * itemSize; - const byteOffset = accessorDef.byteOffset || 0; - const byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[ accessorDef.bufferView ].byteStride : undefined; - const normalized = accessorDef.normalized === true; - let array, bufferAttribute; - - // The buffer is not interleaved if the stride is the item size in bytes. - if ( byteStride && byteStride !== itemBytes ) { - - // Each "slice" of the buffer, as defined by 'count' elements of 'byteStride' bytes, gets its own InterleavedBuffer - // This makes sure that IBA.count reflects accessor.count properly - const ibSlice = Math.floor( byteOffset / byteStride ); - const ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType + ':' + ibSlice + ':' + accessorDef.count; - let ib = parser.cache.get( ibCacheKey ); - - if ( ! ib ) { - - array = new TypedArray( bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes ); - - // Integer parameters to IB/IBA are in array elements, not bytes. - ib = new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBuffer( array, byteStride / elementBytes ); - - parser.cache.add( ibCacheKey, ib ); - - } - - bufferAttribute = new three__WEBPACK_IMPORTED_MODULE_0__.InterleavedBufferAttribute( ib, itemSize, ( byteOffset % byteStride ) / elementBytes, normalized ); - - } else { - - if ( bufferView === null ) { - - array = new TypedArray( accessorDef.count * itemSize ); - - } else { - - array = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize ); - - } - - bufferAttribute = new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute( array, itemSize, normalized ); - - } - - // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#sparse-accessors - if ( accessorDef.sparse !== undefined ) { - - const itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR; - const TypedArrayIndices = WEBGL_COMPONENT_TYPES[ accessorDef.sparse.indices.componentType ]; - - const byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0; - const byteOffsetValues = accessorDef.sparse.values.byteOffset || 0; - - const sparseIndices = new TypedArrayIndices( bufferViews[ 1 ], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices ); - const sparseValues = new TypedArray( bufferViews[ 2 ], byteOffsetValues, accessorDef.sparse.count * itemSize ); - - if ( bufferView !== null ) { - - // Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes. - bufferAttribute = new three__WEBPACK_IMPORTED_MODULE_0__.BufferAttribute( bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized ); - - } - - for ( let i = 0, il = sparseIndices.length; i < il; i ++ ) { - - const index = sparseIndices[ i ]; - - bufferAttribute.setX( index, sparseValues[ i * itemSize ] ); - if ( itemSize >= 2 ) bufferAttribute.setY( index, sparseValues[ i * itemSize + 1 ] ); - if ( itemSize >= 3 ) bufferAttribute.setZ( index, sparseValues[ i * itemSize + 2 ] ); - if ( itemSize >= 4 ) bufferAttribute.setW( index, sparseValues[ i * itemSize + 3 ] ); - if ( itemSize >= 5 ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.' ); - - } - - } - - return bufferAttribute; - - } ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures - * @param {number} textureIndex - * @return {Promise} - */ - loadTexture( textureIndex ) { - - const json = this.json; - const options = this.options; - const textureDef = json.textures[ textureIndex ]; - const source = json.images[ textureDef.source ]; - - let loader = this.textureLoader; - - if ( source.uri ) { - - const handler = options.manager.getHandler( source.uri ); - if ( handler !== null ) loader = handler; - - } - - return this.loadTextureImage( textureIndex, source, loader ); - - } - - loadTextureImage( textureIndex, source, loader ) { - - const parser = this; - const json = this.json; - const options = this.options; - - const textureDef = json.textures[ textureIndex ]; - - const cacheKey = ( source.uri || source.bufferView ) + ':' + textureDef.sampler; - - if ( this.textureCache[ cacheKey ] ) { - - // See https://github.com/mrdoob/three.js/issues/21559. - return this.textureCache[ cacheKey ]; - - } - - const URL = self.URL || self.webkitURL; - - let sourceURI = source.uri || ''; - let isObjectURL = false; - - if ( source.bufferView !== undefined ) { - - // Load binary image data from bufferView, if provided. - - sourceURI = parser.getDependency( 'bufferView', source.bufferView ).then( function ( bufferView ) { - - isObjectURL = true; - const blob = new Blob( [ bufferView ], { type: source.mimeType } ); - sourceURI = URL.createObjectURL( blob ); - return sourceURI; - - } ); - - } else if ( source.uri === undefined ) { - - throw new Error( 'THREE.GLTFLoader: Image ' + textureIndex + ' is missing URI and bufferView' ); - - } - - const promise = Promise.resolve( sourceURI ).then( function ( sourceURI ) { - - return new Promise( function ( resolve, reject ) { - - let onLoad = resolve; - - if ( loader.isImageBitmapLoader === true ) { - - onLoad = function ( imageBitmap ) { - - const texture = new three__WEBPACK_IMPORTED_MODULE_0__.Texture( imageBitmap ); - texture.needsUpdate = true; - - resolve( texture ); - - }; - - } - - loader.load( three__WEBPACK_IMPORTED_MODULE_0__.LoaderUtils.resolveURL( sourceURI, options.path ), onLoad, undefined, reject ); - - } ); - - } ).then( function ( texture ) { - - // Clean up resources and configure Texture. - - if ( isObjectURL === true ) { - - URL.revokeObjectURL( sourceURI ); - - } - - texture.flipY = false; - - if ( textureDef.name ) texture.name = textureDef.name; - - const samplers = json.samplers || {}; - const sampler = samplers[ textureDef.sampler ] || {}; - - texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter; - texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapLinearFilter; - texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping; - texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping; - - parser.associations.set( texture, { textures: textureIndex } ); - - return texture; - - } ).catch( function () { - - console.error( 'THREE.GLTFLoader: Couldn\'t load texture', sourceURI ); - return null; - - } ); - - this.textureCache[ cacheKey ] = promise; - - return promise; - - } - - /** - * Asynchronously assigns a texture to the given material parameters. - * @param {Object} materialParams - * @param {string} mapName - * @param {Object} mapDef - * @return {Promise} - */ - assignTexture( materialParams, mapName, mapDef ) { - - const parser = this; - - return this.getDependency( 'texture', mapDef.index ).then( function ( texture ) { - - // Materials sample aoMap from UV set 1 and other maps from UV set 0 - this can't be configured - // However, we will copy UV set 0 to UV set 1 on demand for aoMap - if ( mapDef.texCoord !== undefined && mapDef.texCoord != 0 && ! ( mapName === 'aoMap' && mapDef.texCoord == 1 ) ) { - - console.warn( 'THREE.GLTFLoader: Custom UV set ' + mapDef.texCoord + ' for texture ' + mapName + ' not yet supported.' ); - - } - - if ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) { - - const transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined; - - if ( transform ) { - - const gltfReference = parser.associations.get( texture ); - texture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform ); - parser.associations.set( texture, gltfReference ); - - } - - } - - materialParams[ mapName ] = texture; - - return texture; - - } ); - - } - - /** - * Assigns final material to a Mesh, Line, or Points instance. The instance - * already has a material (generated from the glTF material options alone) - * but reuse of the same glTF material may require multiple threejs materials - * to accommodate different primitive types, defines, etc. New materials will - * be created if necessary, and reused from a cache. - * @param {Object3D} mesh Mesh, Line, or Points instance. - */ - assignFinalMaterial( mesh ) { - - const geometry = mesh.geometry; - let material = mesh.material; - - const useDerivativeTangents = geometry.attributes.tangent === undefined; - const useVertexColors = geometry.attributes.color !== undefined; - const useFlatShading = geometry.attributes.normal === undefined; - - if ( mesh.isPoints ) { - - const cacheKey = 'PointsMaterial:' + material.uuid; - - let pointsMaterial = this.cache.get( cacheKey ); - - if ( ! pointsMaterial ) { - - pointsMaterial = new three__WEBPACK_IMPORTED_MODULE_0__.PointsMaterial(); - three__WEBPACK_IMPORTED_MODULE_0__.Material.prototype.copy.call( pointsMaterial, material ); - pointsMaterial.color.copy( material.color ); - pointsMaterial.map = material.map; - pointsMaterial.sizeAttenuation = false; // glTF spec says points should be 1px - - this.cache.add( cacheKey, pointsMaterial ); - - } - - material = pointsMaterial; - - } else if ( mesh.isLine ) { - - const cacheKey = 'LineBasicMaterial:' + material.uuid; - - let lineMaterial = this.cache.get( cacheKey ); - - if ( ! lineMaterial ) { - - lineMaterial = new three__WEBPACK_IMPORTED_MODULE_0__.LineBasicMaterial(); - three__WEBPACK_IMPORTED_MODULE_0__.Material.prototype.copy.call( lineMaterial, material ); - lineMaterial.color.copy( material.color ); - - this.cache.add( cacheKey, lineMaterial ); - - } - - material = lineMaterial; - - } - - // Clone the material if it will be modified - if ( useDerivativeTangents || useVertexColors || useFlatShading ) { - - let cacheKey = 'ClonedMaterial:' + material.uuid + ':'; - - if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:'; - if ( useDerivativeTangents ) cacheKey += 'derivative-tangents:'; - if ( useVertexColors ) cacheKey += 'vertex-colors:'; - if ( useFlatShading ) cacheKey += 'flat-shading:'; - - let cachedMaterial = this.cache.get( cacheKey ); - - if ( ! cachedMaterial ) { - - cachedMaterial = material.clone(); - - if ( useVertexColors ) cachedMaterial.vertexColors = true; - if ( useFlatShading ) cachedMaterial.flatShading = true; - - if ( useDerivativeTangents ) { - - // https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995 - if ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1; - if ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1; - - } - - this.cache.add( cacheKey, cachedMaterial ); - - this.associations.set( cachedMaterial, this.associations.get( material ) ); - - } - - material = cachedMaterial; - - } - - // workarounds for mesh and geometry - - if ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) { - - geometry.setAttribute( 'uv2', geometry.attributes.uv ); - - } - - mesh.material = material; - - } - - getMaterialType( /* materialIndex */ ) { - - return three__WEBPACK_IMPORTED_MODULE_0__.MeshStandardMaterial; - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials - * @param {number} materialIndex - * @return {Promise} - */ - loadMaterial( materialIndex ) { - - const parser = this; - const json = this.json; - const extensions = this.extensions; - const materialDef = json.materials[ materialIndex ]; - - let materialType; - const materialParams = {}; - const materialExtensions = materialDef.extensions || {}; - - const pending = []; - - if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) { - - const sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ]; - materialType = sgExtension.getMaterialType(); - pending.push( sgExtension.extendParams( materialParams, materialDef, parser ) ); - - } else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) { - - const kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ]; - materialType = kmuExtension.getMaterialType(); - pending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) ); - - } else { - - // Specification: - // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material - - const metallicRoughness = materialDef.pbrMetallicRoughness || {}; - - materialParams.color = new three__WEBPACK_IMPORTED_MODULE_0__.Color( 1.0, 1.0, 1.0 ); - materialParams.opacity = 1.0; - - if ( Array.isArray( metallicRoughness.baseColorFactor ) ) { - - const array = metallicRoughness.baseColorFactor; - - materialParams.color.fromArray( array ); - materialParams.opacity = array[ 3 ]; - - } - - if ( metallicRoughness.baseColorTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) ); - - } - - materialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0; - materialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0; - - if ( metallicRoughness.metallicRoughnessTexture !== undefined ) { - - pending.push( parser.assignTexture( materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture ) ); - pending.push( parser.assignTexture( materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture ) ); - - } - - materialType = this._invokeOne( function ( ext ) { - - return ext.getMaterialType && ext.getMaterialType( materialIndex ); - - } ); - - pending.push( Promise.all( this._invokeAll( function ( ext ) { - - return ext.extendMaterialParams && ext.extendMaterialParams( materialIndex, materialParams ); - - } ) ) ); - - } - - if ( materialDef.doubleSided === true ) { - - materialParams.side = three__WEBPACK_IMPORTED_MODULE_0__.DoubleSide; - - } - - const alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE; - - if ( alphaMode === ALPHA_MODES.BLEND ) { - - materialParams.transparent = true; - - // See: https://github.com/mrdoob/three.js/issues/17706 - materialParams.depthWrite = false; - - } else { - - materialParams.format = three__WEBPACK_IMPORTED_MODULE_0__.RGBFormat; - materialParams.transparent = false; - - if ( alphaMode === ALPHA_MODES.MASK ) { - - materialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5; - - } - - } - - if ( materialDef.normalTexture !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { - - pending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) ); - - materialParams.normalScale = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2( 1, 1 ); - - if ( materialDef.normalTexture.scale !== undefined ) { - - const scale = materialDef.normalTexture.scale; - - materialParams.normalScale.set( scale, scale ); - - } - - } - - if ( materialDef.occlusionTexture !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { - - pending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture ) ); - - if ( materialDef.occlusionTexture.strength !== undefined ) { - - materialParams.aoMapIntensity = materialDef.occlusionTexture.strength; - - } - - } - - if ( materialDef.emissiveFactor !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { - - materialParams.emissive = new three__WEBPACK_IMPORTED_MODULE_0__.Color().fromArray( materialDef.emissiveFactor ); - - } - - if ( materialDef.emissiveTexture !== undefined && materialType !== three__WEBPACK_IMPORTED_MODULE_0__.MeshBasicMaterial ) { - - pending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture ) ); - - } - - return Promise.all( pending ).then( function () { - - let material; - - if ( materialType === GLTFMeshStandardSGMaterial ) { - - material = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams ); - - } else { - - material = new materialType( materialParams ); - - } - - if ( materialDef.name ) material.name = materialDef.name; - - // baseColorTexture, emissiveTexture, and specularGlossinessTexture use sRGB encoding. - if ( material.map ) material.map.encoding = three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding; - if ( material.emissiveMap ) material.emissiveMap.encoding = three__WEBPACK_IMPORTED_MODULE_0__.sRGBEncoding; - - assignExtrasToUserData( material, materialDef ); - - parser.associations.set( material, { materials: materialIndex } ); - - if ( materialDef.extensions ) addUnknownExtensionsToUserData( extensions, material, materialDef ); - - return material; - - } ); - - } - - /** When Object3D instances are targeted by animation, they need unique names. */ - createUniqueName( originalName ) { - - const sanitizedName = three__WEBPACK_IMPORTED_MODULE_0__.PropertyBinding.sanitizeNodeName( originalName || '' ); - - let name = sanitizedName; - - for ( let i = 1; this.nodeNamesUsed[ name ]; ++ i ) { - - name = sanitizedName + '_' + i; - - } - - this.nodeNamesUsed[ name ] = true; - - return name; - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry - * - * Creates BufferGeometries from primitives. - * - * @param {Array} primitives - * @return {Promise>} - */ - loadGeometries( primitives ) { - - const parser = this; - const extensions = this.extensions; - const cache = this.primitiveCache; - - function createDracoPrimitive( primitive ) { - - return extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] - .decodePrimitive( primitive, parser ) - .then( function ( geometry ) { - - return addPrimitiveAttributes( geometry, primitive, parser ); - - } ); - - } - - const pending = []; - - for ( let i = 0, il = primitives.length; i < il; i ++ ) { - - const primitive = primitives[ i ]; - const cacheKey = createPrimitiveKey( primitive ); - - // See if we've already created this geometry - const cached = cache[ cacheKey ]; - - if ( cached ) { - - // Use the cached geometry if it exists - pending.push( cached.promise ); - - } else { - - let geometryPromise; - - if ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) { - - // Use DRACO geometry if available - geometryPromise = createDracoPrimitive( primitive ); - - } else { - - // Otherwise create a new geometry - geometryPromise = addPrimitiveAttributes( new three__WEBPACK_IMPORTED_MODULE_0__.BufferGeometry(), primitive, parser ); - - } - - // Cache this geometry - cache[ cacheKey ] = { primitive: primitive, promise: geometryPromise }; - - pending.push( geometryPromise ); - - } - - } - - return Promise.all( pending ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes - * @param {number} meshIndex - * @return {Promise} - */ - loadMesh( meshIndex ) { - - const parser = this; - const json = this.json; - const extensions = this.extensions; - - const meshDef = json.meshes[ meshIndex ]; - const primitives = meshDef.primitives; - - const pending = []; - - for ( let i = 0, il = primitives.length; i < il; i ++ ) { - - const material = primitives[ i ].material === undefined - ? createDefaultMaterial( this.cache ) - : this.getDependency( 'material', primitives[ i ].material ); - - pending.push( material ); - - } - - pending.push( parser.loadGeometries( primitives ) ); - - return Promise.all( pending ).then( function ( results ) { - - const materials = results.slice( 0, results.length - 1 ); - const geometries = results[ results.length - 1 ]; - - const meshes = []; - - for ( let i = 0, il = geometries.length; i < il; i ++ ) { - - const geometry = geometries[ i ]; - const primitive = primitives[ i ]; - - // 1. create Mesh - - let mesh; - - const material = materials[ i ]; - - if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || - primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || - primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || - primitive.mode === undefined ) { - - // .isSkinnedMesh isn't in glTF spec. See ._markDefs() - mesh = meshDef.isSkinnedMesh === true - ? new three__WEBPACK_IMPORTED_MODULE_0__.SkinnedMesh( geometry, material ) - : new three__WEBPACK_IMPORTED_MODULE_0__.Mesh( geometry, material ); - - if ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) { - - // we normalize floating point skin weight array to fix malformed assets (see #15319) - // it's important to skip this for non-float32 data since normalizeSkinWeights assumes non-normalized inputs - mesh.normalizeSkinWeights(); - - } - - if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) { - - mesh.geometry = toTrianglesDrawMode( mesh.geometry, three__WEBPACK_IMPORTED_MODULE_0__.TriangleStripDrawMode ); - - } else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) { - - mesh.geometry = toTrianglesDrawMode( mesh.geometry, three__WEBPACK_IMPORTED_MODULE_0__.TriangleFanDrawMode ); - - } - - } else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) { - - mesh = new three__WEBPACK_IMPORTED_MODULE_0__.LineSegments( geometry, material ); - - } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) { - - mesh = new three__WEBPACK_IMPORTED_MODULE_0__.Line( geometry, material ); - - } else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) { - - mesh = new three__WEBPACK_IMPORTED_MODULE_0__.LineLoop( geometry, material ); - - } else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) { - - mesh = new three__WEBPACK_IMPORTED_MODULE_0__.Points( geometry, material ); - - } else { - - throw new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode ); - - } - - if ( Object.keys( mesh.geometry.morphAttributes ).length > 0 ) { - - updateMorphTargets( mesh, meshDef ); - - } - - mesh.name = parser.createUniqueName( meshDef.name || ( 'mesh_' + meshIndex ) ); - - assignExtrasToUserData( mesh, meshDef ); - - if ( primitive.extensions ) addUnknownExtensionsToUserData( extensions, mesh, primitive ); - - parser.assignFinalMaterial( mesh ); - - meshes.push( mesh ); - - } - - for ( let i = 0, il = meshes.length; i < il; i ++ ) { - - parser.associations.set( meshes[ i ], { - meshes: meshIndex, - primitives: i - } ); - - } - - if ( meshes.length === 1 ) { - - return meshes[ 0 ]; - - } - - const group = new three__WEBPACK_IMPORTED_MODULE_0__.Group(); - - parser.associations.set( group, { meshes: meshIndex } ); - - for ( let i = 0, il = meshes.length; i < il; i ++ ) { - - group.add( meshes[ i ] ); - - } - - return group; - - } ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras - * @param {number} cameraIndex - * @return {Promise} - */ - loadCamera( cameraIndex ) { - - let camera; - const cameraDef = this.json.cameras[ cameraIndex ]; - const params = cameraDef[ cameraDef.type ]; - - if ( ! params ) { - - console.warn( 'THREE.GLTFLoader: Missing camera parameters.' ); - return; - - } - - if ( cameraDef.type === 'perspective' ) { - - camera = new three__WEBPACK_IMPORTED_MODULE_0__.PerspectiveCamera( three__WEBPACK_IMPORTED_MODULE_0__.MathUtils.radToDeg( params.yfov ), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6 ); - - } else if ( cameraDef.type === 'orthographic' ) { - - camera = new three__WEBPACK_IMPORTED_MODULE_0__.OrthographicCamera( - params.xmag, params.xmag, params.ymag, - params.ymag, params.znear, params.zfar ); - - } - - if ( cameraDef.name ) camera.name = this.createUniqueName( cameraDef.name ); - - assignExtrasToUserData( camera, cameraDef ); - - return Promise.resolve( camera ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins - * @param {number} skinIndex - * @return {Promise} - */ - loadSkin( skinIndex ) { - - const skinDef = this.json.skins[ skinIndex ]; - - const skinEntry = { joints: skinDef.joints }; - - if ( skinDef.inverseBindMatrices === undefined ) { - - return Promise.resolve( skinEntry ); - - } - - return this.getDependency( 'accessor', skinDef.inverseBindMatrices ).then( function ( accessor ) { - - skinEntry.inverseBindMatrices = accessor; - - return skinEntry; - - } ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations - * @param {number} animationIndex - * @return {Promise} - */ - loadAnimation( animationIndex ) { - - const json = this.json; - - const animationDef = json.animations[ animationIndex ]; - - const pendingNodes = []; - const pendingInputAccessors = []; - const pendingOutputAccessors = []; - const pendingSamplers = []; - const pendingTargets = []; - - for ( let i = 0, il = animationDef.channels.length; i < il; i ++ ) { - - const channel = animationDef.channels[ i ]; - const sampler = animationDef.samplers[ channel.sampler ]; - const target = channel.target; - const name = target.node !== undefined ? target.node : target.id; // NOTE: target.id is deprecated. - const input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input; - const output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output; - - pendingNodes.push( this.getDependency( 'node', name ) ); - pendingInputAccessors.push( this.getDependency( 'accessor', input ) ); - pendingOutputAccessors.push( this.getDependency( 'accessor', output ) ); - pendingSamplers.push( sampler ); - pendingTargets.push( target ); - - } - - return Promise.all( [ - - Promise.all( pendingNodes ), - Promise.all( pendingInputAccessors ), - Promise.all( pendingOutputAccessors ), - Promise.all( pendingSamplers ), - Promise.all( pendingTargets ) - - ] ).then( function ( dependencies ) { - - const nodes = dependencies[ 0 ]; - const inputAccessors = dependencies[ 1 ]; - const outputAccessors = dependencies[ 2 ]; - const samplers = dependencies[ 3 ]; - const targets = dependencies[ 4 ]; - - const tracks = []; - - for ( let i = 0, il = nodes.length; i < il; i ++ ) { - - const node = nodes[ i ]; - const inputAccessor = inputAccessors[ i ]; - const outputAccessor = outputAccessors[ i ]; - const sampler = samplers[ i ]; - const target = targets[ i ]; - - if ( node === undefined ) continue; - - node.updateMatrix(); - node.matrixAutoUpdate = true; - - let TypedKeyframeTrack; - - switch ( PATH_PROPERTIES[ target.path ] ) { - - case PATH_PROPERTIES.weights: - - TypedKeyframeTrack = three__WEBPACK_IMPORTED_MODULE_0__.NumberKeyframeTrack; - break; - - case PATH_PROPERTIES.rotation: - - TypedKeyframeTrack = three__WEBPACK_IMPORTED_MODULE_0__.QuaternionKeyframeTrack; - break; - - case PATH_PROPERTIES.position: - case PATH_PROPERTIES.scale: - default: - - TypedKeyframeTrack = three__WEBPACK_IMPORTED_MODULE_0__.VectorKeyframeTrack; - break; - - } - - const targetName = node.name ? node.name : node.uuid; - - const interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : three__WEBPACK_IMPORTED_MODULE_0__.InterpolateLinear; - - const targetNames = []; - - if ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) { - - // Node may be a Group (glTF mesh with several primitives) or a Mesh. - node.traverse( function ( object ) { - - if ( object.isMesh === true && object.morphTargetInfluences ) { - - targetNames.push( object.name ? object.name : object.uuid ); - - } - - } ); - - } else { - - targetNames.push( targetName ); - - } - - let outputArray = outputAccessor.array; - - if ( outputAccessor.normalized ) { - - const scale = getNormalizedComponentScale( outputArray.constructor ); - const scaled = new Float32Array( outputArray.length ); - - for ( let j = 0, jl = outputArray.length; j < jl; j ++ ) { - - scaled[ j ] = outputArray[ j ] * scale; - - } - - outputArray = scaled; - - } - - for ( let j = 0, jl = targetNames.length; j < jl; j ++ ) { - - const track = new TypedKeyframeTrack( - targetNames[ j ] + '.' + PATH_PROPERTIES[ target.path ], - inputAccessor.array, - outputArray, - interpolation - ); - - // Override interpolation with custom factory method. - if ( sampler.interpolation === 'CUBICSPLINE' ) { - - track.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline( result ) { - - // A CUBICSPLINE keyframe in glTF has three output values for each input value, - // representing inTangent, splineVertex, and outTangent. As a result, track.getValueSize() - // must be divided by three to get the interpolant's sampleSize argument. - - const interpolantType = ( this instanceof three__WEBPACK_IMPORTED_MODULE_0__.QuaternionKeyframeTrack ) ? GLTFCubicSplineQuaternionInterpolant : GLTFCubicSplineInterpolant; - - return new interpolantType( this.times, this.values, this.getValueSize() / 3, result ); - - }; - - // Mark as CUBICSPLINE. `track.getInterpolation()` doesn't support custom interpolants. - track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true; - - } - - tracks.push( track ); - - } - - } - - const name = animationDef.name ? animationDef.name : 'animation_' + animationIndex; - - return new three__WEBPACK_IMPORTED_MODULE_0__.AnimationClip( name, undefined, tracks ); - - } ); - - } - - createNodeMesh( nodeIndex ) { - - const json = this.json; - const parser = this; - const nodeDef = json.nodes[ nodeIndex ]; - - if ( nodeDef.mesh === undefined ) return null; - - return parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) { - - const node = parser._getNodeRef( parser.meshCache, nodeDef.mesh, mesh ); - - // if weights are provided on the node, override weights on the mesh. - if ( nodeDef.weights !== undefined ) { - - node.traverse( function ( o ) { - - if ( ! o.isMesh ) return; - - for ( let i = 0, il = nodeDef.weights.length; i < il; i ++ ) { - - o.morphTargetInfluences[ i ] = nodeDef.weights[ i ]; - - } - - } ); - - } - - return node; - - } ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy - * @param {number} nodeIndex - * @return {Promise} - */ - loadNode( nodeIndex ) { - - const json = this.json; - const extensions = this.extensions; - const parser = this; - - const nodeDef = json.nodes[ nodeIndex ]; - - // reserve node's name before its dependencies, so the root has the intended name. - const nodeName = nodeDef.name ? parser.createUniqueName( nodeDef.name ) : ''; - - return ( function () { - - const pending = []; - - const meshPromise = parser._invokeOne( function ( ext ) { - - return ext.createNodeMesh && ext.createNodeMesh( nodeIndex ); - - } ); - - if ( meshPromise ) { - - pending.push( meshPromise ); - - } - - if ( nodeDef.camera !== undefined ) { - - pending.push( parser.getDependency( 'camera', nodeDef.camera ).then( function ( camera ) { - - return parser._getNodeRef( parser.cameraCache, nodeDef.camera, camera ); - - } ) ); - - } - - parser._invokeAll( function ( ext ) { - - return ext.createNodeAttachment && ext.createNodeAttachment( nodeIndex ); - - } ).forEach( function ( promise ) { - - pending.push( promise ); - - } ); - - return Promise.all( pending ); - - }() ).then( function ( objects ) { - - let node; - - // .isBone isn't in glTF spec. See ._markDefs - if ( nodeDef.isBone === true ) { - - node = new three__WEBPACK_IMPORTED_MODULE_0__.Bone(); - - } else if ( objects.length > 1 ) { - - node = new three__WEBPACK_IMPORTED_MODULE_0__.Group(); - - } else if ( objects.length === 1 ) { - - node = objects[ 0 ]; - - } else { - - node = new three__WEBPACK_IMPORTED_MODULE_0__.Object3D(); - - } - - if ( node !== objects[ 0 ] ) { - - for ( let i = 0, il = objects.length; i < il; i ++ ) { - - node.add( objects[ i ] ); - - } - - } - - if ( nodeDef.name ) { - - node.userData.name = nodeDef.name; - node.name = nodeName; - - } - - assignExtrasToUserData( node, nodeDef ); - - if ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef ); - - if ( nodeDef.matrix !== undefined ) { - - const matrix = new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4(); - matrix.fromArray( nodeDef.matrix ); - node.applyMatrix4( matrix ); - - } else { - - if ( nodeDef.translation !== undefined ) { - - node.position.fromArray( nodeDef.translation ); - - } - - if ( nodeDef.rotation !== undefined ) { - - node.quaternion.fromArray( nodeDef.rotation ); - - } - - if ( nodeDef.scale !== undefined ) { - - node.scale.fromArray( nodeDef.scale ); - - } - - } - - if ( ! parser.associations.has( node ) ) { - - parser.associations.set( node, {} ); - - } - - parser.associations.get( node ).nodes = nodeIndex; - - return node; - - } ); - - } - - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes - * @param {number} sceneIndex - * @return {Promise} - */ - loadScene( sceneIndex ) { - - const json = this.json; - const extensions = this.extensions; - const sceneDef = this.json.scenes[ sceneIndex ]; - const parser = this; - - // Loader returns Group, not Scene. - // See: https://github.com/mrdoob/three.js/issues/18342#issuecomment-578981172 - const scene = new three__WEBPACK_IMPORTED_MODULE_0__.Group(); - if ( sceneDef.name ) scene.name = parser.createUniqueName( sceneDef.name ); - - assignExtrasToUserData( scene, sceneDef ); - - if ( sceneDef.extensions ) addUnknownExtensionsToUserData( extensions, scene, sceneDef ); - - const nodeIds = sceneDef.nodes || []; - - const pending = []; - - for ( let i = 0, il = nodeIds.length; i < il; i ++ ) { - - pending.push( buildNodeHierarchy( nodeIds[ i ], scene, json, parser ) ); - - } - - return Promise.all( pending ).then( function () { - - // Removes dangling associations, associations that reference a node that - // didn't make it into the scene. - const reduceAssociations = ( node ) => { - - const reducedAssociations = new Map(); - - for ( const [ key, value ] of parser.associations ) { - - if ( key instanceof three__WEBPACK_IMPORTED_MODULE_0__.Material || key instanceof three__WEBPACK_IMPORTED_MODULE_0__.Texture ) { - - reducedAssociations.set( key, value ); - - } - - } - - node.traverse( ( node ) => { - - const mappings = parser.associations.get( node ); - - if ( mappings != null ) { - - reducedAssociations.set( node, mappings ); - - } - - } ); - - return reducedAssociations; - - }; - - parser.associations = reduceAssociations( scene ); - - return scene; - - } ); - - } - -} - -function buildNodeHierarchy( nodeId, parentObject, json, parser ) { - - const nodeDef = json.nodes[ nodeId ]; - - return parser.getDependency( 'node', nodeId ).then( function ( node ) { - - if ( nodeDef.skin === undefined ) return node; - - // build skeleton here as well - - let skinEntry; - - return parser.getDependency( 'skin', nodeDef.skin ).then( function ( skin ) { - - skinEntry = skin; - - const pendingJoints = []; - - for ( let i = 0, il = skinEntry.joints.length; i < il; i ++ ) { - - pendingJoints.push( parser.getDependency( 'node', skinEntry.joints[ i ] ) ); - - } - - return Promise.all( pendingJoints ); - - } ).then( function ( jointNodes ) { - - node.traverse( function ( mesh ) { - - if ( ! mesh.isMesh ) return; - - const bones = []; - const boneInverses = []; - - for ( let j = 0, jl = jointNodes.length; j < jl; j ++ ) { - - const jointNode = jointNodes[ j ]; - - if ( jointNode ) { - - bones.push( jointNode ); - - const mat = new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4(); - - if ( skinEntry.inverseBindMatrices !== undefined ) { - - mat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 ); - - } - - boneInverses.push( mat ); - - } else { - - console.warn( 'THREE.GLTFLoader: Joint "%s" could not be found.', skinEntry.joints[ j ] ); - - } - - } - - mesh.bind( new three__WEBPACK_IMPORTED_MODULE_0__.Skeleton( bones, boneInverses ), mesh.matrixWorld ); - - } ); - - return node; - - } ); - - } ).then( function ( node ) { - - // build node hierachy - - parentObject.add( node ); - - const pending = []; - - if ( nodeDef.children ) { - - const children = nodeDef.children; - - for ( let i = 0, il = children.length; i < il; i ++ ) { - - const child = children[ i ]; - pending.push( buildNodeHierarchy( child, node, json, parser ) ); - - } - - } - - return Promise.all( pending ); - - } ); - -} - -/** - * @param {BufferGeometry} geometry - * @param {GLTF.Primitive} primitiveDef - * @param {GLTFParser} parser - */ -function computeBounds( geometry, primitiveDef, parser ) { - - const attributes = primitiveDef.attributes; - - const box = new three__WEBPACK_IMPORTED_MODULE_0__.Box3(); - - if ( attributes.POSITION !== undefined ) { - - const accessor = parser.json.accessors[ attributes.POSITION ]; - - const min = accessor.min; - const max = accessor.max; - - // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement. - - if ( min !== undefined && max !== undefined ) { - - box.set( - new three__WEBPACK_IMPORTED_MODULE_0__.Vector3( min[ 0 ], min[ 1 ], min[ 2 ] ), - new three__WEBPACK_IMPORTED_MODULE_0__.Vector3( max[ 0 ], max[ 1 ], max[ 2 ] ) - ); - - if ( accessor.normalized ) { - - const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] ); - box.min.multiplyScalar( boxScale ); - box.max.multiplyScalar( boxScale ); - - } - - } else { - - console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ); - - return; - - } - - } else { - - return; - - } - - const targets = primitiveDef.targets; - - if ( targets !== undefined ) { - - const maxDisplacement = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(); - const vector = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(); - - for ( let i = 0, il = targets.length; i < il; i ++ ) { - - const target = targets[ i ]; - - if ( target.POSITION !== undefined ) { - - const accessor = parser.json.accessors[ target.POSITION ]; - const min = accessor.min; - const max = accessor.max; - - // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement. - - if ( min !== undefined && max !== undefined ) { - - // we need to get max of absolute components because target weight is [-1,1] - vector.setX( Math.max( Math.abs( min[ 0 ] ), Math.abs( max[ 0 ] ) ) ); - vector.setY( Math.max( Math.abs( min[ 1 ] ), Math.abs( max[ 1 ] ) ) ); - vector.setZ( Math.max( Math.abs( min[ 2 ] ), Math.abs( max[ 2 ] ) ) ); - - - if ( accessor.normalized ) { - - const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] ); - vector.multiplyScalar( boxScale ); - - } - - // Note: this assumes that the sum of all weights is at most 1. This isn't quite correct - it's more conservative - // to assume that each target can have a max weight of 1. However, for some use cases - notably, when morph targets - // are used to implement key-frame animations and as such only two are active at a time - this results in very large - // boxes. So for now we make a box that's sometimes a touch too small but is hopefully mostly of reasonable size. - maxDisplacement.max( vector ); - - } else { - - console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' ); - - } - - } - - } - - // As per comment above this box isn't conservative, but has a reasonable size for a very large number of morph targets. - box.expandByVector( maxDisplacement ); - - } - - geometry.boundingBox = box; - - const sphere = new three__WEBPACK_IMPORTED_MODULE_0__.Sphere(); - - box.getCenter( sphere.center ); - sphere.radius = box.min.distanceTo( box.max ) / 2; - - geometry.boundingSphere = sphere; - -} - -/** - * @param {BufferGeometry} geometry - * @param {GLTF.Primitive} primitiveDef - * @param {GLTFParser} parser - * @return {Promise} - */ -function addPrimitiveAttributes( geometry, primitiveDef, parser ) { - - const attributes = primitiveDef.attributes; - - const pending = []; - - function assignAttributeAccessor( accessorIndex, attributeName ) { - - return parser.getDependency( 'accessor', accessorIndex ) - .then( function ( accessor ) { - - geometry.setAttribute( attributeName, accessor ); - - } ); - - } - - for ( const gltfAttributeName in attributes ) { - - const threeAttributeName = ATTRIBUTES[ gltfAttributeName ] || gltfAttributeName.toLowerCase(); - - // Skip attributes already provided by e.g. Draco extension. - if ( threeAttributeName in geometry.attributes ) continue; - - pending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) ); - - } - - if ( primitiveDef.indices !== undefined && ! geometry.index ) { - - const accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) { - - geometry.setIndex( accessor ); - - } ); - - pending.push( accessor ); - - } - - assignExtrasToUserData( geometry, primitiveDef ); - - computeBounds( geometry, primitiveDef, parser ); - - return Promise.all( pending ).then( function () { - - return primitiveDef.targets !== undefined - ? addMorphTargets( geometry, primitiveDef.targets, parser ) - : geometry; - - } ); - -} - -/** - * @param {BufferGeometry} geometry - * @param {Number} drawMode - * @return {BufferGeometry} - */ -function toTrianglesDrawMode( geometry, drawMode ) { - - let index = geometry.getIndex(); - - // generate index if not present - - if ( index === null ) { - - const indices = []; - - const position = geometry.getAttribute( 'position' ); - - if ( position !== undefined ) { - - for ( let i = 0; i < position.count; i ++ ) { - - indices.push( i ); - - } - - geometry.setIndex( indices ); - index = geometry.getIndex(); - - } else { - - console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' ); - return geometry; - - } - - } - - // - - const numberOfTriangles = index.count - 2; - const newIndices = []; - - if ( drawMode === three__WEBPACK_IMPORTED_MODULE_0__.TriangleFanDrawMode ) { - - // gl.TRIANGLE_FAN - - for ( let i = 1; i <= numberOfTriangles; i ++ ) { - - newIndices.push( index.getX( 0 ) ); - newIndices.push( index.getX( i ) ); - newIndices.push( index.getX( i + 1 ) ); - - } - - } else { - - // gl.TRIANGLE_STRIP - - for ( let i = 0; i < numberOfTriangles; i ++ ) { - - if ( i % 2 === 0 ) { - - newIndices.push( index.getX( i ) ); - newIndices.push( index.getX( i + 1 ) ); - newIndices.push( index.getX( i + 2 ) ); - - - } else { - - newIndices.push( index.getX( i + 2 ) ); - newIndices.push( index.getX( i + 1 ) ); - newIndices.push( index.getX( i ) ); - - } - - } - - } - - if ( ( newIndices.length / 3 ) !== numberOfTriangles ) { - - console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' ); - - } - - // build final geometry - - const newGeometry = geometry.clone(); - newGeometry.setIndex( newIndices ); - - return newGeometry; - -} - - - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -/*!**********************!*\ - !*** ./src/index.ts ***! - \**********************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SceneRendererTJS */ "./src/SceneRendererTJS.ts"); -/* harmony import */ var _markermedia_NFTaddTJS__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./markermedia/NFTaddTJS */ "./src/markermedia/NFTaddTJS.ts"); - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - SceneRendererTJS: _SceneRendererTJS__WEBPACK_IMPORTED_MODULE_0__["default"], - NFTaddTJS: _markermedia_NFTaddTJS__WEBPACK_IMPORTED_MODULE_1__["default"] -}); -})(); - -__webpack_exports__ = __webpack_exports__["default"]; -/******/ return __webpack_exports__; -/******/ })() -; -}); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxPOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWQTtBQUNBOztJQXlDcUI7QUFZakIsNEJBQVksVUFBWixFQUFvQyxVQUFwQyxFQUFtRSxJQUFuRSxFQUFpRixVQUFqRixFQUFvRztBQUFBOztBQUNoRyxTQUFLLFVBQUwsR0FBa0IsVUFBbEI7QUFDQSxTQUFLLElBQUwsR0FBWSxJQUFaO0FBQ0EsU0FBSyxNQUFMLEdBQWMsTUFBTSxJQUFJLHFCQUF4QjtBQUNBLFNBQUssUUFBTCxHQUFnQixJQUFJLGdEQUFKLENBQXdCO0FBQ3BDLFlBQU0sRUFBRSxVQUQ0QjtBQUVwQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FGTztBQUdwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FIUztBQUlwQyx3QkFBa0IsRUFBRSxVQUFVLENBQUMsUUFBWCxDQUFvQixrQkFKSjtBQUtwQyxlQUFTLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsU0FMSztBQU1wQyxhQUFPLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsT0FOTztBQU9wQyxlQUFTLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsU0FQSztBQVFwQyxXQUFLLEVBQUUsVUFBVSxDQUFDLFFBQVgsQ0FBb0IsS0FSUztBQVNwQyw0QkFBc0IsRUFBRSx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1cnJlbnRUcmFuc2xhdGlvbi5kaXN0YW5jZVRvKHRoaXMuX2xhc3RUcmFuc2xhdGlvbikpID4gdGhpcy5fZGVsdGFBY2N1cmFjeSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZURyb3BzICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZURyb3BzID4gMykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gX2N1cnJlbnRUcmFuc2xhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW3Bvcywgcm90YXRpb25WZWMsIHNjYWxlXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5fZnJhbWVEcm9wcyA9IDA7XG4gICAgICAgICAgICAgICAgdGhpcy5fbGFzdFRyYW5zbGF0aW9uID0gX2N1cnJlbnRUcmFuc2xhdGlvbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX3Bvc2l0aW9uRmlsdGVyLlVwZGF0ZVBhcmFtcyhcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlckZyZXF1ZW5jeSxcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlck1pbkN1dG9mZixcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlckJldGEsXG4gICAgICAgICAgICAgICAgdGhpcy5maWx0ZXJEY3V0b2ZmXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgdGhpcy5fcm90YXRpb25GaWx0ZXIuVXBkYXRlUGFyYW1zKFxuICAgICAgICAgICAgICAgIHRoaXMuZmlsdGVyRnJlcXVlbmN5ICogMixcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlck1pbkN1dG9mZixcbiAgICAgICAgICAgICAgICB0aGlzLmZpbHRlckJldGEsXG4gICAgICAgICAgICAgICAgdGhpcy5maWx0ZXJEY3V0b2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lsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtZXNoLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgICAgICB0aGlzLmVudGl0aWVzLnB1c2goeyBuYW1lIH0pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRNb2RlbCBmdW5jdGlvb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LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRORlREYXRhLVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIHZhciBtc2cgPSBldi5kZXRhaWw7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueSA9ICgobXNnLmhlaWdodCAvIG1zZy5kcGkpICogMi41NCAqIDEwKSAvIDIuMDtcbiAgICAgICAgICAgICAgICBtb2RlbC5wb3NpdGlvbi54ID0gKChtc2cud2lkdGggLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJvb3QuYWRkKG1vZGVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsIDAsIDApLCBuZXcgVmVjdG9yMygwLCAwLCAwKSwgbmV3IFZlY3RvcjMoMCwgMCwgMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgYWRkTW9kZWxXaXRoQ2FsbGJhY2sgZnVuY3Rpb24gd2lsbCBhZGQgYSBtb2RlbCB0byB0aGUgUmVuZGVyZXIgcm9vdC4gWW91IG5lZWQgdG8gYXNzb2NpYXRlIGEgbmFtZSBvZiB0aGUgRW50aXR5LlxuICAgICAqIFlvdSBjYW4gbW9kaWZ5IHRoZSBtb2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ICAgICAgICAgICAgICB2YXIgbXNnID0gZXYuZGV0YWlsO1xuICAgICAgICAgICAgICAgIG1vZGVsLnBvc2l0aW9uLnkgPSAoKG1zZy5oZWlnaHQgLyBtc2cuZHBpKSAqIDIuNTQgKiAxMCkgLyAyLjA7XG4gICAgICAgICAgICAgICAgbW9kZWwucG9zaXRpb24ueCA9ICgobXNnLndpZHRoIC8gbXNnLmRwaSkgKiAyLjU0ICogMTApIC8gMi4wO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjYWxsYmFjayhnbHRmKTtcbiAgICAgICAgICAgIHJvb3QuYWRkKG1vZGVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMudGFyZ2V0LmFkZEV2ZW50TGlzdGVuZXIoXCJnZXRNYXRyaXhHTF9SSC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IHRydWU7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsIDAsIDApLCBuZXcgVmVjdG9yMygwLCAwLCAwKSwgbmV3IFZlY3RvcjMoMCwgMCwgMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZW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C5wb3NpdGlvbi5zZXRZKGZpbHRlclswXS55KTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooZmlsdGVyWzBdLnopO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoZmlsdGVyWzJdLngpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WShmaWx0ZXJbMl0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRaKGZpbHRlclsyXS56KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm9vdC5tYXRyaXhBdXRvVXBkYXRlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICBVdGlscy5zZXRNYXRyaXgocm9vdC5tYXRyaXgsIG1hdHJpeCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgICAgIHBsYW5lLnZpc2libGUgPSBvYmpWaXNpYmlsaXR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5uYW1lcy5wdXNoKG5hbWUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBhZGRWaWRlbyBmdW5jdGlvbiB3aWxsIGFkZCBhIHZpZGVvIHRvIHRoZSBSZW5kZXJlciByb290LiBZb3UgbmVlZCB0byBhc3NvY2lhdGUgYS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X2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBwbGFuZS52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG5cbi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W1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):"object"==typeof exports?exports.ARnftThreejs=t(require("three")):e.ARnftThreejs=t(e.THREE)}(this,(function(e){return(()=>{"use strict";var t={381:t=>{t.exports=e}},s={};function n(e){var r=s[e];if(void 0!==r)return r.exports;var i=s[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var s=0;ste});var i=n(381),a=function(){function t(){e(this,t)}return s(t,null,[{key:"interpolate",value:function(e){for(var t=0;t<16;t++)this.trackedMatrix.delta[t]=e[t]-this.trackedMatrix.interpolated[t],this.trackedMatrix.interpolated[t]=this.trackedMatrix.interpolated[t]+this.trackedMatrix.delta[t]/24;return this.trackedMatrix.interpolated}},{key:"isMobile",value:function(){return/Android|mobile|iPad|iPhone/i.test(navigator.userAgent)}},{key:"setMatrix",value:function(e,t){var s=[];for(var n in t)s[n]=t[n];"function"==typeof e.elements.set?e.elements.set(s):e.elements=[].slice.call(s)}}]),t}();a.trackedMatrix={delta:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],interpolated:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};var o=function(){function t(s,r,a,o){e(this,t),this.configData=s,this.uuid=a,this.target=window||n.g,this.renderer=new i.WebGLRenderer({canvas:r,context:s.renderer.context,alpha:s.renderer.alpha,premultipliedAlpha:s.renderer.premultipliedAlpha,antialias:s.renderer.antialias,stencil:s.renderer.stencil,precision:s.renderer.precision,depth:s.renderer.depth,logarithmicDepthBuffer:s.renderer.logarithmicDepthBuffer}),this.renderer.setPixelRatio(window.devicePixelRatio),this.scene=new i.Scene,t.globalScene=this.scene,this.camera=!0===o?new i.PerspectiveCamera(s.camera.fov,s.camera.ratio,s.camera.near,s.camera.far):new i.Camera,this.version="0.4.5",console.log("ARnftThreejs version: ",this.version)}return s(t,[{key:"initRenderer",value:function(){var e=this;this.camera.matrixAutoUpdate=!1,this.target.addEventListener("getProjectionMatrix",(function(t){a.setMatrix(e.camera.projectionMatrix,t.detail.proj)})),this.scene.add(this.camera);var t=new i.AmbientLight(16777215);this.scene.add(t),this.target.addEventListener("getWindowSize",(function(t){e.renderer.setSize(t.detail.sw,t.detail.sh)}));var s=new CustomEvent("onInitThreejsRendering",{detail:{renderer:this.renderer,scene:this.scene,camera:this.camera}});this.target.dispatchEvent(s)}},{key:"draw",value:function(){this.renderer.render(this.scene,this.camera)}},{key:"getRenderer",value:function(){return this.renderer}},{key:"getScene",value:function(){return this.scene}},{key:"getCamera",value:function(){return this.camera}},{key:"setRenderer",value:function(e){this.renderer=e}},{key:"setScene",value:function(e){this.scene=e}},{key:"setCamera",value:function(e){this.camera=e}}],[{key:"getGlobalScene",value:function(){return t.globalScene}}]),t}();class l extends i.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new p(e)})),this.register((function(e){return new T(e)})),this.register((function(e){return new M(e)})),this.register((function(e){return new f(e)})),this.register((function(e){return new m(e)})),this.register((function(e){return new g(e)})),this.register((function(e){return new v(e)})),this.register((function(e){return new x(e)})),this.register((function(e){return new h(e)})),this.register((function(e){return new y(e)}))}load(e,t,s,n){const r=this;let a;a=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:i.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);const o=function(t){n?n(t):console.error(t),r.manager.itemError(e),r.manager.itemEnd(e)},l=new i.FileLoader(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,(function(s){try{r.parse(s,a,(function(s){t(s),r.manager.itemEnd(e)}),o)}catch(e){o(e)}}),s,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){let r;const a={},o={};if("string"==typeof e)r=e;else if(i.LoaderUtils.decodeText(new Uint8Array(e,0,4))===_){try{a[u.KHR_BINARY_GLTF]=new w(e)}catch(e){return void(n&&n(e))}r=a[u.KHR_BINARY_GLTF].content}else r=i.LoaderUtils.decodeText(new Uint8Array(e));const l=JSON.parse(r);if(void 0===l.asset||l.asset.version[0]<2)return void(n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const c=new X(l,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}c.setExtensions(a),c.setPlugins(o),c.parse(s,n)}}function c(){let e={};return{get:function(t){return e[t]},add:function(t,s){e[t]=s},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const u={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class h{constructor(e){this.parser=e,this.name=u.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i,a)}}class M{constructor(e){this.parser=e,this.name=u.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,r=n.textures[e];if(!r.extensions||!r.extensions[t])return null;const i=r.extensions[t],a=n.images[i.source];let o=s.textureLoader;if(a.uri){const e=s.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(r){if(r)return s.loadTextureImage(e,a,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class y{constructor(e){this.name=u.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const e=s.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([n,r.ready]).then((function(t){const s=e.byteOffset||0,n=e.byteLength||0,i=e.count,a=e.byteStride,o=new ArrayBuffer(i*a),l=new Uint8Array(t[0],s,n);return r.decodeGltfBuffer(new Uint8Array(o),i,a,l,e.mode,e.filter),o}))}return null}}const _="glTF";class w{constructor(e){this.name=u.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:i.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==_)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-12,n=new DataView(e,12);let r=0;for(;r",t).replace("#include ",s).replace("#include ",n).replace("#include ",r).replace("#include ",a)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class L{constructor(){this.name=u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return A}extendParams(e,t,s){const n=t.extensions[this.name];e.color=new i.Color(1,1,1),e.opacity=1;const r=[];if(Array.isArray(n.diffuseFactor)){const t=n.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==n.diffuseTexture&&r.push(s.assignTexture(e,"map",n.diffuseTexture)),e.emissive=new i.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new i.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){const t=n.specularGlossinessTexture;r.push(s.assignTexture(e,"glossinessMap",t)),r.push(s.assignTexture(e,"specularMap",t))}return Promise.all(r)}createMaterial(e){const t=new A(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=i.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class S{constructor(){this.name=u.KHR_MESH_QUANTIZATION}}class b extends i.Interpolant{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,r=e*n*3+n;for(let e=0;e!==n;e++)t[e]=s[r+e];return t}}b.prototype.beforeStart_=b.prototype.copySampleValue_,b.prototype.afterEnd_=b.prototype.copySampleValue_,b.prototype.interpolate_=function(e,t,s,n){const r=this.resultBuffer,i=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,c=n-t,u=(s-t)/c,h=u*u,d=h*u,p=e*l,f=p-l,m=-2*d+3*h,g=d-h,v=1-m,x=g-h+u;for(let e=0;e!==a;e++){const t=i[f+e+a],s=i[f+e+o]*c,n=i[p+e+a],l=i[p+e]*c;r[e]=v*t+x*s+m*n+g*l}return r};const P=new i.Quaternion;class C extends b{interpolate_(e,t,s,n){const r=super.interpolate_(e,t,s,n);return P.fromArray(r).normalize().toArray(r),r}}const F={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},I={9728:i.NearestFilter,9729:i.LinearFilter,9984:i.NearestMipmapNearestFilter,9985:i.LinearMipmapNearestFilter,9986:i.NearestMipmapLinearFilter,9987:i.LinearMipmapLinearFilter},O={33071:i.ClampToEdgeWrapping,33648:i.MirroredRepeatWrapping,10497:i.RepeatWrapping},k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},H={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},N={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},U={CUBICSPLINE:void 0,LINEAR:i.InterpolateLinear,STEP:i.InterpolateDiscrete};function D(e,t,s){for(const n in s.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=s.extensions[n])}function V(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function G(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let s=0,n=t.weights.length;s{const s=this.associations.get(e);null!=s&&this.associations.set(t,s);for(const[s,n]of e.children.entries())r(n,t.children[s])};return r(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s=2&&f.setY(t,h[e*a+1]),a>=3&&f.setZ(t,h[e*a+2]),a>=4&&f.setW(t,h[e*a+3]),a>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f}))}loadTexture(e){const t=this.json,s=this.options,n=t.textures[e],r=t.images[n.source];let i=this.textureLoader;if(r.uri){const e=s.manager.getHandler(r.uri);null!==e&&(i=e)}return this.loadTextureImage(e,r,i)}loadTextureImage(e,t,s){const n=this,r=this.json,a=this.options,o=r.textures[e],l=(t.uri||t.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=self.URL||self.webkitURL;let u=t.uri||"",h=!1;if(void 0!==t.bufferView)u=n.getDependency("bufferView",t.bufferView).then((function(e){h=!0;const s=new Blob([e],{type:t.mimeType});return u=c.createObjectURL(s),u}));else if(void 0===t.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(u).then((function(e){return new Promise((function(t,n){let r=t;!0===s.isImageBitmapLoader&&(r=function(e){const s=new i.Texture(e);s.needsUpdate=!0,t(s)}),s.load(i.LoaderUtils.resolveURL(e,a.path),r,void 0,n)}))})).then((function(t){!0===h&&c.revokeObjectURL(u),t.flipY=!1,o.name&&(t.name=o.name);const s=(r.samplers||{})[o.sampler]||{};return t.magFilter=I[s.magFilter]||i.LinearFilter,t.minFilter=I[s.minFilter]||i.LinearMipmapLinearFilter,t.wrapS=O[s.wrapS]||i.RepeatWrapping,t.wrapT=O[s.wrapT]||i.RepeatWrapping,n.associations.set(t,{textures:e}),t})).catch((function(){return console.error("THREE.GLTFLoader: Couldn't load texture",u),null}));return this.textureCache[l]=d,d}assignTexture(e,t,s){const n=this;return this.getDependency("texture",s.index).then((function(r){if(void 0===s.texCoord||0==s.texCoord||"aoMap"===t&&1==s.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+s.texCoord+" for texture "+t+" not yet supported."),n.extensions[u.KHR_TEXTURE_TRANSFORM]){const e=void 0!==s.extensions?s.extensions[u.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=n.associations.get(r);r=n.extensions[u.KHR_TEXTURE_TRANSFORM].extendTexture(r,e),n.associations.set(r,t)}}return e[t]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const n=void 0===t.attributes.tangent,r=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new i.PointsMaterial,i.Material.prototype.copy.call(t,s),t.color.copy(s.color),t.map=s.map,t.sizeAttenuation=!1,this.cache.add(e,t)),s=t}else if(e.isLine){const e="LineBasicMaterial:"+s.uuid;let t=this.cache.get(e);t||(t=new i.LineBasicMaterial,i.Material.prototype.copy.call(t,s),t.color.copy(s.color),this.cache.add(e,t)),s=t}if(n||r||a){let e="ClonedMaterial:"+s.uuid+":";s.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),n&&(e+="derivative-tangents:"),r&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=s.clone(),r&&(t.vertexColors=!0),a&&(t.flatShading=!0),n&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(s))),s=t}s.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=s}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(e){const t=this,s=this.json,n=this.extensions,r=s.materials[e];let a;const o={},l=r.extensions||{},c=[];if(l[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=n[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];a=e.getMaterialType(),c.push(e.extendParams(o,r,t))}else if(l[u.KHR_MATERIALS_UNLIT]){const e=n[u.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,r,t))}else{const s=r.pbrMetallicRoughness||{};if(o.color=new i.Color(1,1,1),o.opacity=1,Array.isArray(s.baseColorFactor)){const e=s.baseColorFactor;o.color.fromArray(e),o.opacity=e[3]}void 0!==s.baseColorTexture&&c.push(t.assignTexture(o,"map",s.baseColorTexture)),o.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,o.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(c.push(t.assignTexture(o,"metalnessMap",s.metallicRoughnessTexture)),c.push(t.assignTexture(o,"roughnessMap",s.metallicRoughnessTexture))),a=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===r.doubleSided&&(o.side=i.DoubleSide);const h=r.alphaMode||"OPAQUE";if("BLEND"===h?(o.transparent=!0,o.depthWrite=!1):(o.format=i.RGBFormat,o.transparent=!1,"MASK"===h&&(o.alphaTest=void 0!==r.alphaCutoff?r.alphaCutoff:.5)),void 0!==r.normalTexture&&a!==i.MeshBasicMaterial&&(c.push(t.assignTexture(o,"normalMap",r.normalTexture)),o.normalScale=new i.Vector2(1,1),void 0!==r.normalTexture.scale)){const e=r.normalTexture.scale;o.normalScale.set(e,e)}return void 0!==r.occlusionTexture&&a!==i.MeshBasicMaterial&&(c.push(t.assignTexture(o,"aoMap",r.occlusionTexture)),void 0!==r.occlusionTexture.strength&&(o.aoMapIntensity=r.occlusionTexture.strength)),void 0!==r.emissiveFactor&&a!==i.MeshBasicMaterial&&(o.emissive=(new i.Color).fromArray(r.emissiveFactor)),void 0!==r.emissiveTexture&&a!==i.MeshBasicMaterial&&c.push(t.assignTexture(o,"emissiveMap",r.emissiveTexture)),Promise.all(c).then((function(){let s;return s=a===A?n[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new a(o),r.name&&(s.name=r.name),s.map&&(s.map.encoding=i.sRGBEncoding),s.emissiveMap&&(s.emissiveMap.encoding=i.sRGBEncoding),V(s,r),t.associations.set(s,{materials:e}),r.extensions&&D(n,s,r),s}))}createUniqueName(e){const t=i.PropertyBinding.sanitizeNodeName(e||"");let s=t;for(let e=1;this.nodeNamesUsed[s];++e)s=t+"_"+e;return this.nodeNamesUsed[s]=!0,s}loadGeometries(e){const t=this,s=this.extensions,n=this.primitiveCache;function r(e){return s[u.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(s){return z(s,e,t)}))}const a=[];for(let s=0,o=e.length;s0&&G(d,r),d.name=t.createUniqueName(r.name||"mesh_"+e),V(d,r),h.extensions&&D(n,d,h),t.assignFinalMaterial(d),c.push(d)}for(let s=0,n=c.length;s1?new i.Group:1===t.length?t[0]:new i.Object3D,o!==t[0])for(let e=0,s=t.length;e{const t=new Map;for(const[e,s]of r.associations)(e instanceof i.Material||e instanceof i.Texture)&&t.set(e,s);return e.traverse((e=>{const s=r.associations.get(e);null!=s&&t.set(e,s)})),t})(a),a}))}}function q(e,t,s,n){const r=s.nodes[e];return n.getDependency("node",e).then((function(e){if(void 0===r.skin)return e;let t;return n.getDependency("skin",r.skin).then((function(e){t=e;const s=[];for(let e=0,r=t.joints.length;e1)throw new Error;this.alpha=e}},{key:"filter",value:function(e,t,s){var n;return s&&this.setAlpha(s),n=this.y?this.alpha*e+(1-this.alpha)*this.s:e,this.y=e,this.s=n,n}},{key:"lastValue",value:function(){return this.y}}]),t}(),Z=function(){function t(s){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e(this,t),s<=0||n<=0||i<=0)throw new Error;this.freq=s,this.minCutOff=n,this.beta=r,this.dCutOff=i,this.x=new Y(this.alpha(this.minCutOff)),this.dx=new Y(this.alpha(this.dCutOff)),this.lasttime=null,this.currValue=0,this.prevValue=this.currValue}return s(t,[{key:"alpha",value:function(e){var t=1/this.freq;return 1/(1+1/(2*Math.PI*e)/t)}},{key:"UpdateParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.freq=e,this.minCutOff=t,this.beta=s,this.dCutOff=n,this.x.setAlpha(this.alpha(this.minCutOff)),this.dx.setAlpha(this.alpha(this.dCutOff))}},{key:"Filter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.prevValue=this.currValue,this.lasttime&&t&&(this.freq=1/(t-this.lasttime)),this.lasttime=t;var s=this.x.lastValue(),n=s?(e-s)*this.freq:0,r=this.dx.filter(n,t,this.alpha(this.dCutOff)),i=this.minCutOff+this.beta*Math.abs(r);return this.currValue=this.x.filter(e,t,this.alpha(i))}}]),t}(),Q=function(){function t(s){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;e(this,t),this.currValue=new i.Vector3,this.prevValue=new i.Vector3,this._freq=s,this._mincutoff=n,this._beta=r,this._dcutoff=a,this.oneEuroFilters=[],this.oneEuroFilters.push(new Z(s,n,r,a)),this.oneEuroFilters.push(new Z(s,n,r,a)),this.oneEuroFilters.push(new Z(s,n,r,a))}return s(t,[{key:"freq",get:function(){return this._freq}},{key:"beta",get:function(){return this._beta}},{key:"dcutoff",get:function(){return this._dcutoff}},{key:"mincutoff_1",get:function(){return this._mincutoff}},{key:"UpdateParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this._freq=e,this._mincutoff=t,this._beta=s,this._dcutoff=n;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:-1;this.prevValue=this.currValue;var s=new i.Vector3,n=s.toArray(),r=e.toArray();this.oneEuroFilters.forEach((function(e,s){n[s]=e.Filter(r[s],t)}));var a=new i.Vector3;return this.currValue=a.fromArray(n)}}]),t}(),J=function(){function t(s){e(this,t),this._timeOut=s,this._inDelay=!1}return s(t,[{key:"Update",value:function(e){var t=Math.floor(Date.now()/1e3);return this._inDelay||(this._prevTime=t,this._totalTime=0),this._totalTime+=t-this._prevTime,this._inDelay&&this._totalTime>this._timeOut?(this._inDelay=!1,!0):e?(this._inDelay=!0,!1):(this._inDelay=!1,!1)}}]),t}(),$=function(){function t(){e(this,t),this._hasFound=!1,this._frameDrops=0,this._deltaAccuracy=10,this.filterFrequency=30,this.filterMinCutoff=1,this.filterBeta=0,this.filterDcutoff=1,this.delayEnterCheck=new J(2),this.delayExitCheck=new J(0),this._positionFilter=new Q(this.filterFrequency),this._rotationFilter=new Q(2*this.filterFrequency)}return s(t,[{key:"update",value:function(e){var t=new i.Vector3,s=new i.Vector3,n=new i.Vector3;if(e){var r=(new i.Matrix4).fromArray(this.getArrayMatrix(e));if(this._hasFound){var a=(new i.Vector3).setFromMatrixPosition(r);if(Math.abs(a.distanceTo(this._lastTranslation))>this._deltaAccuracy)return this._frameDrops+=1,this._frameDrops>3&&(this._lastTranslation=a),[t,s,n];this._frameDrops=0,this._lastTranslation=a}else{this._hasFound=!0;var o=new i.Vector3;this._lastTranslation=o.setFromMatrixPosition(r)}this._positionFilter.UpdateParams(this.filterFrequency,this.filterMinCutoff,this.filterBeta,this.filterDcutoff),this._rotationFilter.UpdateParams(2*this.filterFrequency,this.filterMinCutoff,this.filterBeta,this.filterDcutoff),new i.Matrix4;var l=new i.Quaternion,c=new i.Euler,u=new i.Vector3(0,0,0);r.decompose(u,l,n);var h=c.setFromQuaternion(l);s=this._rotationFilter.Filter(h.toVector3()),t=this._positionFilter.Filter(u)}else this._hasFound=!1,this._frameDrops=0;return[t,s,n]}},{key:"getArrayMatrix",value:function(e){var t=[];for(var s in e)t[s]=e[s];return t}}]),t}(),ee=function(){function t(s){e(this,t),this.entities=[],this.scene=o.getGlobalScene(),this.target=window||n.g,this.uuid=s,this.names=[],this._filter=new $,this._oef=!1}return s(t,[{key:"add",value:function(e,t,s){var n=this;this.target.addEventListener("getNFTData-"+this.uuid+"-"+t,(function(t){var s=t.detail;e.position.y=s.height/s.dpi*2.54*10/2,e.position.x=s.width/s.dpi*2.54*10/2}));var r=new i.Object3D;r.name="root-"+t,this.scene.add(r),r.add(e),this.target.addEventListener("getMatrixGL_RH-"+this.uuid+"-"+t,(function(t){if(r.visible=!0,e.visible=!0,!0===n._oef){var s=(new i.Vector3(0,0,0),new i.Vector3(0,0,0),new i.Vector3(0,0,0));s=n._filter.update(t.detail.matrixGL_RH),r.position.setX(s[0].x),r.position.setY(s[0].y),r.position.setZ(s[0].z),r.rotation.setFromVector3(s[1]),r.scale.setX(s[2].x),r.scale.setY(s[2].y),r.scale.setZ(s[2].z)}else{r.matrixAutoUpdate=!1;var o=a.interpolate(t.detail.matrixGL_RH);a.setMatrix(r.matrix,o)}})),this.target.addEventListener("nftTrackingLost-"+this.uuid+"-"+t,(function(t){r.visible=s,e.visible=s})),this.names.push(t),this.entities.push({name:t})}},{key:"addModel",value:function(e,t,s,n){var r,o=this,c=new i.Object3D;c.name="root-"+t,this.scene.add(c),(new l).load(e,(function(e){(r=e.scene).scale.set(s,s,s),r.rotation.x=Math.PI/2,o.target.addEventListener("getNFTData-"+o.uuid+"-"+t,(function(e){var t=e.detail;r.position.y=t.height/t.dpi*2.54*10/2,r.position.x=t.width/t.dpi*2.54*10/2})),c.add(r)})),this.target.addEventListener("getMatrixGL_RH-"+this.uuid+"-"+t,(function(e){if(c.visible=!0,r.visible=!0,!0===o._oef){var t=(new i.Vector3(0,0,0),new i.Vector3(0,0,0),new i.Vector3(0,0,0));t=o._filter.update(e.detail.matrixGL_RH),c.position.setX(t[0].x),c.position.setY(t[0].y),c.position.setZ(t[0].z),c.rotation.setFromVector3(t[1]),c.scale.setX(t[2].x),c.scale.setY(t[2].y),c.scale.setZ(t[2].z)}else{c.matrixAutoUpdate=!1;var s=a.interpolate(e.detail.matrixGL_RH);a.setMatrix(c.matrix,s)}})),this.target.addEventListener("nftTrackingLost-"+this.uuid+"-"+t,(function(e){c.visible=n,r.visible=n})),this.names.push(t)}},{key:"addModelWithCallback",value:function(e,t,s,n){var r,o=this,c=new i.Object3D;c.name="root-"+t,this.scene.add(c),(new l).load(e,(function(e){r=e.scene,o.target.addEventListener("getNFTData-"+o.uuid+"-"+t,(function(e){var t=e.detail;r.position.y=t.height/t.dpi*2.54*10/2,r.position.x=t.width/t.dpi*2.54*10/2})),s(e),c.add(r)})),this.target.addEventListener("getMatrixGL_RH-"+this.uuid+"-"+t,(function(e){if(c.visible=!0,r.visible=!0,!0===o._oef){var t=(new i.Vector3(0,0,0),new i.Vector3(0,0,0),new i.Vector3(0,0,0));t=o._filter.update(e.detail.matrixGL_RH),c.position.setX(t[0].x),c.position.setY(t[0].y),c.position.setZ(t[0].z),c.rotation.setFromVector3(t[1]),c.scale.setX(t[2].x),c.scale.setY(t[2].y),c.scale.setZ(t[2].z)}else{c.matrixAutoUpdate=!1;var s=a.interpolate(e.detail.matrixGL_RH);a.setMatrix(c.matrix,s)}})),this.target.addEventListener("nftTrackingLost-"+this.uuid+"-"+t,(function(e){c.visible=n,r.visible=n})),this.names.push(t)}},{key:"addImage",value:function(e,t,s,n,r,o){var l=this,c=new i.Object3D;c.name="root-"+t,this.scene.add(c);var u=new i.PlaneGeometry(r.w,r.h,r.ws,r.hs),h=(new i.TextureLoader).load(e),d=new i.MeshStandardMaterial({color:s,map:h}),p=new i.Mesh(u,d);p.scale.set(n,n,n),this.target.addEventListener("getNFTData-"+this.uuid+"-"+t,(function(e){var t=e.detail;p.position.y=t.height/t.dpi*2.54*10/2,p.position.x=t.width/t.dpi*2.54*10/2})),c.add(p),this.target.addEventListener("getMatrixGL_RH-"+this.uuid+"-"+t,(function(e){if(c.visible=!0,p.visible=!0,!0===l._oef){var t=(new i.Vector3(0,0,0),new i.Vector3(0,0,0),new i.Vector3(0,0,0));t=l._filter.update(e.detail.matrixGL_RH),c.position.setX(t[0].x),c.position.setY(t[0].y),c.position.setZ(t[0].z),c.rotation.setFromVector3(t[1]),c.scale.setX(t[2].x),c.scale.setY(t[2].y),c.scale.setZ(t[2].z)}else{c.matrixAutoUpdate=!1;var s=a.interpolate(e.detail.matrixGL_RH);a.setMatrix(c.matrix,s)}})),this.target.addEventListener("nftTrackingLost-"+this.uuid+"-"+t,(function(e){c.visible=o,p.visible=o})),this.names.push(t)}},{key:"addVideo",value:function(e,t,s,n,r){var o=this,l=new i.Object3D;l.name="root-"+t,this.scene.add(l);var c=document.getElementById(e),u=new i.VideoTexture(c),h=new i.MeshStandardMaterial({color:12303359,map:u});c.play();var d=new i.PlaneGeometry(n.w,n.h,n.ws,n.hs),p=new i.Mesh(d,h);p.scale.set(s,s,s),this.target.addEventListener("getNFTData-"+this.uuid+"-"+t,(function(e){var t=e.detail;p.position.y=t.height/t.dpi*2.54*10/2,p.position.x=t.width/t.dpi*2.54*10/2})),l.add(p),this.target.addEventListener("getMatrixGL_RH-"+this.uuid+"-"+t,(function(e){if(l.visible=!0,p.visible=!0,!0===o._oef){var t=(new i.Vector3(0,0,0),new i.Vector3(0,0,0),new i.Vector3(0,0,0));t=o._filter.update(e.detail.matrixGL_RH),l.position.setX(t[0].x),l.position.setY(t[0].y),l.position.setZ(t[0].z),l.rotation.setFromVector3(t[1]),l.scale.setX(t[2].x),l.scale.setY(t[2].y),l.scale.setZ(t[2].z)}else{l.matrixAutoUpdate=!1;var s=a.interpolate(e.detail.matrixGL_RH);a.setMatrix(l.matrix,s)}})),this.target.addEventListener("nftTrackingLost-"+this.uuid+"-"+t,(function(e){l.visible=r,p.visible=r})),this.names.push(t)}},{key:"getNames",value:function(){return this.names}},{key:"oef",get:function(){return this._oef},set:function(e){this._oef=e}}]),t}();const te={SceneRendererTJS:o,NFTaddTJS:ee}})(),r.default})()})); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQVJuZnRUaHJlZWpzLmpzIiwibWFwcGluZ3MiOiJDQUFBLFNBQTJDQSxFQUFNQyxHQUMxQixpQkFBWkMsU0FBMEMsaUJBQVhDLE9BQ3hDQSxPQUFPRCxRQUFVRCxFQUFRRyxRQUFRLFVBQ1IsbUJBQVhDLFFBQXlCQSxPQUFPQyxJQUM5Q0QsT0FBTyxDQUFDLFNBQVVKLEdBQ1EsaUJBQVpDLFFBQ2RBLFFBQXNCLGFBQUlELEVBQVFHLFFBQVEsVUFFMUNKLEVBQW1CLGFBQUlDLEVBQVFELEVBQVksT0FSN0MsQ0FTR08sTUFBTSxTQUFTQyxHQUNsQixNLGtDQ1ZBTCxFQUFPRCxRQUFVTSxJQ0NiQyxFQUEyQixHQUcvQixTQUFTQyxFQUFvQkMsR0FFNUIsSUFBSUMsRUFBZUgsRUFBeUJFLEdBQzVDLFFBQXFCRSxJQUFqQkQsRUFDSCxPQUFPQSxFQUFhVixRQUdyQixJQUFJQyxFQUFTTSxFQUF5QkUsR0FBWSxDQUdqRFQsUUFBUyxJQU9WLE9BSEFZLEVBQW9CSCxHQUFVUixFQUFRQSxFQUFPRCxRQUFTUSxHQUcvQ1AsRUFBT0QsUUNwQmZRLEVBQW9CSyxFQUFJLENBQUNiLEVBQVNjLEtBQ2pDLElBQUksSUFBSUMsS0FBT0QsRUFDWE4sRUFBb0JRLEVBQUVGL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biAgICAgICAgICAgIGFycmF5W2tleV0gPSB2YWx1ZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgbWF0cml4LmVsZW1lbnRzLnNldCA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICBtYXRyaXguZWxlbWVudHMuc2V0KGFycmF5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1hdHJpeC5lbGVtZW50cyA9IFtdLnNsaWNlLmNhbGwoYXJyYXkpO1xuICAgICAgICB9XG4gICAgfVxufVxuIiwiaW1wb3J0ICogYXMgVEhSRUUgZnJvbSBcInRocmVlXCI7XG5pbXBvcnQgeyBVdGlscyB9IGZyb20gXCIuL3V0aWxzL1V0aWxzXCI7XG5cbmludGVyZmFjZSBDb25maWdEYXRhIHtcbiAgICBjYW1lcmE6IHtcbiAgICAgICAgZmFyOiBudW1iZXI7XG4gICAgICAgIGZvdjogbnVtYmVyO1xuICAgICAgICBtYXRyaXhBdXRvVXBkYXRlOiBib29sZWFuO1xuICAgICAgICBuZWFyOiBudW1iZXI7XG4gICAgICAgIHJhdGlvOiBudW1iZXI7XG4gICAgfTtcbiAgICByZW5kZXJlcjoge1xuICAgICAgICBhbHBoYTogYm9vbGVhbjtcbiAgICAgICAgYW50aWFsaWFzOiBib29sZWFuO1xuICAgICAgICBjb250ZXh0OiBhbnk7XG4gICAgICAgIGRlcHRoOiBib29sZWFuO1xuICAgICAgICBsb2dhcml0aG1pY0RlcHRoQnVmZmVyOiBib29sZWFuO1xuICAgICAgICBwcmVjaXNpb246IHN0cmluZztcbiAgICAgICAgc3RlbmNpbDogYm9vbGVhbjtcbiAgICAgICAgcHJlbXVsdGlwbGllZEFscGhhOiBib29sZWFuO1xuICAgICAgICBvYmpWaXNpYmlsaXR5OiBib29sZWFuO1xuICAgIH07XG59XG5cbmludGVyZmFjZSBSb290IGV4dGVuZHMgVEhSRUUuT2JqZWN0M0Qge1xuICAgIC8vbWF0cml4OiBvY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sZXQgdmVjVHJhbnM6IFZlY3RvcjMgPSBuZXcgVmVjdG9yMygpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2xhc3RUcmFuc2xhdGlvbiA9IHZlY1RyYW5zLnNldEZyb21NYXRyaXhQb3NpdGlvbih3b3JsZE1hdHJpeCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCB2ZWNUcmFuczogVmVjdG9yMyA9IG5ldyBWZWN0b3IzKCk7XG4gICAgICAgICAgICAgICAgbGV0IF9jdXJyZW50VHJhbnNsYXRpb246IFZlY3RvcjMgPSB2ZWNUcmFucy5zZXRGcm9tTWF0cml4UG9zaXRpb24od29ybGRNYXRyaXgpO1xuICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhfY3VycmVudFRyYW5zbGF0aW9uLmRpc3RhbmNlVG8odGhpcy5fbGFzdFRyYW5zbGF0aW9uKSkgPiB0aGlzLl9kZWx0YUFjY3VyYWN5KSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lRHJvcHMgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2ZyYW1lRHJvcHMgPiAzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9sYXN0VHJhbnNsYXRpb24gPSBfY3VycmVudFRyYW5zbGF0aW9uO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbcG9zLCByb3RhdGlvblZlYywgc2NhbGVdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZURyb3BzID0gMDtcbiAgICAgICAgICAgICAgICB0aGlzLl9sYXN0VHJhbnNsYXRpb24gPSBfY3VycmVudFRyYW5zbGF0aW9uO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fcG9zaXRpb25GaWx0ZXIuVXBkYXRlUGFyYW1zKFxuICAgICAgICAgICAgICAgIHRoa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pIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsIDAsIDApLCBuZXcgVmVjdG9yMygwLCAwLCAwKSwgbmV3IFZlY3RvcjMoMCwgMCwgMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICA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wgMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICA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UoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW5lcihcIm5mdFRyYWNraW5nTG9zdC1cIiArIHRoaXMudXVpZCArIFwiLVwiICsgbmFtZSwgKGV2OiBhbnkpID0+IHtcbiAgICAgICAgICAgIHJvb3QudmlzaWJsZSA9IG9ialZpc2liaWxpdHk7XG4gICAgICAgICAgICBtb2RlbC52aXNpYmxlID0gb2JqVmlzaWJpbGl0eTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRoaXMubmFtZXMucHVzaChuYW1lKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKi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bbmV3IFZlY3RvcjMoMCwgMCwgMCksIG5ldyBWZWN0b3IzKDAsIDAsIDApLCBuZXcgVmVjdG9yMygwLCAwLCAwKV07XG4gICAgICAgICAgICAgICAgZmlsdGVyID0gdGhpcy5fZmlsdGVyLnVwZGF0ZShldi5kZXRhaWwubWF0cml4R0xfUkgpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WChmaWx0ZXJbMF0ueCk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRZKGZpbHRlclswXS55KTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFooZmlsdGVyWzBdLnopO1xuICAgICAgICAgICAgICAgIHJvb3Qucm90YXRpb24uc2V0RnJvbVZlY3RvcjMoZmlsdGVyWzFdKTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFgoZmlsdGVyWzJdLngpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WShmaWx0ZXJbMl0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRaKGZpbHRlclsyXS56KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm9vdC5tYXRyaXhBdXRvVXBkYXRlID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgY29uc3QgbWF0cml4ID0gVXRpbHMuaW50ZXJwb2xhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICBVdGlscy5zZXRNYXRyaXgocm9vdC5tYXRyaXgsIG1hdHJpeCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnRhcmdldC5hZGRFdmVudExpc3RlbmVyKFwibmZ0VHJhY2tpbmdMb3N0LVwiICsgdGhpcy51dWlkICsgXCItXCIgKyBuYW1lLCAoZXY6IGFueSkgPT4ge1xuICAgICAgICAgICAgcm9vdC52aXNpYmxlID0gb2JqVmlzaWJpb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IHRydWU7XG4gICAgICAgICAgICBwbGFuZS52aXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0aGlzLl9vZWYgPT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyID0gW25ldyBWZWN0b3IzKDAsIDAsIDApLCBuZXcgVmVjdG9yMygwLCAwLCAwKSwgbmV3IFZlY3RvcjMoMCwgMCwgMCldO1xuICAgICAgICAgICAgICAgIGZpbHRlciA9IHRoaXMuX2ZpbHRlci51cGRhdGUoZXYuZGV0YWlsLm1hdHJpeEdMX1JIKTtcbiAgICAgICAgICAgICAgICByb290LnBvc2l0aW9uLnNldFgoZmlsdGVyWzBdLngpO1xuICAgICAgICAgICAgICAgIHJvb3QucG9zaXRpb24uc2V0WShmaWx0ZXJbMF0ueSk7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3NpdGlvbi5zZXRaKGZpbHRlclswXS56KTtcbiAgICAgICAgICAgICAgICByb290LnJvdGF0aW9uLnNldEZyb21WZWN0b3IzKGZpbHRlclsxXSk7XG4gICAgICAgICAgICAgICAgcm9vdC5zY2FsZS5zZXRYKGZpbHRlclsyXS54KTtcbiAgICAgICAgICAgICAgICByb290LnNjYWxlLnNldFkoZmlsdGVyWzJdLnkpO1xuICAgICAgICAgICAgICAgIHJvb3Quc2NhbGUuc2V0WihmaWx0ZXJbMl0ueik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvb3QubWF0cml4QXV0b1VwZGF0ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdHJpeCA9IFV0aWxzLmludGVycG9sYXRlKGV2LmRldGFpbC5tYXRyaXhHTF9SSCk7XG4gICAgICAgICAgICAgICAgVXRpbHMuc2V0TWF0cml4KHJvb3QubWF0cml4LCBtYXRyaXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy50YXJnZXQuYWRkRXZlbnRMaXN0ZW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ibXNnIiwiZHBpIiwid2lkdGgiLCJ2aXNpYmxlIiwidXBkYXRlIiwibWF0cml4R0xfUkgiLCJ6Iiwic2V0RnJvbVZlY3RvcjMiLCJpbnRlcnBvbGF0ZSIsIm1vZGVsIiwiaW1hZ2VVcmwiLCJjb25maWdzIiwicGxhbmVHZW9tIiwiUGxhbmVHZW9tZXRyeSIsInciLCJoIiwid3MiLCJocyIsInBsYW5lIiwiQVJWaWRlbyIsImRvY3VtZW50IiwiZ2V0RWxlbWVudEJ5SWQiLCJWaWRlb1RleHR1cmUiLCJwbGF5IiwiZW5hYmxlIl0sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/package.json b/package.json index e7c1985..7f6dc89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@webarkit/arnft-threejs", - "version": "0.4.0", + "version": "0.4.5", "description": "The ARnft rendering engine, based on Three.js", "main": "dist/ARnftThreejs.js", "types": "types/index.d.ts", diff --git a/src/SceneRendererTJS.ts b/src/SceneRendererTJS.ts index 7172d32..77fe471 100644 --- a/src/SceneRendererTJS.ts +++ b/src/SceneRendererTJS.ts @@ -80,7 +80,7 @@ export default class SceneRendererTJS { } else { this.camera = new THREE.Camera(); } - this.version = "0.4.0"; + this.version = "0.4.5"; console.log("ARnftThreejs version: ", this.version); }