@realsee/five 6.0.0-alpha.70 → 6.0.0-alpha.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/five/index.js +17 -1708
- package/five/index.mjs +30416 -17367
- package/gltf-loader/index.js +2 -8
- package/gltf-loader/index.mjs +1977 -989
- package/line/index.js +2 -201
- package/line/index.mjs +447 -433
- package/package.json +1 -1
- package/react/index.js +2 -2
- package/react/index.mjs +934 -613
- package/sticker/index.js +2 -2
- package/sticker/index.mjs +156 -91
- package/umd/five-gltf-loader.js +2 -8
- package/umd/five-line.js +2 -201
- package/umd/five-react.js +2 -2
- package/umd/five-sticker.js +2 -2
- package/umd/five-vfx.js +2 -286
- package/umd/five-vue.js +2 -2
- package/umd/five.js +104 -1795
- package/vfx/index.js +2 -286
- package/vfx/index.mjs +530 -590
- package/vue/index.js +2 -2
- package/vue/index.mjs +370 -229
package/gltf-loader/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
4
|
* Generated: 12/20/2023
|
|
5
|
-
* Version: 6.0.0-alpha.
|
|
5
|
+
* Version: 6.0.0-alpha.71
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,10 +252,4 @@
|
|
|
252
252
|
* No amendment to or modification of this Agreement will be binding unless in
|
|
253
253
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
|
-
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("three");function Ge(p){const T=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const u in p)if(u!=="default"){const m=Object.getOwnPropertyDescriptor(p,u);Object.defineProperty(T,u,m.get?m:{enumerable:!0,get:()=>p[u]})}}return T.default=p,Object.freeze(T)}const we=Ge(c);var be=function(p,T){return be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,m){u.__proto__=m}||function(u,m){for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(u[g]=m[g])},be(p,T)};function xe(p,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");be(p,T);function u(){this.constructor=p}p.prototype=T===null?Object.create(T):(u.prototype=T.prototype,new u)}var Oe=function(){function p(e){c.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null}p.prototype=Object.assign(Object.create(c.Loader.prototype),{constructor:p,load:function(e,r,n,t){var a=this,i;this.resourcePath!==""?i=this.resourcePath:this.path!==""?i=this.path:i=c.LoaderUtils.extractUrlBase(e),a.manager.itemStart(e);var s=function(f){t?t(f):console.error(f),a.manager.itemError(e),a.manager.itemEnd(e)},o=new c.FileLoader(a.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),a.crossOrigin==="use-credentials"&&o.setWithCredentials(!0),o.load(e,function(f){try{a.parse(f,i,function(l){r(l),a.manager.itemEnd(e)},s)}catch(l){s(l)}},n,s)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(e,r,n,t){var a,i={};if(typeof e=="string")a=e;else{var s=c.LoaderUtils.decodeText(new Uint8Array(e,0,4));if(s===D){try{i[u.KHR_BINARY_GLTF]=new N(e)}catch(h){t&&t(h);return}a=i[u.KHR_BINARY_GLTF].content}else a=c.LoaderUtils.decodeText(new Uint8Array(e))}var o=JSON.parse(a);if(o.asset===void 0||o.asset.version[0]<2){t&&t(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}if(o.extensionsUsed)for(var f=0;f<o.extensionsUsed.length;++f){var l=o.extensionsUsed[f],v=o.extensionsRequired||[];switch(l){case u.KHR_LIGHTS_PUNCTUAL:i[l]=new g(o);break;case u.KHR_MATERIALS_CLEARCOAT:i[l]=new L;break;case u.KHR_MATERIALS_TRANSMISSION:i[l]=new O;break;case u.KHR_MATERIALS_UNLIT:i[l]=new A;break;case u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:i[l]=new V;break;case u.KHR_DRACO_MESH_COMPRESSION:i[l]=new x(o,this.dracoLoader);break;case u.MSFT_TEXTURE_DDS:i[l]=new m(this.ddsLoader);break;case u.KHR_TEXTURE_TRANSFORM:i[l]=new w;break;case u.KHR_MESH_QUANTIZATION:i[l]=new $;break;default:v.indexOf(l)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}var d=new I(o,i,{path:r||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});d.fileLoader.setRequestHeader(this.requestHeader),d.parse(n,t)}});function T(){var e={};return{get:function(r){return e[r]},add:function(r,n){e[r]=n},remove:function(r){delete e[r]},removeAll:function(){e={}}}}var 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_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function m(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=u.MSFT_TEXTURE_DDS,this.ddsLoader=e}function g(e){this.name=u.KHR_LIGHTS_PUNCTUAL;var r=e.extensions&&e.extensions[u.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=r.lights||[]}g.prototype.loadLight=function(e){var r=this.lightDefs[e],n,t=new c.Color(16777215);r.color!==void 0&&t.fromArray(r.color);var a=r.range!==void 0?r.range:0;switch(r.type){case"directional":n=new c.DirectionalLight(t),n.target.position.set(0,0,-1),n.add(n.target);break;case"point":n=new c.PointLight(t),n.distance=a;break;case"spot":n=new c.SpotLight(t),n.distance=a,r.spot=r.spot||{},r.spot.innerConeAngle=r.spot.innerConeAngle!==void 0?r.spot.innerConeAngle:0,r.spot.outerConeAngle=r.spot.outerConeAngle!==void 0?r.spot.outerConeAngle:Math.PI/4,n.angle=r.spot.outerConeAngle,n.penumbra=1-r.spot.innerConeAngle/r.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+r.type+'".')}return n.position.set(0,0,0),n.decay=2,r.intensity!==void 0&&(n.intensity=r.intensity),n.name=r.name||"light_"+e,Promise.resolve(n)};function A(){this.name=u.KHR_MATERIALS_UNLIT}A.prototype.getMaterialType=function(){return c.MeshBasicMaterial},A.prototype.extendParams=function(e,r,n){var t=[];e.color=new c.Color(1,1,1),e.opacity=1;var a=r.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){var i=a.baseColorFactor;e.color.fromArray(i),e.opacity=i[3]}a.baseColorTexture!==void 0&&t.push(n.assignTexture(e,"map",a.baseColorTexture))}return Promise.all(t)};function L(){this.name=u.KHR_MATERIALS_CLEARCOAT}L.prototype.getMaterialType=function(){return c.MeshPhysicalMaterial},L.prototype.extendParams=function(e,r,n){var t=[],a=r.extensions[this.name];if(a.clearcoatFactor!==void 0&&(e.clearcoat=a.clearcoatFactor),a.clearcoatTexture!==void 0&&t.push(n.assignTexture(e,"clearcoatMap",a.clearcoatTexture)),a.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=a.clearcoatRoughnessFactor),a.clearcoatRoughnessTexture!==void 0&&t.push(n.assignTexture(e,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),a.clearcoatNormalTexture!==void 0&&(t.push(n.assignTexture(e,"clearcoatNormalMap",a.clearcoatNormalTexture)),a.clearcoatNormalTexture.scale!==void 0)){var i=a.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new c.Vector2(i,i)}return Promise.all(t)};function O(){this.name=u.KHR_MATERIALS_TRANSMISSION}O.prototype.getMaterialType=function(){return c.MeshPhysicalMaterial},O.prototype.extendParams=function(e,r,n){var t=[],a=r.extensions[this.name];return a.transmissionFactor!==void 0&&(e.premultipliedAlpha=!0,e.transparent=!0,e.opacity=1,e.transparency=a.transmissionFactor,(e.map||e.color.r*e.color.g*e.color.b<.99)&&(e.transparency*=.75)),Promise.all(t)};var D="glTF",M=12,C={JSON:1313821514,BIN:5130562};function N(e){this.name=u.KHR_BINARY_GLTF,this.content=null,this.body=null;var r=new DataView(e,0,M);if(this.header={magic:c.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==D)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var n=new DataView(e,M),t=0;t<n.byteLength;){var a=n.getUint32(t,!0);t+=4;var i=n.getUint32(t,!0);if(t+=4,i===C.JSON){var s=new Uint8Array(e,M+t,a);this.content=c.LoaderUtils.decodeText(s)}else if(i===C.BIN){var o=M+t;this.body=e.slice(o,o+a)}t+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}function x(e,r){if(!r)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=u.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=r,this.dracoLoader.preload()}x.prototype.decodePrimitive=function(e,r){var n=this.json,t=this.dracoLoader,a=e.extensions[this.name].bufferView,i=e.extensions[this.name].attributes,s={},o={},f={};for(var l in i){var v=j[l]||l.toLowerCase();s[v]=i[l]}for(l in e.attributes){var v=j[l]||l.toLowerCase();if(i[l]!==void 0){var d=n.accessors[e.attributes[l]],h=ee[d.componentType];f[v]=h,o[v]=d.normalized===!0}}return r.getDependency("bufferView",a).then(function(y){return new Promise(function(_){t.decodeDracoFile(y,function(S){for(var R in S.attributes){var E=S.attributes[R],F=o[R];F!==void 0&&(E.normalized=F)}_(S)},s,f)})})};function w(){this.name=u.KHR_TEXTURE_TRANSFORM}w.prototype.extendTexture=function(e,r){return e=e.clone(),r.offset!==void 0&&e.offset.fromArray(r.offset),r.rotation!==void 0&&(e.rotation=r.rotation),r.scale!==void 0&&e.repeat.fromArray(r.scale),r.texCoord!==void 0&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e};function b(e){c.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var r=["#ifdef USE_SPECULARMAP"," uniform sampler2D specularMap;","#endif"].join(`
|
|
256
|
-
`),n=["#ifdef USE_GLOSSINESSMAP"," uniform sampler2D glossinessMap;","#endif"].join(`
|
|
257
|
-
`),t=["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(`
|
|
258
|
-
`),a=["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(`
|
|
259
|
-
`),i=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join(`
|
|
260
|
-
`),s={specular:{value:new c.Color().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(o){for(var f in s)o.uniforms[f]=s[f];o.fragmentShader=o.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),o.fragmentShader=o.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),o.fragmentShader=o.fragmentShader.replace("#include <roughnessmap_pars_fragment>",r),o.fragmentShader=o.fragmentShader.replace("#include <metalnessmap_pars_fragment>",n),o.fragmentShader=o.fragmentShader.replace("#include <roughnessmap_fragment>",t),o.fragmentShader=o.fragmentShader.replace("#include <metalnessmap_fragment>",a),o.fragmentShader=o.fragmentShader.replace("#include <lights_physical_fragment>",i)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(o){s.specular.value=o}},specularMap:{get:function(){return s.specularMap.value},set:function(o){s.specularMap.value=o}},glossiness:{get:function(){return s.glossiness.value},set:function(o){s.glossiness.value=o}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(o){s.glossinessMap.value=o,o?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}b.prototype=Object.create(c.MeshStandardMaterial.prototype),b.prototype.constructor=b,b.prototype.copy=function(e){return c.MeshStandardMaterial.prototype.copy.call(this,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};function V(){return{name:u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,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:function(){return b},extendParams:function(e,r,n){var t=r.extensions[this.name];e.color=new c.Color(1,1,1),e.opacity=1;var a=[];if(Array.isArray(t.diffuseFactor)){var i=t.diffuseFactor;e.color.fromArray(i),e.opacity=i[3]}if(t.diffuseTexture!==void 0&&a.push(n.assignTexture(e,"map",t.diffuseTexture)),e.emissive=new c.Color(0,0,0),e.glossiness=t.glossinessFactor!==void 0?t.glossinessFactor:1,e.specular=new c.Color(1,1,1),Array.isArray(t.specularFactor)&&e.specular.fromArray(t.specularFactor),t.specularGlossinessTexture!==void 0){var s=t.specularGlossinessTexture;a.push(n.assignTexture(e,"glossinessMap",s)),a.push(n.assignTexture(e,"specularMap",s))}return Promise.all(a)},createMaterial:function(e){var r=new b(e);return r.fog=!0,r.color=e.color,r.map=e.map===void 0?null:e.map,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=e.aoMap===void 0?null:e.aoMap,r.aoMapIntensity=1,r.emissive=e.emissive,r.emissiveIntensity=1,r.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,r.bumpMap=e.bumpMap===void 0?null:e.bumpMap,r.bumpScale=1,r.normalMap=e.normalMap===void 0?null:e.normalMap,r.normalMapType=c.TangentSpaceNormalMap,e.normalScale&&(r.normalScale=e.normalScale),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.specularMap=e.specularMap===void 0?null:e.specularMap,r.specular=e.specular,r.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,r.glossiness=e.glossiness,r.alphaMap=null,r.envMap=e.envMap===void 0?null:e.envMap,r.envMapIntensity=1,r.refractionRatio=.98,r}}}function $(){this.name=u.KHR_MESH_QUANTIZATION}function P(e,r,n,t){c.Interpolant.call(this,e,r,n,t)}P.prototype=Object.create(c.Interpolant.prototype),P.prototype.constructor=P,P.prototype.copySampleValue_=function(e){for(var r=this.resultBuffer,n=this.sampleValues,t=this.valueSize,a=e*t*3+t,i=0;i!==t;i++)r[i]=n[a+i];return r},P.prototype.beforeStart_=P.prototype.copySampleValue_,P.prototype.afterEnd_=P.prototype.copySampleValue_,P.prototype.interpolate_=function(e,r,n,t){for(var a=this.resultBuffer,i=this.sampleValues,s=this.valueSize,o=s*2,f=s*3,l=t-r,v=(n-r)/l,d=v*v,h=d*v,y=e*f,_=y-f,S=-2*h+3*d,R=h-d,E=1-S,F=R-d+v,G=0;G!==s;G++){var te=i[_+G+s],ne=i[_+G+o]*l,Q=i[y+G+s],B=i[y+G]*l;a[G]=E*te+F*ne+S*Q+R*B}return a};var H={FLOAT:5126,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},ee={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},re={9728:c.NearestFilter,9729:c.LinearFilter,9984:c.NearestMipmapNearestFilter,9985:c.LinearMipmapNearestFilter,9986:c.NearestMipmapLinearFilter,9987:c.LinearMipmapLinearFilter},J={33071:c.ClampToEdgeWrapping,33648:c.MirroredRepeatWrapping,10497:c.RepeatWrapping},W={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},X={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},ge={CUBICSPLINE:void 0,LINEAR:c.InterpolateLinear,STEP:c.InterpolateDiscrete},ie={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},fe={"image/png":c.RGBAFormat,"image/jpeg":c.RGBFormat};function de(e,r){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(r)&&/^\//.test(e)&&(r=r.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:r+e)}function me(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new c.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:c.FrontSide})),e.DefaultMaterial}function se(e,r,n){for(var t in n.extensions)e[t]===void 0&&(r.userData.gltfExtensions=r.userData.gltfExtensions||{},r.userData.gltfExtensions[t]=n.extensions[t])}function Y(e,r){r.extras!==void 0&&(typeof r.extras=="object"?Object.assign(e.userData,r.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+r.extras))}function Ae(e,r,n){for(var t=!1,a=!1,i=0,s=r.length;i<s;i++){var o=r[i];if(o.POSITION!==void 0&&(t=!0),o.NORMAL!==void 0&&(a=!0),t&&a)break}if(!t&&!a)return Promise.resolve(e);for(var f=[],l=[],i=0,s=r.length;i<s;i++){var o=r[i];if(t){var v=o.POSITION!==void 0?n.getDependency("accessor",o.POSITION):e.attributes.position;f.push(v)}if(a){var v=o.NORMAL!==void 0?n.getDependency("accessor",o.NORMAL):e.attributes.normal;l.push(v)}}return Promise.all([Promise.all(f),Promise.all(l)]).then(function(d){var h=d[0],y=d[1];return t&&(e.morphAttributes.position=h),a&&(e.morphAttributes.normal=y),e.morphTargetsRelative=!0,e})}function Se(e,r){if(e.updateMorphTargets(),r.weights!==void 0)for(var n=0,t=r.weights.length;n<t;n++)e.morphTargetInfluences[n]=r.weights[n];if(r.extras&&Array.isArray(r.extras.targetNames)){var a=r.extras.targetNames;if(e.morphTargetInfluences.length===a.length){e.morphTargetDictionary={};for(var n=0,t=a.length;n<t;n++)e.morphTargetDictionary[a[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function ye(e){var r=e.extensions&&e.extensions[u.KHR_DRACO_MESH_COMPRESSION],n;return r?n="draco:"+r.bufferView+":"+r.indices+":"+U(r.attributes):n=e.indices+":"+U(e.attributes)+":"+e.mode,n}function U(e){for(var r="",n=Object.keys(e).sort(),t=0,a=n.length;t<a;t++)r+=n[t]+":"+e[n[t]]+";";return r}function I(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new T,this.associations=new Map,this.primitiveCache={},this.textureLoader=new c.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new c.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}I.prototype.parse=function(e,r){var n=this,t=this.json,a=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(i){var s={scene:i[0][t.scene||0],scenes:i[0],animations:i[1],cameras:i[2],asset:t.asset,parser:n,userData:{}};se(a,s,t),Y(s,t),e(s)}).catch(r)},I.prototype.markDefs=function(){for(var e=this.json.nodes||[],r=this.json.skins||[],n=this.json.meshes||[],t={},a={},i=0,s=r.length;i<s;i++)for(var o=r[i].joints,f=0,l=o.length;f<l;f++)e[o[f]].isBone=!0;for(var v=0,d=e.length;v<d;v++){var h=e[v];h.mesh!==void 0&&(t[h.mesh]===void 0&&(t[h.mesh]=a[h.mesh]=0),t[h.mesh]++,h.skin!==void 0&&(n[h.mesh].isSkinnedMesh=!0))}this.json.meshReferences=t,this.json.meshUses=a},I.prototype.getDependency=function(e,r){var n=e+":"+r,t=this.cache.get(n);if(!t){switch(e){case"scene":t=this.loadScene(r);break;case"node":t=this.loadNode(r);break;case"mesh":t=this.loadMesh(r);break;case"accessor":t=this.loadAccessor(r);break;case"bufferView":t=this.loadBufferView(r);break;case"buffer":t=this.loadBuffer(r);break;case"material":t=this.loadMaterial(r);break;case"texture":t=this.loadTexture(r);break;case"skin":t=this.loadSkin(r);break;case"animation":t=this.loadAnimation(r);break;case"camera":t=this.loadCamera(r);break;case"light":t=this.extensions[u.KHR_LIGHTS_PUNCTUAL].loadLight(r);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,t)}return t},I.prototype.getDependencies=function(e){var r=this.cache.get(e);if(!r){var n=this,t=this.json[e+(e==="mesh"?"es":"s")]||[];r=Promise.all(t.map(function(a,i){return n.getDependency(e,i)})),this.cache.add(e,r)}return r},I.prototype.loadBuffer=function(e){var r=this.json.buffers[e],n=this.fileLoader;if(r.type&&r.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+r.type+" buffer type is not supported.");if(r.uri===void 0&&e===0)return Promise.resolve(this.extensions[u.KHR_BINARY_GLTF].body);var t=this.options;return new Promise(function(a,i){n.load(de(r.uri,t.path),a,void 0,function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+r.uri+'".'))})})},I.prototype.loadBufferView=function(e){var r=this.json.bufferViews[e];return this.getDependency("buffer",r.buffer).then(function(n){var t=r.byteLength||0,a=r.byteOffset||0;return n.slice(a,a+t)})},I.prototype.loadAccessor=function(e){var r=this,n=this.json,t=this.json.accessors[e];if(t.bufferView===void 0&&t.sparse===void 0)return Promise.resolve(null);var a=[];return t.bufferView!==void 0?a.push(this.getDependency("bufferView",t.bufferView)):a.push(null),t.sparse!==void 0&&(a.push(this.getDependency("bufferView",t.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",t.sparse.values.bufferView))),Promise.all(a).then(function(i){var s=i[0],o=W[t.type],f=ee[t.componentType],l=f.BYTES_PER_ELEMENT,v=l*o,d=t.byteOffset||0,h=t.bufferView!==void 0?n.bufferViews[t.bufferView].byteStride:void 0,y=t.normalized===!0,_,S;if(h&&h!==v){var R=Math.floor(d/h),E="InterleavedBuffer:"+t.bufferView+":"+t.componentType+":"+R+":"+t.count,F=r.cache.get(E);F||(_=new f(s,R*h,t.count*h/l),F=new c.InterleavedBuffer(_,h/l),r.cache.add(E,F)),S=new c.InterleavedBufferAttribute(F,o,d%h/l,y)}else s===null?_=new f(t.count*o):_=new f(s,d,t.count*o),S=new c.BufferAttribute(_,o,y);if(t.sparse!==void 0){var G=W.SCALAR,te=ee[t.sparse.indices.componentType],ne=t.sparse.indices.byteOffset||0,Q=t.sparse.values.byteOffset||0,B=new te(i[1],ne,t.sparse.count*G),oe=new f(i[2],Q,t.sparse.count*o);s!==null&&(S=new c.BufferAttribute(S.array.slice(),S.itemSize,S.normalized));for(var k=0,Ee=B.length;k<Ee;k++){var ae=B[k];if(S.setX(ae,oe[k*o]),o>=2&&S.setY(ae,oe[k*o+1]),o>=3&&S.setZ(ae,oe[k*o+2]),o>=4&&S.setW(ae,oe[k*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return S})},I.prototype.loadTexture=function(e){var r=this,n=this.json,t=this.options,a=this.textureLoader,i=self.URL||self.webkitURL,s=n.textures[e],o=s.extensions||{},f;o[u.MSFT_TEXTURE_DDS]?f=n.images[o[u.MSFT_TEXTURE_DDS].source]:f=n.images[s.source];var l=f.uri,v=!1;return f.bufferView!==void 0&&(l=r.getDependency("bufferView",f.bufferView).then(function(d){v=!0;var h=new Blob([d],{type:f.mimeType});return l=i.createObjectURL(h),l})),Promise.resolve(l).then(function(d){var h=t.manager.getHandler(d);return h||(h=o[u.MSFT_TEXTURE_DDS]?r.extensions[u.MSFT_TEXTURE_DDS].ddsLoader:a),new Promise(function(y,_){h.load(de(d,t.path),y,void 0,_)})}).then(function(d){v===!0&&i.revokeObjectURL(l),d.flipY=!1,s.name&&(d.name=s.name),f.mimeType in fe&&(d.format=fe[f.mimeType]);var h=n.samplers||{},y=h[s.sampler]||{};return d.magFilter=re[y.magFilter]||c.LinearFilter,d.minFilter=re[y.minFilter]||c.LinearMipmapLinearFilter,d.wrapS=J[y.wrapS]||c.RepeatWrapping,d.wrapT=J[y.wrapT]||c.RepeatWrapping,r.associations.set(d,{type:"textures",index:e}),d})},I.prototype.assignTexture=function(e,r,n){var t=this;return this.getDependency("texture",n.index).then(function(a){if(!a.isCompressedTexture)switch(r){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=c.RGBFormat;break}if(n.texCoord!==void 0&&n.texCoord!=0&&!(r==="aoMap"&&n.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+r+" not yet supported."),t.extensions[u.KHR_TEXTURE_TRANSFORM]){var i=n.extensions!==void 0?n.extensions[u.KHR_TEXTURE_TRANSFORM]:void 0;if(i){var s=this.associations.get(a);a=t.extensions[u.KHR_TEXTURE_TRANSFORM].extendTexture(a,i),this.associations.set(a,s)}}e[r]=a})},I.prototype.assignFinalMaterial=function(e){var r=e.geometry,n=e.material,t=r.attributes.tangent!==void 0,a=r.attributes.color!==void 0,i=r.attributes.normal===void 0,s=e.isSkinnedMesh===!0,o=Object.keys(r.morphAttributes).length>0,f=o&&r.morphAttributes.normal!==void 0;if(e.isPoints){var l="PointsMaterial:"+n.uuid,v=this.cache.get(l);v||(v=new c.PointsMaterial,c.Material.prototype.copy.call(v,n),v.color.copy(n.color),v.map=n.map,v.sizeAttenuation=!1,this.cache.add(l,v)),n=v}else if(e.isLine){var l="LineBasicMaterial:"+n.uuid,d=this.cache.get(l);d||(d=new c.LineBasicMaterial,c.Material.prototype.copy.call(d,n),d.color.copy(n.color),this.cache.add(l,d)),n=d}if(t||a||i||s||o){var l="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(l+="specular-glossiness:"),s&&(l+="skinning:"),t&&(l+="vertex-tangents:"),a&&(l+="vertex-colors:"),i&&(l+="flat-shading:"),o&&(l+="morph-targets:"),f&&(l+="morph-normals:");var h=this.cache.get(l);h||(h=n.clone(),s&&(h.skinning=!0),t&&(h.vertexTangents=!0),a&&(h.vertexColors=!0),i&&(h.flatShading=!0),o&&(h.morphTargets=!0),f&&(h.morphNormals=!0),this.cache.add(l,h),this.associations.set(h,this.associations.get(n))),n=h}n.aoMap&&r.attributes.uv2===void 0&&r.attributes.uv!==void 0&&r.setAttribute("uv2",r.attributes.uv),n.normalScale&&!t&&(n.normalScale.y=-n.normalScale.y),n.clearcoatNormalScale&&!t&&(n.clearcoatNormalScale.y=-n.clearcoatNormalScale.y),e.material=n},I.prototype.loadMaterial=function(e){var r=this,n=this.json,t=this.extensions,a=n.materials[e],i,s={},o=a.extensions||{},f=[];if(o[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var l=t[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];i=l.getMaterialType(),f.push(l.extendParams(s,a,r))}else if(o[u.KHR_MATERIALS_UNLIT]){var v=t[u.KHR_MATERIALS_UNLIT];i=v.getMaterialType(),f.push(v.extendParams(s,a,r))}else{i=c.MeshStandardMaterial;var d=a.pbrMetallicRoughness||{};if(s.color=new c.Color(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){var h=d.baseColorFactor;s.color.fromArray(h),s.opacity=h[3]}d.baseColorTexture!==void 0&&f.push(r.assignTexture(s,"map",d.baseColorTexture)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(f.push(r.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),f.push(r.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture)))}a.doubleSided===!0&&(s.side=c.DoubleSide);var y=a.alphaMode||ie.OPAQUE;if(y===ie.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,y===ie.MASK&&(s.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&i!==c.MeshBasicMaterial&&(f.push(r.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new c.Vector2(1,1),a.normalTexture.scale!==void 0&&s.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),a.occlusionTexture!==void 0&&i!==c.MeshBasicMaterial&&(f.push(r.assignTexture(s,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&i!==c.MeshBasicMaterial&&(s.emissive=new c.Color().fromArray(a.emissiveFactor)),a.emissiveTexture!==void 0&&i!==c.MeshBasicMaterial&&f.push(r.assignTexture(s,"emissiveMap",a.emissiveTexture)),o[u.KHR_MATERIALS_CLEARCOAT]){var _=t[u.KHR_MATERIALS_CLEARCOAT];i=_.getMaterialType(),f.push(_.extendParams(s,{extensions:o},r))}if(o[u.KHR_MATERIALS_TRANSMISSION]){var _=t[u.KHR_MATERIALS_TRANSMISSION];i=_.getMaterialType(),f.push(_.extendParams(s,{extensions:o},r))}return Promise.all(f).then(function(){var S;return i===b?S=t[u.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):S=new i(s),a.name&&(S.name=a.name),S.map&&(S.map.encoding=c.sRGBEncoding),S.emissiveMap&&(S.emissiveMap.encoding=c.sRGBEncoding),Y(S,a),r.associations.set(S,{type:"materials",index:e}),a.extensions&&se(t,S,a),S})};function pe(e,r,n){var t=r.attributes,a=new c.Box3;if(t.POSITION!==void 0){var i=n.json.accessors[t.POSITION],s=i.min,o=i.max;if(s!==void 0&&o!==void 0)a.set(new c.Vector3(s[0],s[1],s[2]),new c.Vector3(o[0],o[1],o[2]));else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;var f=r.targets;if(f!==void 0){for(var l=new c.Vector3,v=new c.Vector3,d=0,h=f.length;d<h;d++){var y=f[d];if(y.POSITION!==void 0){var i=n.json.accessors[y.POSITION],s=i.min,o=i.max;s!==void 0&&o!==void 0?(v.setX(Math.max(Math.abs(s[0]),Math.abs(o[0]))),v.setY(Math.max(Math.abs(s[1]),Math.abs(o[1]))),v.setZ(Math.max(Math.abs(s[2]),Math.abs(o[2]))),l.max(v)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(l)}e.boundingBox=a;var _=new c.Sphere;a.getCenter(_.center),_.radius=a.min.distanceTo(a.max)/2,e.boundingSphere=_}function ue(e,r,n){var t=r.attributes,a=[];function i(l,v){return n.getDependency("accessor",l).then(function(d){e.setAttribute(v,d)})}for(var s in t){var o=j[s]||s.toLowerCase();o in e.attributes||a.push(i(t[s],o))}if(r.indices!==void 0&&!e.index){var f=n.getDependency("accessor",r.indices).then(function(l){e.setIndex(l)});a.push(f)}return Y(e,r),pe(e,r,n),Promise.all(a).then(function(){return r.targets!==void 0?Ae(e,r.targets,n):e})}function z(e,r){var n=e.getIndex();if(n===null){var t=[],a=e.getAttribute("position");if(a!==void 0){for(var i=0;i<a.count;i++)t.push(i);e.setIndex(t),n=e.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e}var s=n.count-2,o=[];if(r===c.TriangleFanDrawMode)for(var i=1;i<=s;i++)o.push(n.getX(0)),o.push(n.getX(i)),o.push(n.getX(i+1));else for(var i=0;i<s;i++)i%2===0?(o.push(n.getX(i)),o.push(n.getX(i+1)),o.push(n.getX(i+2))):(o.push(n.getX(i+2)),o.push(n.getX(i+1)),o.push(n.getX(i)));o.length/3!==s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var f=e.clone();return f.setIndex(o),f}return I.prototype.loadGeometries=function(e){var r=this,n=this.extensions,t=this.primitiveCache;function a(h){return n[u.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(h,r).then(function(y){return ue(y,h,r)})}for(var i=[],s=0,o=e.length;s<o;s++){var f=e[s],l=ye(f),v=t[l];if(v)i.push(v.promise);else{var d;f.extensions&&f.extensions[u.KHR_DRACO_MESH_COMPRESSION]?d=a(f):d=ue(new c.BufferGeometry,f,r),t[l]={primitive:f,promise:d},i.push(d)}}return Promise.all(i)},I.prototype.loadMesh=function(e){for(var r=this,n=this.json,t=n.meshes[e],a=t.primitives,i=[],s=0,o=a.length;s<o;s++){var f=a[s].material===void 0?me(this.cache):this.getDependency("material",a[s].material);i.push(f)}return i.push(r.loadGeometries(a)),Promise.all(i).then(function(l){for(var v=l.slice(0,l.length-1),d=l[l.length-1],h=[],y=0,_=d.length;y<_;y++){var S=d[y],R=a[y],E,F=v[y];if(R.mode===H.TRIANGLES||R.mode===H.TRIANGLE_STRIP||R.mode===H.TRIANGLE_FAN||R.mode===void 0)E=t.isSkinnedMesh===!0?new c.SkinnedMesh(S,F):new c.Mesh(S,F),E.isSkinnedMesh===!0&&!E.geometry.attributes.skinWeight.normalized&&E.normalizeSkinWeights(),R.mode===H.TRIANGLE_STRIP?E.geometry=z(E.geometry,c.TriangleStripDrawMode):R.mode===H.TRIANGLE_FAN&&(E.geometry=z(E.geometry,c.TriangleFanDrawMode));else if(R.mode===H.LINES)E=new c.LineSegments(S,F);else if(R.mode===H.LINE_STRIP)E=new c.Line(S,F);else if(R.mode===H.LINE_LOOP)E=new c.LineLoop(S,F);else if(R.mode===H.POINTS)E=new c.Points(S,F);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+R.mode);Object.keys(E.geometry.morphAttributes).length>0&&Se(E,t),E.name=t.name||"mesh_"+e,d.length>1&&(E.name+="_"+y),Y(E,t),r.assignFinalMaterial(E),h.push(E)}if(h.length===1)return h[0];for(var G=new c.Group,y=0,_=h.length;y<_;y++)G.add(h[y]);return G})},I.prototype.loadCamera=function(e){var r,n=this.json.cameras[e],t=n[n.type];if(!t){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?r=new c.PerspectiveCamera(c.MathUtils.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):n.type==="orthographic"&&(r=new c.OrthographicCamera(-t.xmag,t.xmag,t.ymag,-t.ymag,t.znear,t.zfar)),n.name&&(r.name=n.name),Y(r,n),Promise.resolve(r)},I.prototype.loadSkin=function(e){var r=this.json.skins[e],n={joints:r.joints};return r.inverseBindMatrices===void 0?Promise.resolve(n):this.getDependency("accessor",r.inverseBindMatrices).then(function(t){return n.inverseBindMatrices=t,n})},I.prototype.loadAnimation=function(e){for(var r=this.json,n=r.animations[e],t=[],a=[],i=[],s=[],o=[],f=0,l=n.channels.length;f<l;f++){var v=n.channels[f],d=n.samplers[v.sampler],h=v.target,y=h.node!==void 0?h.node:h.id,_=n.parameters!==void 0?n.parameters[d.input]:d.input,S=n.parameters!==void 0?n.parameters[d.output]:d.output;t.push(this.getDependency("node",y)),a.push(this.getDependency("accessor",_)),i.push(this.getDependency("accessor",S)),s.push(d),o.push(h)}return Promise.all([Promise.all(t),Promise.all(a),Promise.all(i),Promise.all(s),Promise.all(o)]).then(function(R){for(var E=R[0],F=R[1],G=R[2],te=R[3],ne=R[4],Q=[],B=0,oe=E.length;B<oe;B++){var k=E[B],Ee=F[B],ae=G[B],Le=te[B],_e=ne[B];if(k!==void 0){k.updateMatrix(),k.matrixAutoUpdate=!0;var he;switch(X[_e.path]){case X.weights:he=c.NumberKeyframeTrack;break;case X.rotation:he=c.QuaternionKeyframeTrack;break;case X.position:case X.scale:default:he=c.VectorKeyframeTrack;break}var Fe=k.name?k.name:k.uuid,De=Le.interpolation!==void 0?ge[Le.interpolation]:c.InterpolateLinear,ve=[];X[_e.path]===X.weights?k.traverse(function(ce){ce.isMesh===!0&&ce.morphTargetInfluences&&ve.push(ce.name?ce.name:ce.uuid)}):ve.push(Fe);var q=ae.array;if(ae.normalized){var le;if(q.constructor===Int8Array)le=1/127;else if(q.constructor===Uint8Array)le=1/255;else if(q.constructor==Int16Array)le=1/32767;else if(q.constructor===Uint16Array)le=1/65535;else throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");for(var Ie=new Float32Array(q.length),Z=0,Re=q.length;Z<Re;Z++)Ie[Z]=q[Z]*le;q=Ie}for(var Z=0,Re=ve.length;Z<Re;Z++){var Me=new he(ve[Z]+"."+X[_e.path],Ee.array,q,De);Le.interpolation==="CUBICSPLINE"&&(Me.createInterpolant=function(Ue){return new P(this.times,this.values,this.getValueSize()/3,Ue)},Me.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),Q.push(Me)}}}var Pe=n.name?n.name:"animation_"+e;return new c.AnimationClip(Pe,void 0,Q)})},I.prototype.loadNode=function(e){var r=this.json,n=this.extensions,t=this,a=r.meshReferences,i=r.meshUses,s=r.nodes[e];return function(){var o=[];return s.mesh!==void 0&&o.push(t.getDependency("mesh",s.mesh).then(function(f){var l;if(a[s.mesh]>1){var v=i[s.mesh]++;l=f.clone(),l.name+="_instance_"+v}else l=f;return s.weights!==void 0&&l.traverse(function(d){if(d.isMesh)for(var h=0,y=s.weights.length;h<y;h++)d.morphTargetInfluences[h]=s.weights[h]}),l})),s.camera!==void 0&&o.push(t.getDependency("camera",s.camera)),s.extensions&&s.extensions[u.KHR_LIGHTS_PUNCTUAL]&&s.extensions[u.KHR_LIGHTS_PUNCTUAL].light!==void 0&&o.push(t.getDependency("light",s.extensions[u.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(o)}().then(function(o){var f;if(s.isBone===!0?f=new c.Bone:o.length>1?f=new c.Group:o.length===1?f=o[0]:f=new c.Object3D,f!==o[0])for(var l=0,v=o.length;l<v;l++)f.add(o[l]);if(s.name&&(f.userData.name=s.name,f.name=c.PropertyBinding.sanitizeNodeName(s.name)),Y(f,s),s.extensions&&se(n,f,s),s.matrix!==void 0){var d=new c.Matrix4;d.fromArray(s.matrix),f.applyMatrix4(d)}else s.translation!==void 0&&f.position.fromArray(s.translation),s.rotation!==void 0&&f.quaternion.fromArray(s.rotation),s.scale!==void 0&&f.scale.fromArray(s.scale);return t.associations.set(f,{type:"nodes",index:e}),f})},I.prototype.loadScene=function(){function e(r,n,t,a){var i=t.nodes[r];return a.getDependency("node",r).then(function(s){if(i.skin===void 0)return s;var o;return a.getDependency("skin",i.skin).then(function(f){o=f;for(var l=[],v=0,d=o.joints.length;v<d;v++)l.push(a.getDependency("node",o.joints[v]));return Promise.all(l)}).then(function(f){return s.traverse(function(l){if(l.isMesh){for(var v=[],d=[],h=0,y=f.length;h<y;h++){var _=f[h];if(_){v.push(_);var S=new c.Matrix4;o.inverseBindMatrices!==void 0&&S.fromArray(o.inverseBindMatrices.array,h*16),d.push(S)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}l.bind(new c.Skeleton(v,d),l.matrixWorld)}}),s})}).then(function(s){n.add(s);var o=[];if(i.children)for(var f=i.children,l=0,v=f.length;l<v;l++){var d=f[l];o.push(e(d,s,t,a))}return Promise.all(o)})}return function(n){var t=this.json,a=this.extensions,i=this.json.scenes[n],s=this,o=new c.Group;i.name&&(o.name=i.name),Y(o,i),i.extensions&&se(a,o,i);for(var f=i.nodes||[],l=[],v=0,d=f.length;v<d;v++)l.push(e(f[v],o,t,s));return Promise.all(l).then(function(){return o})}}(),p}(),K=function(p){c.Loader.call(this,p),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};K.prototype=Object.assign(Object.create(c.Loader.prototype),{constructor:K,setDecoderPath:function(p){return this.decoderPath=p,this},setDecoderConfig:function(p){return this.decoderConfig=p,this},setWorkerLimit:function(p){return this.workerLimit=p,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(p,T,u,m){var g=new c.FileLoader(this.manager);g.setPath(this.path),g.setResponseType("arraybuffer"),this.crossOrigin==="use-credentials"&&g.setWithCredentials(!0),g.load(p,A=>{var L={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(A,L).then(T).catch(m)},u,m)},decodeDracoFile:function(p,T,u,m){var g={attributeIDs:u||this.defaultAttributeIDs,attributeTypes:m||this.defaultAttributeTypes,useUniqueIDs:!!u};this.decodeGeometry(p,g).then(T)},decodeGeometry:function(p,T){for(var u in T.attributeTypes){var m=T.attributeTypes[u];m.BYTES_PER_ELEMENT!==void 0&&(T.attributeTypes[u]=m.name)}var g=JSON.stringify(T);if(K.taskCache.has(p)){var A=K.taskCache.get(p);if(A.key===g)return A.promise;if(p.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var L,O=this.workerNextTaskID++,D=p.byteLength,M=this._getWorker(O,D).then(C=>(L=C,new Promise((N,x)=>{L._callbacks[O]={resolve:N,reject:x},L.postMessage({type:"decode",id:O,taskConfig:T,buffer:p},[p])}))).then(C=>this._createGeometry(C.geometry));return M.catch(()=>!0).then(()=>{L&&O&&this._releaseTask(L,O)}),K.taskCache.set(p,{key:g,promise:M}),M},_createGeometry:function(p){var T=new c.BufferGeometry;p.index&&T.setIndex(new c.BufferAttribute(p.index.array,1));for(var u=0;u<p.attributes.length;u++){var m=p.attributes[u],g=m.name,A=m.array,L=m.itemSize;T.setAttribute(g,new c.BufferAttribute(A,L))}return T},_loadLibrary:function(p,T){var u=new c.FileLoader(this.manager);return u.setPath(this.decoderPath),u.setResponseType(T),new Promise((m,g)=>{u.load(p,m,void 0,g)})},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var p=typeof WebAssembly!="object"||this.decoderConfig.type==="js",T=[];return p?T.push(this._loadLibrary("draco_decoder.js","text")):(T.push(this._loadLibrary("draco_wasm_wrapper.js","text")),T.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(T).then(u=>{var m=u[0];p||(this.decoderConfig.wasmBinary=u[1]);var g=K.DRACOWorker.toString(),A=["/* draco decoder */",m,"","/* worker */",g.substring(g.indexOf("{")+1,g.lastIndexOf("}"))].join(`
|
|
261
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([A]))}),this.decoderPending},_getWorker:function(p,T){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){var u=new Worker(this.workerSourceURL);u._callbacks={},u._taskCosts={},u._taskLoad=0,u.postMessage({type:"init",decoderConfig:this.decoderConfig}),u.onmessage=function(g){var A=g.data;switch(A.type){case"decode":u._callbacks[A.id].resolve(A);break;case"error":u._callbacks[A.id].reject(A);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+A.type+'"')}},this.workerPool.push(u)}else this.workerPool.sort(function(m,g){return m._taskLoad>g._taskLoad?-1:1});var u=this.workerPool[this.workerPool.length-1];return u._taskCosts[p]=T,u._taskLoad+=T,u})},_releaseTask:function(p,T){p._taskLoad-=p._taskCosts[T],delete p._callbacks[T],delete p._taskCosts[T]},debug:function(){console.log("Task load: ",this.workerPool.map(p=>p._taskLoad))},dispose:function(){for(var p=0;p<this.workerPool.length;++p)this.workerPool[p].terminate();return this.workerPool.length=0,this}});K.DRACOWorker=function(){var p,T;onmessage=function(g){var A=g.data;switch(A.type){case"init":p=A.decoderConfig,T=new Promise(function(D){p.onModuleLoaded=function(M){D({draco:M})},DracoDecoderModule(p)});break;case"decode":var L=A.buffer,O=A.taskConfig;T.then(D=>{var M=D.draco,C=new M.Decoder,N=new M.DecoderBuffer;N.Init(new Int8Array(L),L.byteLength);try{var x=u(M,C,N,O),w=x.attributes.map(b=>b.array.buffer);x.index&&w.push(x.index.array.buffer),self.postMessage({type:"decode",id:A.id,geometry:x},w)}catch(b){console.error(b),self.postMessage({type:"error",id:A.id,error:b.message})}finally{M.destroy(N),M.destroy(C)}});break}};function u(g,A,L,O){var D=O.attributeIDs,M=O.attributeTypes,C,N,x=A.GetEncodedGeometryType(L);if(x===g.TRIANGULAR_MESH)C=new g.Mesh,N=A.DecodeBufferToMesh(L,C);else if(x===g.POINT_CLOUD)C=new g.PointCloud,N=A.DecodeBufferToPointCloud(L,C);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!N.ok()||C.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+N.error_msg());var w={index:null,attributes:[]};for(var b in D){var V=self[M[b]],$,P;if(O.useUniqueIDs)P=D[b],$=A.GetAttributeByUniqueId(C,P);else{if(P=A.GetAttributeId(C,g[D[b]]),P===-1)continue;$=A.GetAttribute(C,P)}w.attributes.push(m(g,A,C,b,V,$))}if(x===g.TRIANGULAR_MESH){for(var H=C.num_faces(),ee=H*3,re=new Uint32Array(ee),J=new g.DracoInt32Array,W=0;W<H;++W){A.GetFaceFromMesh(C,W,J);for(var j=0;j<3;++j)re[W*3+j]=J.GetValue(j)}w.index={array:re,itemSize:1},g.destroy(J)}return g.destroy(C),w}function m(g,A,L,O,D,M){var C=M.num_components(),N=L.num_points(),x=N*C,w,b;switch(D){case Float32Array:w=new g.DracoFloat32Array,A.GetAttributeFloatForAllPoints(L,M,w),b=new Float32Array(x);break;case Int8Array:w=new g.DracoInt8Array,A.GetAttributeInt8ForAllPoints(L,M,w),b=new Int8Array(x);break;case Int16Array:w=new g.DracoInt16Array,A.GetAttributeInt16ForAllPoints(L,M,w),b=new Int16Array(x);break;case Int32Array:w=new g.DracoInt32Array,A.GetAttributeInt32ForAllPoints(L,M,w),b=new Int32Array(x);break;case Uint8Array:w=new g.DracoUInt8Array,A.GetAttributeUInt8ForAllPoints(L,M,w),b=new Uint8Array(x);break;case Uint16Array:w=new g.DracoUInt16Array,A.GetAttributeUInt16ForAllPoints(L,M,w),b=new Uint16Array(x);break;case Uint32Array:w=new g.DracoUInt32Array,A.GetAttributeUInt32ForAllPoints(L,M,w),b=new Uint32Array(x);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var V=0;V<x;V++)b[V]=w.GetValue(V);return g.destroy(w),{name:O,array:b,itemSize:C}}};K.taskCache=new WeakMap;K.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")};K.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")};K.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")};K.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var Te=function(p){c.CompressedTextureLoader.call(this,p)};Te.prototype=Object.assign(Object.create(c.CompressedTextureLoader.prototype),{constructor:Te,parse:function(p,T){var u={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},m=542327876,g=131072,A=512,L=1024,O=2048,D=4096,M=8192,C=16384,N=32768,x=4;function w(l){return l.charCodeAt(0)+(l.charCodeAt(1)<<8)+(l.charCodeAt(2)<<16)+(l.charCodeAt(3)<<24)}function b(l){return String.fromCharCode(l&255,l>>8&255,l>>16&255,l>>24&255)}function V(l,v,d,h){for(var y=d*h*4,_=new Uint8Array(l,v,y),S=new Uint8Array(y),R=0,E=0,F=0;F<h;F++)for(var G=0;G<d;G++){var te=_[E];E++;var ne=_[E];E++;var Q=_[E];E++;var B=_[E];E++,S[R]=Q,R++,S[R]=ne,R++,S[R]=te,R++,S[R]=B,R++}return S}var $=w("DXT1"),P=w("DXT3"),H=w("DXT5"),ee=w("ETC1"),re=31,J=0,W=1,j=2,X=3,ge=4,ie=7,fe=20,de=21,me=22,se=23,Y=24,Ae=25,Se=26,ye=28,U=new Int32Array(p,0,re);if(U[J]!==m)return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),u;if(!U[fe]&x)return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),u;var I,pe=U[de],ue=!1;switch(pe){case $:I=8,u.format=c.RGB_S3TC_DXT1_Format;break;case P:I=16,u.format=c.RGBA_S3TC_DXT3_Format;break;case H:I=16,u.format=c.RGBA_S3TC_DXT5_Format;break;case ee:I=8,u.format=c.RGB_ETC1_Format;break;default:if(U[me]===32&&U[se]&16711680&&U[Y]&65280&&U[Ae]&255&&U[Se]&4278190080)ue=!0,I=64,u.format=c.RGBAFormat;else return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",b(pe)),u}u.mipmapCount=1,U[j]&g&&T!==!1&&(u.mipmapCount=Math.max(1,U[ie]));var z=U[ye];if(u.isCubemap=!!(z&A),u.isCubemap&&(!(z&L)||!(z&O)||!(z&D)||!(z&M)||!(z&C)||!(z&N)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),u;u.width=U[ge],u.height=U[X];for(var e=U[W]+4,r=u.isCubemap?6:1,n=0;n<r;n++)for(var t=u.width,a=u.height,i=0;i<u.mipmapCount;i++){if(ue)var s=V(p,e,t,a),o=s.length;else var o=Math.max(4,t)/4*Math.max(4,a)/4*I,s=new Uint8Array(p,e,o);var f={data:s,width:t,height:a};u.mipmaps.push(f),e+=o,t=Math.max(t>>1,1),a=Math.max(a>>1,1)}return u}});var Ce=function(p){xe(T,p);function T(u){var m=p.call(this)||this;return m.needsRender=!0,u&&u.children.length&&m.add.apply(m,u.children),m.mixer=new we.AnimationMixer(m),m}return T.prototype.clone=function(){var u=p.prototype.clone.call(this,!0),m=new we.AnimationMixer(u);return u.mixer=m,u.needsRender=!0,u},T}(we.Group),Ne="https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/",ke=function(p){xe(T,p);function T(u){var m=p.call(this,u)||this;return m.ddsLoader=new Te(u),m.dracoLoader=new K(u),m.dracoLoader.setDecoderPath(Ne),m}return Object.defineProperty(T,"version",{get:function(){return"6.0.0-alpha.70"},enumerable:!1,configurable:!0}),T.prototype.load=function(u,m,g,A){return p.prototype.load.call(this,u,m,g,A)},T.prototype.parse=function(u,m,g,A){return p.prototype.parse.call(this,u,m,function(L){var O=new Ce(L.scene),D=L.scenes.map(function(M){return M===L.scene?O:new Ce(M)});g(Object.assign(L,{scene:O,scenes:D}))},A)},T}(Oe);exports.DDSLoader=Te;exports.DRACOLoader=K;exports.GLTFLoader=ke;exports.GLTFObject=Ce;exports.THREEGLTFLoader=Oe;
|
|
255
|
+
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("three");function t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const r=t(e);var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}"function"==typeof SuppressedError&&SuppressedError;var o=function(){function t(t){e.Loader.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function r(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}t.prototype=Object.assign(Object.create(e.Loader.prototype),{constructor:t,load:function(t,r,a,n){var o,s=this;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:e.LoaderUtils.extractUrlBase(t),s.manager.itemStart(t);var i=function(e){n?n(e):console.error(e),s.manager.itemError(t),s.manager.itemEnd(t)},c=new e.FileLoader(s.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),"use-credentials"===s.crossOrigin&&c.setWithCredentials(!0),c.load(t,(function(e){try{s.parse(e,o,(function(e){r(e),s.manager.itemEnd(t)}),i)}catch(a){i(a)}}),a,i)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(t,r,u,d){var m,y={};if("string"==typeof t)m=t;else if(e.LoaderUtils.decodeText(new Uint8Array(t,0,4))===l){try{y[a.KHR_BINARY_GLTF]=new p(t)}catch(b){return void(d&&d(b))}m=y[a.KHR_BINARY_GLTF].content}else m=e.LoaderUtils.decodeText(new Uint8Array(t));var T=JSON.parse(m);if(void 0===T.asset||T.asset.version[0]<2)d&&d(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(T.extensionsUsed)for(var M=0;M<T.extensionsUsed.length;++M){var A=T.extensionsUsed[M],R=T.extensionsRequired||[];switch(A){case a.KHR_LIGHTS_PUNCTUAL:y[A]=new o(T);break;case a.KHR_MATERIALS_CLEARCOAT:y[A]=new i;break;case a.KHR_MATERIALS_TRANSMISSION:y[A]=new c;break;case a.KHR_MATERIALS_UNLIT:y[A]=new s;break;case a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:y[A]=new g;break;case a.KHR_DRACO_MESH_COMPRESSION:y[A]=new h(T,this.dracoLoader);break;case a.MSFT_TEXTURE_DDS:y[A]=new n(this.ddsLoader);break;case a.KHR_TEXTURE_TRANSFORM:y[A]=new f;break;case a.KHR_MESH_QUANTIZATION:y[A]=new v;break;default:R.indexOf(A)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}var S=new j(T,y,{path:r||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});S.fileLoader.setRequestHeader(this.requestHeader),S.parse(u,d)}}});var a={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_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=a.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.name=a.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[a.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function s(){this.name=a.KHR_MATERIALS_UNLIT}function i(){this.name=a.KHR_MATERIALS_CLEARCOAT}function c(){this.name=a.KHR_MATERIALS_TRANSMISSION}o.prototype.loadLight=function(t){var r,a=this.lightDefs[t],n=new e.Color(16777215);void 0!==a.color&&n.fromArray(a.color);var o=void 0!==a.range?a.range:0;switch(a.type){case"directional":(r=new e.DirectionalLight(n)).target.position.set(0,0,-1),r.add(r.target);break;case"point":(r=new e.PointLight(n)).distance=o;break;case"spot":(r=new e.SpotLight(n)).distance=o,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,r.angle=a.spot.outerConeAngle,r.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+a.type+'".')}return r.position.set(0,0,0),r.decay=2,void 0!==a.intensity&&(r.intensity=a.intensity),r.name=a.name||"light_"+t,Promise.resolve(r)},s.prototype.getMaterialType=function(){return e.MeshBasicMaterial},s.prototype.extendParams=function(t,r,a){var n=[];t.color=new e.Color(1,1,1),t.opacity=1;var o=r.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var s=o.baseColorFactor;t.color.fromArray(s),t.opacity=s[3]}void 0!==o.baseColorTexture&&n.push(a.assignTexture(t,"map",o.baseColorTexture))}return Promise.all(n)},i.prototype.getMaterialType=function(){return e.MeshPhysicalMaterial},i.prototype.extendParams=function(t,r,a){var n=[],o=r.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&n.push(a.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&n.push(a.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(n.push(a.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var s=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new e.Vector2(s,s)}return Promise.all(n)},c.prototype.getMaterialType=function(){return e.MeshPhysicalMaterial},c.prototype.extendParams=function(e,t,r){var a=t.extensions[this.name];return void 0!==a.transmissionFactor&&(e.premultipliedAlpha=!0,e.transparent=!0,e.opacity=1,e.transparency=a.transmissionFactor,(e.map||e.color.r*e.color.g*e.color.b<.99)&&(e.transparency*=.75)),Promise.all([])};var l="glTF",u=12,d={JSON:1313821514,BIN:5130562};function p(t){this.name=a.KHR_BINARY_GLTF,this.content=null,this.body=null;var r=new DataView(t,0,u);if(this.header={magic:e.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==l)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var n=new DataView(t,u),o=0;o<n.byteLength;){var s=n.getUint32(o,!0);o+=4;var i=n.getUint32(o,!0);if(o+=4,i===d.JSON){var c=new Uint8Array(t,u+o,s);this.content=e.LoaderUtils.decodeText(c)}else if(i===d.BIN){var p=u+o;this.body=t.slice(p,p+s)}o+=s}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function h(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=a.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function f(){this.name=a.KHR_TEXTURE_TRANSFORM}function m(t){e.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var r=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),a=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),n=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),o=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),i={specular:{value:(new e.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=i,this.onBeforeCompile=function(e){for(var t in i)e.uniforms[t]=i[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",a),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",n),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",o),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return i.specular.value},set:function(e){i.specular.value=e}},specularMap:{get:function(){return i.specularMap.value},set:function(e){i.specularMap.value=e}},glossiness:{get:function(){return i.glossiness.value},set:function(e){i.glossiness.value=e}},glossinessMap:{get:function(){return i.glossinessMap.value},set:function(e){i.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function g(){return{name:a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,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:function(){return m},extendParams:function(t,r,a){var n=r.extensions[this.name];t.color=new e.Color(1,1,1),t.opacity=1;var o=[];if(Array.isArray(n.diffuseFactor)){var s=n.diffuseFactor;t.color.fromArray(s),t.opacity=s[3]}if(void 0!==n.diffuseTexture&&o.push(a.assignTexture(t,"map",n.diffuseTexture)),t.emissive=new e.Color(0,0,0),t.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,t.specular=new e.Color(1,1,1),Array.isArray(n.specularFactor)&&t.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var i=n.specularGlossinessTexture;o.push(a.assignTexture(t,"glossinessMap",i)),o.push(a.assignTexture(t,"specularMap",i))}return Promise.all(o)},createMaterial:function(t){var r=new m(t);return r.fog=!0,r.color=t.color,r.map=void 0===t.map?null:t.map,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=void 0===t.aoMap?null:t.aoMap,r.aoMapIntensity=1,r.emissive=t.emissive,r.emissiveIntensity=1,r.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,r.bumpMap=void 0===t.bumpMap?null:t.bumpMap,r.bumpScale=1,r.normalMap=void 0===t.normalMap?null:t.normalMap,r.normalMapType=e.TangentSpaceNormalMap,t.normalScale&&(r.normalScale=t.normalScale),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.specularMap=void 0===t.specularMap?null:t.specularMap,r.specular=t.specular,r.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,r.glossiness=t.glossiness,r.alphaMap=null,r.envMap=void 0===t.envMap?null:t.envMap,r.envMapIntensity=1,r.refractionRatio=.98,r}}}function v(){this.name=a.KHR_MESH_QUANTIZATION}function y(t,r,a,n){e.Interpolant.call(this,t,r,a,n)}h.prototype.decodePrimitive=function(e,t){var r=this.json,a=this.dracoLoader,n=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},i={},c={};for(var l in o){var u=I[l]||l.toLowerCase();s[u]=o[l]}for(l in e.attributes){u=I[l]||l.toLowerCase();if(void 0!==o[l]){var d=r.accessors[e.attributes[l]],p=L[d.componentType];c[u]=p,i[u]=!0===d.normalized}}return t.getDependency("bufferView",n).then((function(e){return new Promise((function(t){a.decodeDracoFile(e,(function(e){for(var r in e.attributes){var a=e.attributes[r],n=i[r];void 0!==n&&(a.normalized=n)}t(e)}),s,c)}))}))},f.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},m.prototype=Object.create(e.MeshStandardMaterial.prototype),m.prototype.constructor=m,m.prototype.copy=function(t){return e.MeshStandardMaterial.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},y.prototype=Object.create(e.Interpolant.prototype),y.prototype.constructor=y,y.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,a=this.valueSize,n=e*a*3+a,o=0;o!==a;o++)t[o]=r[n+o];return t},y.prototype.beforeStart_=y.prototype.copySampleValue_,y.prototype.afterEnd_=y.prototype.copySampleValue_,y.prototype.interpolate_=function(e,t,r,a){for(var n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,i=2*s,c=3*s,l=a-t,u=(r-t)/l,d=u*u,p=d*u,h=e*c,f=h-c,m=-2*p+3*d,g=p-d,v=1-m,y=g-d+u,T=0;T!==s;T++){var M=o[f+T+s],A=o[f+T+i]*l,R=o[h+T+s],S=o[h+T]*l;n[T]=v*M+y*A+m*R+g*S}return n};var T=0,M=1,A=2,R=3,S=4,b=5,w=6,L={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},_={9728:e.NearestFilter,9729:e.LinearFilter,9984:e.NearestMipmapNearestFilter,9985:e.LinearMipmapNearestFilter,9986:e.NearestMipmapLinearFilter,9987:e.LinearMipmapLinearFilter},E={33071:e.ClampToEdgeWrapping,33648:e.MirroredRepeatWrapping,10497:e.RepeatWrapping},x={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},I={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},C={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},D={CUBICSPLINE:void 0,LINEAR:e.InterpolateLinear,STEP:e.InterpolateDiscrete},P="OPAQUE",O="MASK",U="BLEND",F={"image/png":e.RGBAFormat,"image/jpeg":e.RGBFormat};function k(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 H(e,t,r){for(var a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function N(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(var r=0,a=t.weights.length;r<a;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(r=0,a=n.length;r<a;r++)e.morphTargetDictionary[n[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function B(e){for(var t="",r=Object.keys(e).sort(),a=0,n=r.length;a<n;a++)t+=r[a]+":"+e[r[a]]+";";return t}function j(t,a,n){this.json=t||{},this.extensions=a||{},this.options=n||{},this.cache=new r,this.associations=new Map,this.primitiveCache={},this.textureLoader=new e.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new e.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function K(t,r,a){var n=r.attributes,o=[];function s(e,r){return a.getDependency("accessor",e).then((function(e){t.setAttribute(r,e)}))}for(var i in n){var c=I[i]||i.toLowerCase();c in t.attributes||o.push(s(n[i],c))}if(void 0!==r.indices&&!t.index){var l=a.getDependency("accessor",r.indices).then((function(e){t.setIndex(e)}));o.push(l)}return N(t,r),function(t,r,a){var n=r.attributes,o=new e.Box3;if(void 0!==n.POSITION){var s=(h=a.json.accessors[n.POSITION]).min,i=h.max;if(void 0!==s&&void 0!==i){o.set(new e.Vector3(s[0],s[1],s[2]),new e.Vector3(i[0],i[1],i[2]));var c=r.targets;if(void 0!==c){for(var l=new e.Vector3,u=new e.Vector3,d=0,p=c.length;d<p;d++){var h,f=c[d];if(void 0!==f.POSITION)s=(h=a.json.accessors[f.POSITION]).min,i=h.max,void 0!==s&&void 0!==i?(u.setX(Math.max(Math.abs(s[0]),Math.abs(i[0]))),u.setY(Math.max(Math.abs(s[1]),Math.abs(i[1]))),u.setZ(Math.max(Math.abs(s[2]),Math.abs(i[2]))),l.max(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}o.expandByVector(l)}t.boundingBox=o;var m=new e.Sphere;o.getCenter(m.center),m.radius=o.min.distanceTo(o.max)/2,t.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(t,r,a),Promise.all(o).then((function(){return void 0!==r.targets?function(e,t,r){for(var a=!1,n=!1,o=0,s=t.length;o<s&&(void 0!==(l=t[o]).POSITION&&(a=!0),void 0!==l.NORMAL&&(n=!0),!a||!n);o++);if(!a&&!n)return Promise.resolve(e);var i=[],c=[];for(o=0,s=t.length;o<s;o++){var l=t[o];if(a){var u=void 0!==l.POSITION?r.getDependency("accessor",l.POSITION):e.attributes.position;i.push(u)}n&&(u=void 0!==l.NORMAL?r.getDependency("accessor",l.NORMAL):e.attributes.normal,c.push(u))}return Promise.all([Promise.all(i),Promise.all(c)]).then((function(t){var r=t[0],o=t[1];return a&&(e.morphAttributes.position=r),n&&(e.morphAttributes.normal=o),e.morphTargetsRelative=!0,e}))}(t,r.targets,a):t}))}function V(t,r){var a=t.getIndex();if(null===a){var n=[],o=t.getAttribute("position");if(void 0===o)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var s=0;s<o.count;s++)n.push(s);t.setIndex(n),a=t.getIndex()}var i=a.count-2,c=[];if(r===e.TriangleFanDrawMode)for(s=1;s<=i;s++)c.push(a.getX(0)),c.push(a.getX(s)),c.push(a.getX(s+1));else for(s=0;s<i;s++)s%2==0?(c.push(a.getX(s)),c.push(a.getX(s+1)),c.push(a.getX(s+2))):(c.push(a.getX(s+2)),c.push(a.getX(s+1)),c.push(a.getX(s)));c.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var l=t.clone();return l.setIndex(c),l}return j.prototype.parse=function(e,t){var r=this,a=this.json,n=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var o={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};H(n,o,a),N(o,a),e(o)})).catch(t)},j.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},o=0,s=t.length;o<s;o++)for(var i=t[o].joints,c=0,l=i.length;c<l;c++)e[i[c]].isBone=!0;for(var u=0,d=e.length;u<d;u++){var p=e[u];void 0!==p.mesh&&(void 0===a[p.mesh]&&(a[p.mesh]=n[p.mesh]=0),a[p.mesh]++,void 0!==p.skin&&(r[p.mesh].isSkinnedMesh=!0))}this.json.meshReferences=a,this.json.meshUses=n},j.prototype.getDependency=function(e,t){var r=e+":"+t,n=this.cache.get(r);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this.loadNode(t);break;case"mesh":n=this.loadMesh(t);break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this.loadBufferView(t);break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this.loadMaterial(t);break;case"texture":n=this.loadTexture(t);break;case"skin":n=this.loadSkin(t);break;case"animation":n=this.loadAnimation(t);break;case"camera":n=this.loadCamera(t);break;case"light":n=this.extensions[a.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(r,n)}return n},j.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,a=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(a.map((function(t,a){return r.getDependency(e,a)}))),this.cache.add(e,t)}return t},j.prototype.loadBuffer=function(e){var t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[a.KHR_BINARY_GLTF].body);var n=this.options;return new Promise((function(e,a){r.load(k(t.uri,n.path),e,void 0,(function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},j.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var r=t.byteLength||0,a=t.byteOffset||0;return e.slice(a,a+r)}))},j.prototype.loadAccessor=function(t){var r=this,a=this.json,n=this.json.accessors[t];if(void 0===n.bufferView&&void 0===n.sparse)return Promise.resolve(null);var o=[];return void 0!==n.bufferView?o.push(this.getDependency("bufferView",n.bufferView)):o.push(null),void 0!==n.sparse&&(o.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(o).then((function(t){var o,s,i=t[0],c=x[n.type],l=L[n.componentType],u=l.BYTES_PER_ELEMENT,d=u*c,p=n.byteOffset||0,h=void 0!==n.bufferView?a.bufferViews[n.bufferView].byteStride:void 0,f=!0===n.normalized;if(h&&h!==d){var m=Math.floor(p/h),g="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+m+":"+n.count,v=r.cache.get(g);v||(o=new l(i,m*h,n.count*h/u),v=new e.InterleavedBuffer(o,h/u),r.cache.add(g,v)),s=new e.InterleavedBufferAttribute(v,c,p%h/u,f)}else o=null===i?new l(n.count*c):new l(i,p,n.count*c),s=new e.BufferAttribute(o,c,f);if(void 0!==n.sparse){var y=x.SCALAR,T=L[n.sparse.indices.componentType],M=n.sparse.indices.byteOffset||0,A=n.sparse.values.byteOffset||0,R=new T(t[1],M,n.sparse.count*y),S=new l(t[2],A,n.sparse.count*c);null!==i&&(s=new e.BufferAttribute(s.array.slice(),s.itemSize,s.normalized));for(var b=0,w=R.length;b<w;b++){var _=R[b];if(s.setX(_,S[b*c]),c>=2&&s.setY(_,S[b*c+1]),c>=3&&s.setZ(_,S[b*c+2]),c>=4&&s.setW(_,S[b*c+3]),c>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return s}))},j.prototype.loadTexture=function(t){var r,n=this,o=this.json,s=this.options,i=this.textureLoader,c=self.URL||self.webkitURL,l=o.textures[t],u=l.extensions||{},d=(r=u[a.MSFT_TEXTURE_DDS]?o.images[u[a.MSFT_TEXTURE_DDS].source]:o.images[l.source]).uri,p=!1;return void 0!==r.bufferView&&(d=n.getDependency("bufferView",r.bufferView).then((function(e){p=!0;var t=new Blob([e],{type:r.mimeType});return d=c.createObjectURL(t)}))),Promise.resolve(d).then((function(e){var t=s.manager.getHandler(e);return t||(t=u[a.MSFT_TEXTURE_DDS]?n.extensions[a.MSFT_TEXTURE_DDS].ddsLoader:i),new Promise((function(r,a){t.load(k(e,s.path),r,void 0,a)}))})).then((function(a){!0===p&&c.revokeObjectURL(d),a.flipY=!1,l.name&&(a.name=l.name),r.mimeType in F&&(a.format=F[r.mimeType]);var s=(o.samplers||{})[l.sampler]||{};return a.magFilter=_[s.magFilter]||e.LinearFilter,a.minFilter=_[s.minFilter]||e.LinearMipmapLinearFilter,a.wrapS=E[s.wrapS]||e.RepeatWrapping,a.wrapT=E[s.wrapT]||e.RepeatWrapping,n.associations.set(a,{type:"textures",index:t}),a}))},j.prototype.assignTexture=function(t,r,n){var o=this;return this.getDependency("texture",n.index).then((function(s){if(!s.isCompressedTexture)switch(r){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":s.format=e.RGBFormat}if(void 0===n.texCoord||0==n.texCoord||"aoMap"===r&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+r+" not yet supported."),o.extensions[a.KHR_TEXTURE_TRANSFORM]){var i=void 0!==n.extensions?n.extensions[a.KHR_TEXTURE_TRANSFORM]:void 0;if(i){var c=this.associations.get(s);s=o.extensions[a.KHR_TEXTURE_TRANSFORM].extendTexture(s,i),this.associations.set(s,c)}}t[r]=s}))},j.prototype.assignFinalMaterial=function(t){var r=t.geometry,a=t.material,n=void 0!==r.attributes.tangent,o=void 0!==r.attributes.color,s=void 0===r.attributes.normal,i=!0===t.isSkinnedMesh,c=Object.keys(r.morphAttributes).length>0,l=c&&void 0!==r.morphAttributes.normal;if(t.isPoints){var u="PointsMaterial:"+a.uuid,d=this.cache.get(u);d||(d=new e.PointsMaterial,e.Material.prototype.copy.call(d,a),d.color.copy(a.color),d.map=a.map,d.sizeAttenuation=!1,this.cache.add(u,d)),a=d}else if(t.isLine){u="LineBasicMaterial:"+a.uuid;var p=this.cache.get(u);p||(p=new e.LineBasicMaterial,e.Material.prototype.copy.call(p,a),p.color.copy(a.color),this.cache.add(u,p)),a=p}if(n||o||s||i||c){u="ClonedMaterial:"+a.uuid+":";a.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),i&&(u+="skinning:"),n&&(u+="vertex-tangents:"),o&&(u+="vertex-colors:"),s&&(u+="flat-shading:"),c&&(u+="morph-targets:"),l&&(u+="morph-normals:");var h=this.cache.get(u);h||(h=a.clone(),i&&(h.skinning=!0),n&&(h.vertexTangents=!0),o&&(h.vertexColors=!0),s&&(h.flatShading=!0),c&&(h.morphTargets=!0),l&&(h.morphNormals=!0),this.cache.add(u,h),this.associations.set(h,this.associations.get(a))),a=h}a.aoMap&&void 0===r.attributes.uv2&&void 0!==r.attributes.uv&&r.setAttribute("uv2",r.attributes.uv),a.normalScale&&!n&&(a.normalScale.y=-a.normalScale.y),a.clearcoatNormalScale&&!n&&(a.clearcoatNormalScale.y=-a.clearcoatNormalScale.y),t.material=a},j.prototype.loadMaterial=function(t){var r,n=this,o=this.json,s=this.extensions,i=o.materials[t],c={},l=i.extensions||{},u=[];if(l[a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var d=s[a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];r=d.getMaterialType(),u.push(d.extendParams(c,i,n))}else if(l[a.KHR_MATERIALS_UNLIT]){var p=s[a.KHR_MATERIALS_UNLIT];r=p.getMaterialType(),u.push(p.extendParams(c,i,n))}else{r=e.MeshStandardMaterial;var h=i.pbrMetallicRoughness||{};if(c.color=new e.Color(1,1,1),c.opacity=1,Array.isArray(h.baseColorFactor)){var f=h.baseColorFactor;c.color.fromArray(f),c.opacity=f[3]}void 0!==h.baseColorTexture&&u.push(n.assignTexture(c,"map",h.baseColorTexture)),c.metalness=void 0!==h.metallicFactor?h.metallicFactor:1,c.roughness=void 0!==h.roughnessFactor?h.roughnessFactor:1,void 0!==h.metallicRoughnessTexture&&(u.push(n.assignTexture(c,"metalnessMap",h.metallicRoughnessTexture)),u.push(n.assignTexture(c,"roughnessMap",h.metallicRoughnessTexture)))}!0===i.doubleSided&&(c.side=e.DoubleSide);var g=i.alphaMode||P;if(g===U?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,g===O&&(c.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&r!==e.MeshBasicMaterial&&(u.push(n.assignTexture(c,"normalMap",i.normalTexture)),c.normalScale=new e.Vector2(1,1),void 0!==i.normalTexture.scale&&c.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&r!==e.MeshBasicMaterial&&(u.push(n.assignTexture(c,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(c.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&r!==e.MeshBasicMaterial&&(c.emissive=(new e.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&r!==e.MeshBasicMaterial&&u.push(n.assignTexture(c,"emissiveMap",i.emissiveTexture)),l[a.KHR_MATERIALS_CLEARCOAT]){var v=s[a.KHR_MATERIALS_CLEARCOAT];r=v.getMaterialType(),u.push(v.extendParams(c,{extensions:l},n))}if(l[a.KHR_MATERIALS_TRANSMISSION]){v=s[a.KHR_MATERIALS_TRANSMISSION];r=v.getMaterialType(),u.push(v.extendParams(c,{extensions:l},n))}return Promise.all(u).then((function(){var o;return o=r===m?s[a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(c):new r(c),i.name&&(o.name=i.name),o.map&&(o.map.encoding=e.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=e.sRGBEncoding),N(o,i),n.associations.set(o,{type:"materials",index:t}),i.extensions&&H(s,o,i),o}))},j.prototype.loadGeometries=function(t){var r=this,n=this.extensions,o=this.primitiveCache;function s(e){return n[a.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,r).then((function(t){return K(t,e,r)}))}for(var i,c,l=[],u=0,d=t.length;u<d;u++){var p,h=t[u],f=(c=void 0,(c=(i=h).extensions&&i.extensions[a.KHR_DRACO_MESH_COMPRESSION])?"draco:"+c.bufferView+":"+c.indices+":"+B(c.attributes):i.indices+":"+B(i.attributes)+":"+i.mode),m=o[f];if(m)l.push(m.promise);else p=h.extensions&&h.extensions[a.KHR_DRACO_MESH_COMPRESSION]?s(h):K(new e.BufferGeometry,h,r),o[f]={primitive:h,promise:p},l.push(p)}return Promise.all(l)},j.prototype.loadMesh=function(t){for(var r,a=this,n=this.json.meshes[t],o=n.primitives,s=[],i=0,c=o.length;i<c;i++){var l=void 0===o[i].material?(void 0===(r=this.cache).DefaultMaterial&&(r.DefaultMaterial=new e.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:e.FrontSide})),r.DefaultMaterial):this.getDependency("material",o[i].material);s.push(l)}return s.push(a.loadGeometries(o)),Promise.all(s).then((function(r){for(var s=r.slice(0,r.length-1),i=r[r.length-1],c=[],l=0,u=i.length;l<u;l++){var d,p=i[l],h=o[l],f=s[l];if(h.mode===S||h.mode===b||h.mode===w||void 0===h.mode)!0!==(d=!0===n.isSkinnedMesh?new e.SkinnedMesh(p,f):new e.Mesh(p,f)).isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),h.mode===b?d.geometry=V(d.geometry,e.TriangleStripDrawMode):h.mode===w&&(d.geometry=V(d.geometry,e.TriangleFanDrawMode));else if(h.mode===M)d=new e.LineSegments(p,f);else if(h.mode===R)d=new e.Line(p,f);else if(h.mode===A)d=new e.LineLoop(p,f);else{if(h.mode!==T)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);d=new e.Points(p,f)}Object.keys(d.geometry.morphAttributes).length>0&&G(d,n),d.name=n.name||"mesh_"+t,i.length>1&&(d.name+="_"+l),N(d,n),a.assignFinalMaterial(d),c.push(d)}if(1===c.length)return c[0];var m=new e.Group;for(l=0,u=c.length;l<u;l++)m.add(c[l]);return m}))},j.prototype.loadCamera=function(t){var r,a=this.json.cameras[t],n=a[a.type];if(n)return"perspective"===a.type?r=new e.PerspectiveCamera(e.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===a.type&&(r=new e.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),a.name&&(r.name=a.name),N(r,a),Promise.resolve(r);console.warn("THREE.GLTFLoader: Missing camera parameters.")},j.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},j.prototype.loadAnimation=function(t){for(var r=this.json.animations[t],a=[],n=[],o=[],s=[],i=[],c=0,l=r.channels.length;c<l;c++){var u=r.channels[c],d=r.samplers[u.sampler],p=u.target,h=void 0!==p.node?p.node:p.id,f=void 0!==r.parameters?r.parameters[d.input]:d.input,m=void 0!==r.parameters?r.parameters[d.output]:d.output;a.push(this.getDependency("node",h)),n.push(this.getDependency("accessor",f)),o.push(this.getDependency("accessor",m)),s.push(d),i.push(p)}return Promise.all([Promise.all(a),Promise.all(n),Promise.all(o),Promise.all(s),Promise.all(i)]).then((function(a){for(var n=a[0],o=a[1],s=a[2],i=a[3],c=a[4],l=[],u=0,d=n.length;u<d;u++){var p=n[u],h=o[u],f=s[u],m=i[u],g=c[u];if(void 0!==p){var v;switch(p.updateMatrix(),p.matrixAutoUpdate=!0,C[g.path]){case C.weights:v=e.NumberKeyframeTrack;break;case C.rotation:v=e.QuaternionKeyframeTrack;break;default:v=e.VectorKeyframeTrack}var T=p.name?p.name:p.uuid,M=void 0!==m.interpolation?D[m.interpolation]:e.InterpolateLinear,A=[];C[g.path]===C.weights?p.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&A.push(e.name?e.name:e.uuid)})):A.push(T);var R=f.array;if(f.normalized){var S;if(R.constructor===Int8Array)S=1/127;else if(R.constructor===Uint8Array)S=1/255;else if(R.constructor==Int16Array)S=1/32767;else{if(R.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");S=1/65535}for(var b=new Float32Array(R.length),w=0,L=R.length;w<L;w++)b[w]=R[w]*S;R=b}for(w=0,L=A.length;w<L;w++){var _=new v(A[w]+"."+C[g.path],h.array,R,M);"CUBICSPLINE"===m.interpolation&&(_.createInterpolant=function(e){return new y(this.times,this.values,this.getValueSize()/3,e)},_.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(_)}}}var E=r.name?r.name:"animation_"+t;return new e.AnimationClip(E,void 0,l)}))},j.prototype.loadNode=function(t){var r,n=this.json,o=this.extensions,s=this,i=n.meshReferences,c=n.meshUses,l=n.nodes[t];return(r=[],void 0!==l.mesh&&r.push(s.getDependency("mesh",l.mesh).then((function(e){var t;if(i[l.mesh]>1){var r=c[l.mesh]++;(t=e.clone()).name+="_instance_"+r}else t=e;return void 0!==l.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,r=l.weights.length;t<r;t++)e.morphTargetInfluences[t]=l.weights[t]})),t}))),void 0!==l.camera&&r.push(s.getDependency("camera",l.camera)),l.extensions&&l.extensions[a.KHR_LIGHTS_PUNCTUAL]&&void 0!==l.extensions[a.KHR_LIGHTS_PUNCTUAL].light&&r.push(s.getDependency("light",l.extensions[a.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(r)).then((function(r){var a;if((a=!0===l.isBone?new e.Bone:r.length>1?new e.Group:1===r.length?r[0]:new e.Object3D)!==r[0])for(var n=0,i=r.length;n<i;n++)a.add(r[n]);if(l.name&&(a.userData.name=l.name,a.name=e.PropertyBinding.sanitizeNodeName(l.name)),N(a,l),l.extensions&&H(o,a,l),void 0!==l.matrix){var c=new e.Matrix4;c.fromArray(l.matrix),a.applyMatrix4(c)}else void 0!==l.translation&&a.position.fromArray(l.translation),void 0!==l.rotation&&a.quaternion.fromArray(l.rotation),void 0!==l.scale&&a.scale.fromArray(l.scale);return s.associations.set(a,{type:"nodes",index:t}),a}))},j.prototype.loadScene=function(){function t(r,a,n,o){var s=n.nodes[r];return o.getDependency("node",r).then((function(t){return void 0===s.skin?t:o.getDependency("skin",s.skin).then((function(e){for(var t=[],a=0,n=(r=e).joints.length;a<n;a++)t.push(o.getDependency("node",r.joints[a]));return Promise.all(t)})).then((function(a){return t.traverse((function(t){if(t.isMesh){for(var n=[],o=[],s=0,i=a.length;s<i;s++){var c=a[s];if(c){n.push(c);var l=new e.Matrix4;void 0!==r.inverseBindMatrices&&l.fromArray(r.inverseBindMatrices.array,16*s),o.push(l)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',r.joints[s])}t.bind(new e.Skeleton(n,o),t.matrixWorld)}})),t}));var r})).then((function(e){a.add(e);var r=[];if(s.children)for(var i=s.children,c=0,l=i.length;c<l;c++){var u=i[c];r.push(t(u,e,n,o))}return Promise.all(r)}))}return function(r){var a=this.json,n=this.extensions,o=this.json.scenes[r],s=new e.Group;o.name&&(s.name=o.name),N(s,o),o.extensions&&H(n,s,o);for(var i=o.nodes||[],c=[],l=0,u=i.length;l<u;l++)c.push(t(i[l],s,a,this));return Promise.all(c).then((function(){return s}))}}(),t}(),s=function(t){e.Loader.call(this,t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};s.prototype=Object.assign(Object.create(e.Loader.prototype),{constructor:s,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(t,r,a,n){var o=new e.FileLoader(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&o.setWithCredentials(!0),o.load(t,(e=>{var t={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,t).then(r).catch(n)}),a,n)},decodeDracoFile:function(e,t,r,a){var n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:a||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)},decodeGeometry:function(e,t){for(var r in t.attributeTypes){var a=t.attributeTypes[r];void 0!==a.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=a.name)}var n,o=JSON.stringify(t);if(s.taskCache.has(e)){var i=s.taskCache.get(e);if(i.key===o)return i.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var c=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(c,l).then((r=>(n=r,new Promise(((r,a)=>{n._callbacks[c]={resolve:r,reject:a},n.postMessage({type:"decode",id:c,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return u.catch((()=>!0)).then((()=>{n&&c&&this._releaseTask(n,c)})),s.taskCache.set(e,{key:o,promise:u}),u},_createGeometry:function(t){var r=new e.BufferGeometry;t.index&&r.setIndex(new e.BufferAttribute(t.index.array,1));for(var a=0;a<t.attributes.length;a++){var n=t.attributes[a],o=n.name,s=n.array,i=n.itemSize;r.setAttribute(o,new e.BufferAttribute(s,i))}return r},_loadLibrary:function(t,r){var a=new e.FileLoader(this.manager);return a.setPath(this.decoderPath),a.setResponseType(r),new Promise(((e,r)=>{a.load(t,e,void 0,r)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{var r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var a=s.DRACOWorker.toString(),n=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then((()=>{var r;this.workerPool.length<this.workerLimit?((r=new Worker(this.workerSourceURL))._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(r)):this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));return(r=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),s.DRACOWorker=function(){var e,t;function r(e,t,r,a,n,o){var s,i,c=o.num_components(),l=r.num_points()*c;switch(n){case Float32Array:s=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(r,o,s),i=new Float32Array(l);break;case Int8Array:s=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(r,o,s),i=new Int8Array(l);break;case Int16Array:s=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(r,o,s),i=new Int16Array(l);break;case Int32Array:s=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(r,o,s),i=new Int32Array(l);break;case Uint8Array:s=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(r,o,s),i=new Uint8Array(l);break;case Uint16Array:s=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(r,o,s),i=new Uint16Array(l);break;case Uint32Array:s=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(r,o,s),i=new Uint32Array(l);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var u=0;u<l;u++)i[u]=s.GetValue(u);return e.destroy(s),{name:a,array:i,itemSize:c}}onmessage=function(a){var n=a.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var o=n.buffer,s=n.taskConfig;t.then((e=>{var t=e.draco,a=new t.Decoder,i=new t.DecoderBuffer;i.Init(new Int8Array(o),o.byteLength);try{var c=function(e,t,a,n){var o,s,i=n.attributeIDs,c=n.attributeTypes,l=t.GetEncodedGeometryType(a);if(l===e.TRIANGULAR_MESH)o=new e.Mesh,s=t.DecodeBufferToMesh(a,o);else{if(l!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,s=t.DecodeBufferToPointCloud(a,o)}if(!s.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var u={index:null,attributes:[]};for(var d in i){var p,h,f=self[c[d]];if(n.useUniqueIDs)h=i[d],p=t.GetAttributeByUniqueId(o,h);else{if(-1===(h=t.GetAttributeId(o,e[i[d]])))continue;p=t.GetAttribute(o,h)}u.attributes.push(r(e,t,o,d,f,p))}if(l===e.TRIANGULAR_MESH){for(var m=o.num_faces(),g=new Uint32Array(3*m),v=new e.DracoInt32Array,y=0;y<m;++y){t.GetFaceFromMesh(o,y,v);for(var T=0;T<3;++T)g[3*y+T]=v.GetValue(T)}u.index={array:g,itemSize:1},e.destroy(v)}return e.destroy(o),u}(t,a,i,s),l=c.attributes.map((e=>e.array.buffer));c.index&&l.push(c.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:c},l)}catch(u){console.error(u),self.postMessage({type:"error",id:n.id,error:u.message})}finally{t.destroy(i),t.destroy(a)}}))}}},s.taskCache=new WeakMap,s.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},s.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},s.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},s.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var i=function(t){e.CompressedTextureLoader.call(this,t)};i.prototype=Object.assign(Object.create(e.CompressedTextureLoader.prototype),{constructor:i,parse:function(t,r){var a={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function n(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function o(e,t,r,a){for(var n=r*a*4,o=new Uint8Array(e,t,n),s=new Uint8Array(n),i=0,c=0,l=0;l<a;l++)for(var u=0;u<r;u++){var d=o[c],p=o[++c],h=o[++c],f=o[++c];c++,s[i]=h,s[++i]=p,s[++i]=d,s[++i]=f,i++}return s}var s,i=n("DXT1"),c=n("DXT3"),l=n("DXT5"),u=n("ETC1"),d=new Int32Array(t,0,31);if(542327876!==d[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),a;if(4&!d[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),a;var p,h=d[21],f=!1;switch(h){case i:s=8,a.format=e.RGB_S3TC_DXT1_Format;break;case c:s=16,a.format=e.RGBA_S3TC_DXT3_Format;break;case l:s=16,a.format=e.RGBA_S3TC_DXT5_Format;break;case u:s=8,a.format=e.RGB_ETC1_Format;break;default:if(!(32===d[22]&&16711680&d[23]&&65280&d[24]&&255&d[25]&&4278190080&d[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",(p=h,String.fromCharCode(255&p,p>>8&255,p>>16&255,p>>24&255))),a;f=!0,s=64,a.format=e.RGBAFormat}a.mipmapCount=1,131072&d[2]&&!1!==r&&(a.mipmapCount=Math.max(1,d[7]));var m=d[28];if(a.isCubemap=!!(512&m),a.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),a;a.width=d[4],a.height=d[3];for(var g=d[1]+4,v=a.isCubemap?6:1,y=0;y<v;y++)for(var T=a.width,M=a.height,A=0;A<a.mipmapCount;A++){if(f)var R=(S=o(t,g,T,M)).length;else{R=Math.max(4,T)/4*Math.max(4,M)/4*s;var S=new Uint8Array(t,g,R)}var b={data:S,width:T,height:M};a.mipmaps.push(b),g+=R,T=Math.max(T>>1,1),M=Math.max(M>>1,1)}return a}});var c=function(e){function t(t){var a=e.call(this)||this;return a.needsRender=!0,t&&t.children.length&&a.add.apply(a,t.children),a.mixer=new r.AnimationMixer(a),a}return n(t,e),t.prototype.clone=function(){var t=e.prototype.clone.call(this,!0),a=new r.AnimationMixer(t);return t.mixer=a,t.needsRender=!0,t},t}(r.Group),l=function(e){function t(t){var r=e.call(this,t)||this;return r.ddsLoader=new i(t),r.dracoLoader=new s(t),r.dracoLoader.setDecoderPath("https://vr-public.realsee-cdn.cn/release/static/image/release/five/resource/draco/1.5.6/"),r}return n(t,e),Object.defineProperty(t,"version",{get:function(){return"6.0.0-alpha.71"},enumerable:!1,configurable:!0}),t.prototype.load=function(t,r,a,n){return e.prototype.load.call(this,t,r,a,n)},t.prototype.parse=function(t,r,a,n){return e.prototype.parse.call(this,t,r,(function(e){var t=new c(e.scene),r=e.scenes.map((function(r){return r===e.scene?t:new c(r)}));a(Object.assign(e,{scene:t,scenes:r}))}),n)},t}(o);exports.DDSLoader=i,exports.DRACOLoader=s,exports.GLTFLoader=l,exports.GLTFObject=c,exports.THREEGLTFLoader=o;
|