12 |
- var BABYLON;!(function(e){var t;!(function(e){e[e.AUTO=0]="AUTO",e[e.PASS_THROUGH=1]="PASS_THROUGH",e[e.FORCE_RIGHT_HANDED=2]="FORCE_RIGHT_HANDED"})(t=e.GLTFLoaderCoordinateSystemMode||(e.GLTFLoaderCoordinateSystemMode={}));var r=(function(){function e(){this.coordinateSystemMode=t.AUTO,this.name="gltf",this.extensions={".gltf":{isBinary:!1},".glb":{isBinary:!0}}}return e.prototype.importMeshAsync=function(t,r,n,o,a,i,s){var l=e._parse(n,s);if(l){this.onParsed&&this.onParsed(l);var u=this._getLoader(l,s);u&&u.importMeshAsync(t,r,l,o,a,i,s)}},e.prototype.loadAsync=function(t,r,n,o,a,i){var s=e._parse(r,i);if(s){this.onParsed&&this.onParsed(s);var l=this._getLoader(s,i);if(l)return l.loadAsync(t,s,n,o,a,i)}},e.prototype.canDirectLoad=function(e){return e.indexOf("scene")!==-1&&e.indexOf("node")!==-1},e._parse=function(t,r){try{return t instanceof ArrayBuffer?e._parseBinary(t,r):{json:JSON.parse(t),bin:null}}catch(e){return r(e.message),null}},e.prototype._getLoader=function(t,r){var n={major:2,minor:0},o=t.json.asset||{},a=e._parseVersion(o.version);if(!a)return r("Invalid version: "+o.version),null;if(void 0!==o.minVersion){var i=e._parseVersion(o.minVersion);if(!i)return r("Invalid minimum version: "+o.minVersion),null;if(e._compareVersion(i,n)>0)return r("Incompatible minimum version: "+o.minVersion),null}var s={1:e.CreateGLTFLoaderV1,2:e.CreateGLTFLoaderV2},l=s[a.major];return l?l(this):(r("Unsupported version: "+o.version),null)},e._parseBinary=function(t,r){var o={Magic:1179937895},a=new n(t),i=a.readUint32();if(i!==o.Magic)return r("Unexpected magic: "+i),null;var s=a.readUint32();switch(s){case 1:return e._parseV1(a,r);case 2:return e._parseV2(a,r)}return r("Unsupported version: "+s),null},e._parseV1=function(t,r){var n={JSON:0},o=t.readUint32();if(o!=t.getLength())return r("Length in header does not match actual data length: "+o+" != "+t.getLength()),null;var a,i=t.readUint32(),s=t.readUint32();switch(s){case n.JSON:a=JSON.parse(e._decodeBufferToText(t.readUint8Array(i)));break;default:return r("Unexpected content format: "+s),null}var l=t.getLength()-t.getPosition();return{json:a,bin:t.readUint8Array(l)}},e._parseV2=function(t,r){var n={JSON:1313821514,BIN:5130562},o=t.readUint32();if(o!==t.getLength())return r("Length in header does not match actual data length: "+o+" != "+t.getLength()),null;var a=t.readUint32(),i=t.readUint32();if(i!==n.JSON)return r("First chunk format is not JSON"),null;for(var s=JSON.parse(e._decodeBufferToText(t.readUint8Array(a))),l=null;t.getPosition()<t.getLength();)switch(a=t.readUint32(),i=t.readUint32()){case n.JSON:return r("Unexpected JSON chunk"),null;case n.BIN:l=t.readUint8Array(a);break;default:t.skipBytes(a)}return{json:s,bin:l}},e._parseVersion=function(e){var t=(e+"").match(/^(\d+)\.(\d+)$/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null},e._compareVersion=function(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0},e._decodeBufferToText=function(e){for(var t="",r=e.byteLength,n=0;n<r;++n)t+=String.fromCharCode(e[n]);return t},e.HomogeneousCoordinates=!1,e.IncrementalLoading=!0,e})();e.GLTFFileLoader=r;var n=(function(){function e(e){this._arrayBuffer=e,this._dataView=new DataView(e),this._byteOffset=0}return e.prototype.getPosition=function(){return this._byteOffset},e.prototype.getLength=function(){return this._arrayBuffer.byteLength},e.prototype.readUint32=function(){var e=this._dataView.getUint32(this._byteOffset,!0);return this._byteOffset+=4,e},e.prototype.readUint8Array=function(e){var t=new Uint8Array(this._arrayBuffer,this._byteOffset,e);return this._byteOffset+=e,t},e.prototype.skipBytes=function(e){this._byteOffset+=e},e})();e.SceneLoader&&e.SceneLoader.RegisterPlugin(new r)})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){!(function(e){!(function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT"})(e.EComponentType||(e.EComponentType={}));!(function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(e.EMeshPrimitiveMode||(e.EMeshPrimitiveMode={}));!(function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR"})(e.ETextureMagFilter||(e.ETextureMagFilter={}));!(function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9729]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"})(e.ETextureMinFilter||(e.ETextureMinFilter={}));!(function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"})(e.ETextureWrapMode||(e.ETextureWrapMode={}))})(e.GLTF2||(e.GLTF2={}))})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){!(function(t){var r=(function(){function e(e){this._pendingCount=0,this._callback=e}return e.prototype._addPendingData=function(e){this._pendingCount++},e.prototype._removePendingData=function(e){0==--this._pendingCount&&this._callback()},e})(),n=(function(){function n(t){this._renderReady=!1,this._disposed=!1,this._renderReadyObservable=new e.Observable,this._renderPendingCount=0,this._loaderPendingCount=0,this._loaderTrackers=new Array,this._parent=t}return n.RegisterExtension=function(r){if(n.Extensions[r.name])return void e.Tools.Error("Extension with the same name '"+r.name+"' already exists");n.Extensions[r.name]=r,t.GLTFLoaderExtension._Extensions.push(r)},n.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._gltf.textures&&this._gltf.textures.forEach((function(e){e.url&&URL.revokeObjectURL(e.url)})),this._gltf=void 0,this._babylonScene=void 0,this._rootUrl=void 0,this._defaultMaterial=void 0,this._successCallback=void 0,this._errorCallback=void 0,this._renderReady=!1,this._renderReadyObservable.clear(),this._renderPendingCount=0,this._loaderPendingCount=0)},n.prototype.importMeshAsync=function(e,t,r,n,o,a,i){var s=this;this._loadAsync(e,t,r,n,(function(){o(s._getMeshes(),null,s._getSkeletons())}),a,i)},n.prototype.loadAsync=function(e,t,r,n,o,a){this._loadAsync(null,e,t,r,n,o,a)},n.prototype._loadAsync=function(e,r,n,o,a,i,s){var l=this;this._tryCatchOnError((function(){l._loadData(n),l._babylonScene=r,l._rootUrl=o,l._successCallback=a,l._progressCallback=i,l._errorCallback=s,t.GLTFUtils.AssignIndices(l._gltf.accessors),t.GLTFUtils.AssignIndices(l._gltf.animations),t.GLTFUtils.AssignIndices(l._gltf.buffers),t.GLTFUtils.AssignIndices(l._gltf.bufferViews),t.GLTFUtils.AssignIndices(l._gltf.images),t.GLTFUtils.AssignIndices(l._gltf.materials),t.GLTFUtils.AssignIndices(l._gltf.meshes),t.GLTFUtils.AssignIndices(l._gltf.nodes),t.GLTFUtils.AssignIndices(l._gltf.scenes),t.GLTFUtils.AssignIndices(l._gltf.skins),t.GLTFUtils.AssignIndices(l._gltf.textures),l._addPendingData(l),l._loadDefaultScene(e),l._loadAnimations(),l._removePendingData(l)}))},n.prototype._onError=function(t){this._disposed||(e.Tools.Error("glTF Loader: "+t),this._errorCallback&&this._errorCallback(t),this.dispose())},n.prototype._onProgress=function(e){this._disposed||this._progressCallback&&this._progressCallback(e)},n.prototype._executeWhenRenderReady=function(e){this._renderReady?e():this._renderReadyObservable.add(e)},n.prototype._onRenderReady=function(){this._rootNode.babylonMesh.setEnabled(!0),this._startAnimations(),this._successCallback(),this._renderReadyObservable.notifyObservers(this),this._parent.onReady&&this._parent.onReady()},n.prototype._onComplete=function(){this._parent.onComplete&&this._parent.onComplete(),this.dispose()},n.prototype._loadData=function(t){if(this._gltf=t.json,t.bin){var r=this._gltf.buffers;if(r&&r[0]&&!r[0].uri){var n=r[0];n.byteLength!=t.bin.byteLength&&e.Tools.Warn("Binary buffer length ("+n.byteLength+") from JSON does not match chunk length ("+t.bin.byteLength+")"),n.loadedData=t.bin}else e.Tools.Warn("Unexpected BIN chunk")}},n.prototype._getMeshes=function(){var e=[this._rootNode.babylonMesh],t=this._gltf.nodes;return t&&t.forEach((function(t){t.babylonMesh&&e.push(t.babylonMesh)})),e},n.prototype._getSkeletons=function(){var t=new Array,r=this._gltf.skins;return r&&r.forEach((function(r){r.babylonSkeleton instanceof e.Skeleton&&t.push(r.babylonSkeleton)})),t},n.prototype._getAnimationTargets=function(){var e=new Array,t=this._gltf.animations;return t&&t.forEach((function(t){e.push.apply(e,t.targets)})),e},n.prototype._startAnimations=function(){var e=this;this._getAnimationTargets().forEach((function(t){return e._babylonScene.beginAnimation(t,0,Number.MAX_VALUE,!0)}))},n.prototype._loadDefaultScene=function(e){var r=t.GLTFUtils.GetArrayItem(this._gltf.scenes,this._gltf.scene||0);if(!r)throw new Error("Failed to find scene "+(this._gltf.scene||0));this._loadScene("#/scenes/"+r.index,r,e)},n.prototype._loadScene=function(r,n,o){switch(this._rootNode={babylonMesh:new e.Mesh("__root__",this._babylonScene)},this._parent.coordinateSystemMode){case e.GLTFLoaderCoordinateSystemMode.AUTO:this._babylonScene.useRightHandedSystem||(this._rootNode.babylonMesh.rotation=new e.Vector3(0,Math.PI,0),this._rootNode.babylonMesh.scaling=new e.Vector3(1,1,-1));break;case e.GLTFLoaderCoordinateSystemMode.PASS_THROUGH:break;case e.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:return void e.Tools.Error("Invalid coordinate system mode ("+this._parent.coordinateSystemMode+")")}var a=n.nodes;if(this._traverseNodes(r,a,(function(e,t){return e.parent=t,!0}),this._rootNode),o){o instanceof Array||(o=[o]);var i=new Array;this._traverseNodes(r,a,(function(e){return o.indexOf(e.name)===-1||(i.push(e.index),!1)}),this._rootNode),a=i}for(var s=0;s<a.length;s++){var l=t.GLTFUtils.GetArrayItem(this._gltf.nodes,a[s]);if(!l)throw new Error(r+": Failed to find node "+a[s]);this._loadNode("#/nodes/"+a[s],l)}this._rootNode.babylonMesh.setEnabled(!1)},n.prototype._loadNode=function(r,n){if(!t.GLTFLoaderExtension.LoadNode(this,r,n)){if(n.babylonMesh=new e.Mesh(n.name||"mesh"+n.index,this._babylonScene),this._loadTransform(n),null!=n.mesh){var o=t.GLTFUtils.GetArrayItem(this._gltf.meshes,n.mesh);if(!o)throw new Error(r+": Failed to find mesh "+n.mesh);this._loadMesh("#/meshes/"+n.mesh,n,o)}if(n.babylonMesh.parent=n.parent?n.parent.babylonMesh:null,n.babylonAnimationTargets=n.babylonAnimationTargets||[],n.babylonAnimationTargets.push(n.babylonMesh),null!=n.skin){var a=t.GLTFUtils.GetArrayItem(this._gltf.skins,n.skin);if(!a)throw new Error(r+": Failed to find skin "+n.skin);n.babylonMesh.skeleton=this._loadSkin("#/skins/"+n.skin,a)}if(n.camera,n.children)for(var i=0;i<n.children.length;i++){var s=t.GLTFUtils.GetArrayItem(this._gltf.nodes,n.children[i]);if(!s)throw new Error(r+": Failed to find child node "+n.children[i]);this._loadNode("#/nodes/"+n.children[i],s)}}},n.prototype._loadMesh=function(t,r,n){r.babylonMesh.name=n.name||r.babylonMesh.name;var o=new e.MultiMaterial(r.babylonMesh.name,this._babylonScene);r.babylonMesh.material=o;var a=new e.Geometry(r.babylonMesh.name,this._babylonScene,null,!1,r.babylonMesh),i=new e.VertexData;i.positions=[],i.indices=[];for(var s=[],l=n.primitives.length,u=0;u<n.primitives.length;u++){var d=n.primitives[u];this._loadPrimitive(t+"/primitives/"+u,r,n,d,(function(t,n){if(s.push({verticesStart:i.positions.length,verticesCount:t.positions.length,indicesStart:i.indices.length,indicesCount:t.indices.length,loadMaterial:n}),i.merge(t),0==--l){a.setAllVerticesData(i,!1),r.babylonMesh.subMeshes=[];for(var o=0;o<s.length;o++){var u=s[o];e.SubMesh.AddToMesh(o,u.verticesStart,u.verticesCount,u.indicesStart,u.indicesCount,r.babylonMesh),u.loadMaterial(o)}}}))}},n.prototype._loadPrimitive=function(e,r,n,o,a){var i=this,s=r.babylonMesh.material.subMaterials;if(o.mode&&o.mode!==t.EMeshPrimitiveMode.TRIANGLES)throw new Error(e+": Mode "+o.mode+" is not currently supported");this._createMorphTargets(r,n,o),this._loadVertexDataAsync(e,n,o,(function(l){i._loadMorphTargetsData(e,n,o,l,r.babylonMesh),a(l,(function(n){if(null==o.material)s[n]=i._getDefaultMaterial();else{var a=t.GLTFUtils.GetArrayItem(i._gltf.materials,o.material);if(!a)throw new Error(e+": Failed to find material "+o.material);i._loadMaterial("#/materials/"+a.index,a,(function(e,t){t&&i._parent.onMaterialLoaded&&i._parent.onMaterialLoaded(e),i._parent.onBeforeMaterialReadyAsync?(i._addLoaderPendingData(a),i._parent.onBeforeMaterialReadyAsync(e,r.babylonMesh,null!=s[n],(function(){s[n]=e,i._removeLoaderPendingData(a)}))):s[n]=e}))}}))}))},n.prototype._loadVertexDataAsync=function(r,n,o,a){var i=this,s=o.attributes;if(!s)throw new Error(r+": Attributes are missing");var l,u=new e.VertexData,d=Object.keys(s).length,c=this;for(var f in s)!(function(n){if(!(l=t.GLTFUtils.GetArrayItem(c._gltf.accessors,s[n])))throw new Error(r+": Failed to find attribute '"+n+"' accessor "+s[n]);c._loadAccessorAsync("#/accessors/"+l.index,l,(function(s){switch(n){case"NORMAL":u.normals=s;break;case"POSITION":u.positions=s;break;case"TANGENT":u.tangents=s;break;case"TEXCOORD_0":u.uvs=s;break;case"TEXCOORD_1":u.uvs2=s;break;case"JOINTS_0":u.matricesIndices=new Float32Array(Array.prototype.slice.apply(s));break;case"WEIGHTS_0":u.matricesWeights=s;break;case"COLOR_0":u.colors=s;break;default:e.Tools.Warn("Ignoring unrecognized attribute '"+n+"'")}if(0==--d)if(null==o.indices)u.indices=new Uint32Array(u.positions.length/3),u.indices.forEach((function(e,t){return u.indices[t]=t})),a(u);else{var l=t.GLTFUtils.GetArrayItem(i._gltf.accessors,o.indices);if(!l)throw new Error(r+": Failed to find indices accessor "+o.indices);i._loadAccessorAsync("#/accessors/"+l.index,l,(function(e){u.indices=e,a(u)}))}}))})(f)},n.prototype._createMorphTargets=function(t,r,n){var o=n.targets;if(o){t.babylonMesh.morphTargetManager||(t.babylonMesh.morphTargetManager=new e.MorphTargetManager);for(var a=0;a<o.length;a++){var i=t.weights?t.weights[a]:r.weights?r.weights[a]:0;t.babylonMesh.morphTargetManager.addTarget(new e.MorphTarget("morphTarget"+a,i))}}},n.prototype._loadMorphTargetsData=function(r,n,o,a,i){var s=o.targets;if(s)for(var l,u,d=this,c=0;c<s.length;c++)!(function(){var n=i.morphTargetManager.getTarget(c);l=s[c];for(var o in l)!(function(o){if(!(u=t.GLTFUtils.GetArrayItem(d._gltf.accessors,l[o])))throw new Error(r+"/targets/"+c+": Failed to find attribute '"+o+"' accessor "+l[o]);d._loadAccessorAsync("#/accessors/"+u.index,u,(function(r){u.name&&(n.name=u.name);var i=r;switch(o){case"NORMAL":t.GLTFUtils.ForEach(i,(function(e,t){return i[t]+=a.normals[t]})),n.setNormals(i);break;case"POSITION":t.GLTFUtils.ForEach(i,(function(e,t){return i[t]+=a.positions[t]})),n.setPositions(i);break;case"TANGENT":for(var s=0,l=0;s<i.length;s++,l++)i[s]+=a.tangents[l],(s+1)%3==0&&l++;n.setTangents(i);break;default:e.Tools.Warn("Ignoring unrecognized attribute '"+o+"'")}}))})(o)})()},n.prototype._loadTransform=function(t){var r=e.Vector3.Zero(),n=e.Quaternion.Identity(),o=e.Vector3.One();if(t.matrix){e.Matrix.FromArray(t.matrix).decompose(o,n,r)}else t.translation&&(r=e.Vector3.FromArray(t.translation)),t.rotation&&(n=e.Quaternion.FromArray(t.rotation)),t.scale&&(o=e.Vector3.FromArray(t.scale));t.babylonMesh.position=r,t.babylonMesh.rotationQuaternion=n,t.babylonMesh.scaling=o},n.prototype._loadSkin=function(r,n){var o=this,a="skeleton"+n.index;if(n.babylonSkeleton=new e.Skeleton(n.name||a,a,this._babylonScene),null==n.inverseBindMatrices)this._loadBones(r,n,null);else{var i=t.GLTFUtils.GetArrayItem(this._gltf.accessors,n.inverseBindMatrices);if(!i)throw new Error(r+": Failed to find inverse bind matrices attribute "+n.inverseBindMatrices);this._loadAccessorAsync("#/accessors/"+i.index,i,(function(e){o._loadBones(r,n,e)}))}return n.babylonSkeleton},n.prototype._createBone=function(t,r,n,o,a,i){var s=new e.Bone(t.name||"bone"+t.index,r.babylonSkeleton,n,o,null,a,i);return t.babylonBones=t.babylonBones||{},t.babylonBones[r.index]=s,t.babylonAnimationTargets=t.babylonAnimationTargets||[],t.babylonAnimationTargets.push(s),s},n.prototype._loadBones=function(e,r,n){for(var o={},a=0;a<r.joints.length;a++){var i=t.GLTFUtils.GetArrayItem(this._gltf.nodes,r.joints[a]);if(!i)throw new Error(e+": Failed to find joint "+r.joints[a]);this._loadBone(i,r,n,o)}},n.prototype._loadBone=function(t,r,n,o){var a=o[t.index];if(a)return a;var i=r.joints.indexOf(t.index),s=e.Matrix.Identity();n&&i!==-1&&(s=e.Matrix.FromArray(n,16*i),s.invertToRef(s));var l;return t.index!==r.skeleton&&t.parent!==this._rootNode&&(l=this._loadBone(t.parent,r,n,o),s.multiplyToRef(l.getInvertedAbsoluteTransform(),s)),a=this._createBone(t,r,l,this._getNodeMatrix(t),s,i),o[t.index]=a,a},n.prototype._getNodeMatrix=function(t){return t.matrix?e.Matrix.FromArray(t.matrix):e.Matrix.Compose(t.scale?e.Vector3.FromArray(t.scale):e.Vector3.One(),t.rotation?e.Quaternion.FromArray(t.rotation):e.Quaternion.Identity(),t.translation?e.Vector3.FromArray(t.translation):e.Vector3.Zero())},n.prototype._traverseNodes=function(e,r,n,o){void 0===o&&(o=null);for(var a=0;a<r.length;a++){var i=t.GLTFUtils.GetArrayItem(this._gltf.nodes,r[a]);if(!i)throw new Error(e+": Failed to find node "+r[a]);this._traverseNode(e,i,n,o)}},n.prototype._traverseNode=function(e,r,n,o){void 0===o&&(o=null),t.GLTFLoaderExtension.TraverseNode(this,e,r,n,o)||n(r,o)&&r.children&&this._traverseNodes(e,r.children,n,r)},n.prototype._loadAnimations=function(){var e=this._gltf.animations;if(e)for(var r=0;r<e.length;r++)for(var n=e[r],o="#/animations/"+r,a=0;a<n.channels.length;a++){var i=t.GLTFUtils.GetArrayItem(n.channels,a);if(!i)throw new Error(o+": Failed to find channel "+a);var s=t.GLTFUtils.GetArrayItem(n.samplers,i.sampler);if(!s)throw new Error(o+": Failed to find sampler "+i.sampler);this._loadAnimationChannel(n,o+"/channels/"+a,i,o+"/samplers/"+i.sampler,s)}},n.prototype._loadAnimationChannel=function(r,n,o,a,i){var s=t.GLTFUtils.GetArrayItem(this._gltf.nodes,o.target.node);if(!s)throw new Error(n+": Failed to find target node "+o.target.node);var l,u;switch(o.target.path){case"translation":l="position",u=e.Animation.ANIMATIONTYPE_VECTOR3;break;case"rotation":l="rotationQuaternion",u=e.Animation.ANIMATIONTYPE_QUATERNION;break;case"scale":l="scaling",u=e.Animation.ANIMATIONTYPE_VECTOR3;break;case"weights":l="influence",u=e.Animation.ANIMATIONTYPE_FLOAT;break;default:throw new Error(n+": Invalid target path '"+o.target.path+"'")}var d,c,f=function(){if(d&&c){var t,n=0;switch(l){case"position":t=function(){var t=e.Vector3.FromArray(c,n);return n+=3,t};break;case"rotationQuaternion":t=function(){var t=e.Quaternion.FromArray(c,n);return n+=4,t};break;case"scaling":t=function(){var t=e.Vector3.FromArray(c,n);return n+=3,t};break;case"influence":t=function(){for(var e=s.babylonMesh.morphTargetManager.numTargets,t=new Array(e),r=0;r<e;r++)t[r]=c[n++];return t}}var o;switch(i.interpolation){case"LINEAR":o=function(e){return{frame:d[e],value:t()}};break;case"CUBICSPLINE":o=function(e){return{frame:d[e],inTangent:t(),value:t(),outTangent:t()}};break;default:throw new Error(a+": Invalid interpolation '"+i.interpolation+"'")}for(var f=new Array(d.length),h=0;h<d.length;h++)f[h]=o(h);if(r.targets=r.targets||[],"influence"===l)for(var _=s.babylonMesh.morphTargetManager,p=0;p<_.numTargets;p++){var y=_.getTarget(p),T=(r.name||"anim"+r.index)+"_"+p,b=new e.Animation(T,l,1,u);b.setKeys(f.map((function(e){return{frame:e.frame,inTangent:e.inTangent?e.inTangent[p]:void 0,value:e.value[p],outTangent:e.outTangent?e.outTangent[p]:void 0}}))),y.animations.push(b),r.targets.push(y)}else{var T=r.name||"anim"+r.index,b=new e.Animation(T,l,1,u);b.setKeys(f);for(var E=0;E<s.babylonAnimationTargets.length;E++){var A=s.babylonAnimationTargets[E];A.animations.push(b.clone()),r.targets.push(A)}}}},h=t.GLTFUtils.GetArrayItem(this._gltf.accessors,i.input);if(!h)throw new Error(a+": Failed to find input accessor "+i.input);this._loadAccessorAsync("#/accessors/"+h.index,h,(function(e){d=e,f()}));var _=t.GLTFUtils.GetArrayItem(this._gltf.accessors,i.output);if(!_)throw new Error(a+": Failed to find output accessor "+i.output);this._loadAccessorAsync("#/accessors/"+_.index,_,(function(e){c=e,f()}))},n.prototype._loadBufferAsync=function(r,n,o){var a=this;if(this._addPendingData(n),n.loadedData)o(n.loadedData),this._removePendingData(n);else if(n.loadedObservable)n.loadedObservable.add((function(e){o(e.loadedData),a._removePendingData(e)}));else{if(!n.uri)throw new Error(r+": Uri is missing");if(t.GLTFUtils.IsBase64(n.uri)){var i=t.GLTFUtils.DecodeBase64(n.uri);n.loadedData=new Uint8Array(i),o(n.loadedData),this._removePendingData(n)}else{if(!t.GLTFUtils.ValidateUri(n.uri))throw new Error(r+": Uri '"+n.uri+"' is invalid");n.loadedObservable=new e.Observable,n.loadedObservable.add((function(e){o(e.loadedData),a._removePendingData(e)})),e.Tools.LoadFile(this._rootUrl+n.uri,(function(e){a._tryCatchOnError((function(){n.loadedData=new Uint8Array(e),n.loadedObservable.notifyObservers(n),n.loadedObservable=null}))}),(function(e){a._tryCatchOnError((function(){a._onProgress(e)}))}),this._babylonScene.database,!0,(function(e){a._tryCatchOnError((function(){throw new Error(r+": Failed to load '"+n.uri+"'"+(e?": "+e.status+" "+e.statusText:""))}))}))}}},n.prototype._loadBufferViewAsync=function(e,r,n){var o=this,a=t.GLTFUtils.GetArrayItem(this._gltf.buffers,r.buffer);if(!a)throw new Error(e+": Failed to find buffer "+r.buffer);this._loadBufferAsync("#/buffers/"+a.index,a,(function(t){if(!o._disposed){try{var a=new Uint8Array(t.buffer,t.byteOffset+(r.byteOffset||0),r.byteLength)}catch(t){throw new Error(e+": "+t.message)}n(a)}}))},n.prototype._loadAccessorAsync=function(e,r,n){var o=this;if(r.sparse)throw new Error(e+": Sparse accessors are not currently supported");if(r.normalized)throw new Error(e+": Normalized accessors are not currently supported");var a=t.GLTFUtils.GetArrayItem(this._gltf.bufferViews,r.bufferView);if(!a)throw new Error(e+": Failed to find buffer view "+r.bufferView);this._loadBufferViewAsync("#/bufferViews/"+a.index,a,(function(i){var s=o._getNumComponentsOfType(r.type);if(0===s)throw new Error(e+": Invalid type ("+r.type+")");var l;switch(r.componentType){case t.EComponentType.BYTE:l=o._buildArrayBuffer(Float32Array,e,i,r.byteOffset,r.count,s,a.byteStride);break;case t.EComponentType.UNSIGNED_BYTE:l=o._buildArrayBuffer(Uint8Array,e,i,r.byteOffset,r.count,s,a.byteStride);break;case t.EComponentType.SHORT:l=o._buildArrayBuffer(Int16Array,e,i,r.byteOffset,r.count,s,a.byteStride);break;case t.EComponentType.UNSIGNED_SHORT:l=o._buildArrayBuffer(Uint16Array,e,i,r.byteOffset,r.count,s,a.byteStride);break;case t.EComponentType.UNSIGNED_INT:l=o._buildArrayBuffer(Uint32Array,e,i,r.byteOffset,r.count,s,a.byteStride);break;case t.EComponentType.FLOAT:l=o._buildArrayBuffer(Float32Array,e,i,r.byteOffset,r.count,s,a.byteStride);break;default:throw new Error(e+": Invalid component type ("+r.componentType+")")}n(l)}))},n.prototype._getNumComponentsOfType=function(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}return 0},n.prototype._buildArrayBuffer=function(e,t,r,n,o,a,i){try{var n=r.byteOffset+(n||0),s=o*a;if(null==i||i===a*e.BYTES_PER_ELEMENT)return new e(r.buffer,n,s);for(var l=i/e.BYTES_PER_ELEMENT,u=new e(r.buffer,n,l*o),d=new e(s),c=0,f=0;f<s;){for(var h=0;h<a;h++)d[f]=u[c+h],f++;c+=l}return d}catch(e){throw new Error(t+": "+e)}},n.prototype._addPendingData=function(e){this._renderReady||this._renderPendingCount++,this._addLoaderPendingData(e)},n.prototype._removePendingData=function(e){this._renderReady||0==--this._renderPendingCount&&(this._renderReady=!0,this._onRenderReady()),this._removeLoaderPendingData(e)},n.prototype._addLoaderPendingData=function(e){this._loaderPendingCount++,this._loaderTrackers.forEach((function(t){return t._addPendingData(e)}))},n.prototype._removeLoaderPendingData=function(e){this._loaderTrackers.forEach((function(t){return t._removePendingData(e)})),0==--this._loaderPendingCount&&this._onComplete()},n.prototype._whenAction=function(e,t){var n=this,o=new r(function(){n._loaderTrackers.splice(n._loaderTrackers.indexOf(o)),t()});this._loaderTrackers.push(o),this._addLoaderPendingData(o),e(),this._removeLoaderPendingData(o)},n.prototype._getDefaultMaterial=function(){if(!this._defaultMaterial){var t="__gltf_default",r=this._babylonScene.getMaterialByName(t);r||(r=new e.PBRMaterial(t,this._babylonScene),r.sideOrientation=e.Material.CounterClockWiseSideOrientation,r.metallic=1,r.roughness=1),this._defaultMaterial=r}return this._defaultMaterial},n.prototype._loadMaterialMetallicRoughnessProperties=function(r,n){var o=n.babylonMaterial;o.metallic=1,o.roughness=1;var a=n.pbrMetallicRoughness;if(a){if(o.albedoColor=a.baseColorFactor?e.Color3.FromArray(a.baseColorFactor):new e.Color3(1,1,1),o.metallic=null==a.metallicFactor?1:a.metallicFactor,o.roughness=null==a.roughnessFactor?1:a.roughnessFactor,a.baseColorTexture){var i=t.GLTFUtils.GetArrayItem(this._gltf.textures,a.baseColorTexture.index);if(!i)throw new Error(r+": Failed to find base color texture "+a.baseColorTexture.index);o.albedoTexture=this._loadTexture("#/textures/"+i.index,i,a.baseColorTexture.texCoord)}if(a.metallicRoughnessTexture){var i=t.GLTFUtils.GetArrayItem(this._gltf.textures,a.metallicRoughnessTexture.index);if(!i)throw new Error(r+": Failed to find metallic roughness texture "+a.metallicRoughnessTexture.index);o.metallicTexture=this._loadTexture("#/textures/"+i.index,i,a.metallicRoughnessTexture.texCoord),o.useMetallnessFromMetallicTextureBlue=!0,o.useRoughnessFromMetallicTextureGreen=!0,o.useRoughnessFromMetallicTextureAlpha=!1}this._loadMaterialAlphaProperties(r,n,a.baseColorFactor)}},n.prototype._loadMaterial=function(e,r,n){if(r.babylonMaterial)return void n(r.babylonMaterial,!1);t.GLTFLoaderExtension.LoadMaterial(this,e,r,n)||(this._createPbrMaterial(r),this._loadMaterialBaseProperties(e,r),this._loadMaterialMetallicRoughnessProperties(e,r),n(r.babylonMaterial,!0))},n.prototype._createPbrMaterial=function(t){var r=new e.PBRMaterial(t.name||"mat"+t.index,this._babylonScene);r.sideOrientation=e.Material.CounterClockWiseSideOrientation,t.babylonMaterial=r},n.prototype._loadMaterialBaseProperties=function(r,n){var o=n.babylonMaterial;if(o.emissiveColor=n.emissiveFactor?e.Color3.FromArray(n.emissiveFactor):new e.Color3(0,0,0),n.doubleSided&&(o.backFaceCulling=!1,o.twoSidedLighting=!0),n.normalTexture){var a=t.GLTFUtils.GetArrayItem(this._gltf.textures,n.normalTexture.index);if(!a)throw new Error(r+": Failed to find normal texture "+n.normalTexture.index);o.bumpTexture=this._loadTexture("#/textures/"+a.index,a,n.normalTexture.texCoord),o.invertNormalMapX=!this._babylonScene.useRightHandedSystem,o.invertNormalMapY=this._babylonScene.useRightHandedSystem,null!=n.normalTexture.scale&&(o.bumpTexture.level=n.normalTexture.scale)}if(n.occlusionTexture){var a=t.GLTFUtils.GetArrayItem(this._gltf.textures,n.occlusionTexture.index);if(!a)throw new Error(r+": Failed to find occlusion texture "+n.occlusionTexture.index);o.ambientTexture=this._loadTexture("#/textures/"+a.index,a,n.occlusionTexture.texCoord),o.useAmbientInGrayScale=!0,null!=n.occlusionTexture.strength&&(o.ambientTextureStrength=n.occlusionTexture.strength)}if(n.emissiveTexture){var a=t.GLTFUtils.GetArrayItem(this._gltf.textures,n.emissiveTexture.index);if(!a)throw new Error(r+": Failed to find emissive texture "+n.emissiveTexture.index);o.emissiveTexture=this._loadTexture("#/textures/"+a.index,a,n.emissiveTexture.texCoord)}},n.prototype._loadMaterialAlphaProperties=function(e,t,r){var n=t.babylonMaterial;switch(t.alphaMode||"OPAQUE"){case"OPAQUE":break;case"MASK":n.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,r&&(0==r[3]?n.alphaCutOff=1:n.alphaCutOff/=r[3]),n.albedoTexture&&(n.albedoTexture.hasAlpha=!0);break;case"BLEND":r&&(n.alpha=r[3]),n.albedoTexture&&(n.albedoTexture.hasAlpha=!0,n.useAlphaFromAlbedoTexture=!0);break;default:throw new Error(e+": Invalid alpha mode '"+t.alphaMode+"'")}},n.prototype._loadTexture=function(r,n,o){var a=this,i=null==n.sampler?{}:t.GLTFUtils.GetArrayItem(this._gltf.samplers,n.sampler);if(!i)throw new Error(r+": Failed to find sampler "+n.sampler);var s=i.minFilter===t.ETextureMinFilter.NEAREST||i.minFilter===t.ETextureMinFilter.LINEAR,l=t.GLTFUtils.GetTextureSamplingMode(i.magFilter,i.minFilter);this._addPendingData(n);var u=new e.Texture(null,this._babylonScene,s,!1,l,function(){a._tryCatchOnError((function(){a._removePendingData(n)}))},function(e){a._tryCatchOnError((function(){throw new Error(r+": "+e)}))});if(n.url)u.updateURL(n.url);else if(n.dataReadyObservable)n.dataReadyObservable.add((function(e){u.updateURL(e.url)}));else{n.dataReadyObservable=new e.Observable,n.dataReadyObservable.add((function(e){u.updateURL(e.url)}));var d=t.GLTFUtils.GetArrayItem(this._gltf.images,n.source);if(!d)throw new Error(r+": Failed to find source "+n.source);this._loadImage("#/images/"+d.index,d,(function(e){n.url=URL.createObjectURL(new Blob([e],{type:d.mimeType})),n.dataReadyObservable.notifyObservers(n)}))}return u.coordinatesIndex=o||0,u.wrapU=t.GLTFUtils.GetTextureWrapMode(i.wrapS),u.wrapV=t.GLTFUtils.GetTextureWrapMode(i.wrapT),u.name=n.name||"texture"+n.index,this._parent.onTextureLoaded&&this._parent.onTextureLoaded(u),u},n.prototype._loadImage=function(r,n,o){var a=this;if(n.uri){if(!t.GLTFUtils.ValidateUri(n.uri))throw new Error(r+": Uri '"+n.uri+"' is invalid");t.GLTFUtils.IsBase64(n.uri)?o(new Uint8Array(t.GLTFUtils.DecodeBase64(n.uri))):e.Tools.LoadFile(this._rootUrl+n.uri,(function(e){a._tryCatchOnError((function(){o(e)}))}),(function(e){a._tryCatchOnError((function(){a._onProgress(e)}))}),this._babylonScene.database,!0,(function(e){a._tryCatchOnError((function(){throw new Error(r+": Failed to load '"+n.uri+"'"+(e?": "+e.status+" "+e.statusText:""))}))}))}else{var i=t.GLTFUtils.GetArrayItem(this._gltf.bufferViews,n.bufferView);if(!i)throw new Error(r+": Failed to find buffer view "+n.bufferView);this._loadBufferViewAsync("#/bufferViews/"+i.index,i,o)}},n.prototype._tryCatchOnError=function(e){try{e()}catch(e){this._onError(e.message)}},n.Extensions={},n})();t.GLTFLoader=n,e.GLTFFileLoader.CreateGLTFLoaderV2=function(e){return new n(e)}})(e.GLTF2||(e.GLTF2={}))})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){!(function(t){var r=(function(){function r(){}return r.IsBase64=function(e){return!(e.length<5)&&"data:"===e.substr(0,5)},r.DecodeBase64=function(e){for(var t=atob(e.split(",")[1]),r=t.length,n=new Uint8Array(new ArrayBuffer(r)),o=0;o<r;o++)n[o]=t.charCodeAt(o);return n.buffer},r.ForEach=function(e,t){for(var r=0;r<e.length;r++)t(e[r],r)},r.ValidateUri=function(e){return e.indexOf("..")===-1},r.AssignIndices=function(e){if(e)for(var t=0;t<e.length;t++)e[t].index=t},r.GetArrayItem=function(e,t){return e&&e[t]?e[t]:null},r.GetTextureWrapMode=function(r){switch(r=void 0===r?t.ETextureWrapMode.REPEAT:r){case t.ETextureWrapMode.CLAMP_TO_EDGE:return e.Texture.CLAMP_ADDRESSMODE;case t.ETextureWrapMode.MIRRORED_REPEAT:return e.Texture.MIRROR_ADDRESSMODE;case t.ETextureWrapMode.REPEAT:return e.Texture.WRAP_ADDRESSMODE;default:return e.Tools.Warn("Invalid texture wrap mode ("+r+")"),e.Texture.WRAP_ADDRESSMODE}},r.GetTextureSamplingMode=function(r,n){if(r=void 0===r?t.ETextureMagFilter.LINEAR:r,n=void 0===n?t.ETextureMinFilter.LINEAR_MIPMAP_LINEAR:n,r===t.ETextureMagFilter.LINEAR)switch(n){case t.ETextureMinFilter.NEAREST:return e.Texture.LINEAR_NEAREST;case t.ETextureMinFilter.LINEAR:return e.Texture.LINEAR_LINEAR;case t.ETextureMinFilter.NEAREST_MIPMAP_NEAREST:return e.Texture.LINEAR_NEAREST_MIPNEAREST;case t.ETextureMinFilter.LINEAR_MIPMAP_NEAREST:return e.Texture.LINEAR_LINEAR_MIPNEAREST;case t.ETextureMinFilter.NEAREST_MIPMAP_LINEAR:return e.Texture.LINEAR_NEAREST_MIPLINEAR;case t.ETextureMinFilter.LINEAR_MIPMAP_LINEAR:
- return e.Texture.LINEAR_LINEAR_MIPLINEAR;default:return e.Tools.Warn("Invalid texture minification filter ("+n+")"),e.Texture.LINEAR_LINEAR_MIPLINEAR}else switch(r!==t.ETextureMagFilter.NEAREST&&e.Tools.Warn("Invalid texture magnification filter ("+r+")"),n){case t.ETextureMinFilter.NEAREST:return e.Texture.NEAREST_NEAREST;case t.ETextureMinFilter.LINEAR:return e.Texture.NEAREST_LINEAR;case t.ETextureMinFilter.NEAREST_MIPMAP_NEAREST:return e.Texture.NEAREST_NEAREST_MIPNEAREST;case t.ETextureMinFilter.LINEAR_MIPMAP_NEAREST:return e.Texture.NEAREST_LINEAR_MIPNEAREST;case t.ETextureMinFilter.NEAREST_MIPMAP_LINEAR:return e.Texture.NEAREST_NEAREST_MIPLINEAR;case t.ETextureMinFilter.LINEAR_MIPMAP_LINEAR:return e.Texture.NEAREST_LINEAR_MIPLINEAR;default:return e.Tools.Warn("Invalid texture minification filter ("+n+")"),e.Texture.NEAREST_NEAREST_MIPNEAREST}},r})();t.GLTFUtils=r})(e.GLTF2||(e.GLTF2={}))})(BABYLON||(BABYLON={}));var BABYLON;!(function(e){!(function(e){var t=(function(){function e(){this.enabled=!0}return e.prototype._traverseNode=function(e,t,r,n,o){return!1},e.prototype._loadNode=function(e,t,r){return!1},e.prototype._loadMaterial=function(e,t,r,n){return!1},e.prototype._loadExtension=function(e,t){var r=this;if(!e.extensions)return!1;var n=e.extensions[this.name];return!!n&&(e.extensions[this.name]=void 0,t(n,(function(){e.extensions[r.name]=n})),!0)},e.TraverseNode=function(e,t,r,n,o){return this._ApplyExtensions((function(a){return a._traverseNode(e,t,r,n,o)}))},e.LoadNode=function(e,t,r){return this._ApplyExtensions((function(n){return n._loadNode(e,t,r)}))},e.LoadMaterial=function(e,t,r,n){return this._ApplyExtensions((function(o){return o._loadMaterial(e,t,r,n)}))},e._ApplyExtensions=function(t){var r=e._Extensions;if(!r)return!1;for(var n=0;n<r.length;n++){var o=r[n];if(o.enabled&&t(o))return!0}return!1},e._Extensions=[],e})();e.GLTFLoaderExtension=t})(e.GLTF2||(e.GLTF2={}))})(BABYLON||(BABYLON={}));var __extends=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}})(),BABYLON;!(function(e){!(function(t){!(function(r){var n=(function(r){function n(){return null!==r&&r.apply(this,arguments)||this}return __extends(n,r),Object.defineProperty(n.prototype,"name",{get:function(){return"MSFT_lod"},enumerable:!0,configurable:!0}),n.prototype._traverseNode=function(e,r,n,o,a){return this._loadExtension(n,(function(i,s){for(var l=i.ids.length-1;l>=0;l--){var u=t.GLTFUtils.GetArrayItem(e._gltf.nodes,i.ids[l]);if(!u)throw new Error(r+": Failed to find node "+i.ids[l]);e._traverseNode(r,u,o,a)}e._traverseNode(r,n,o,a),s()}))},n.prototype._loadNode=function(e,t,r){var n=this;return this._loadExtension(r,(function(o,a){var i=[r.index].concat(o.ids).map((function(t){return e._gltf.nodes[t]}));e._addLoaderPendingData(r),n._loadNodeLOD(e,t,i,i.length-1,(function(){e._removeLoaderPendingData(r),a()}))}))},n.prototype._loadNodeLOD=function(e,t,r,o,a){var i=this;e._whenAction((function(){e._loadNode(t,r[o])}),(function(){if(o!==r.length-1){r[o+1].babylonMesh.setEnabled(!1)}if(0===o)return void a();setTimeout((function(){i._loadNodeLOD(e,t,r,o-1,a)}),n.MinimalLODDelay)}))},n.prototype._loadMaterial=function(e,t,r,n){var o=this;return this._loadExtension(r,(function(a,i){var s=[r.index].concat(a.ids).map((function(t){return e._gltf.materials[t]}));e._addLoaderPendingData(r),o._loadMaterialLOD(e,t,s,s.length-1,n,(function(){r.extensions[o.name]=a,e._removeLoaderPendingData(r),i()}))}))},n.prototype._loadMaterialLOD=function(t,r,o,a,i,s){var l=this;t._loadMaterial(r,o[a],(function(u,d){if(i(u,d),0===a)return void s();t._executeWhenRenderReady((function(){e.BaseTexture.WhenAllReady(u.getActiveTextures(),(function(){setTimeout((function(){l._loadMaterialLOD(t,r,o,a-1,i,s)}),n.MinimalLODDelay)}))}))}))},n.MinimalLODDelay=250,n})(t.GLTFLoaderExtension);r.MSFTLOD=n,t.GLTFLoader.RegisterExtension(new n)})(t.Extensions||(t.Extensions={}))})(e.GLTF2||(e.GLTF2={}))})(BABYLON||(BABYLON={}));var __extends=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}})(),BABYLON;!(function(e){!(function(t){!(function(r){var n=(function(r){function n(){return null!==r&&r.apply(this,arguments)||this}return __extends(n,r),Object.defineProperty(n.prototype,"name",{get:function(){return"KHR_materials_pbrSpecularGlossiness"},enumerable:!0,configurable:!0}),n.prototype._loadMaterial=function(e,t,r,n){var o=this;return this._loadExtension(r,(function(a,i){e._createPbrMaterial(r),e._loadMaterialBaseProperties(t,r),o._loadSpecularGlossinessProperties(e,t,r,a),n(r.babylonMaterial,!0)}))},n.prototype._loadSpecularGlossinessProperties=function(r,n,o,a){var i=o.babylonMaterial;if(i.albedoColor=a.diffuseFactor?e.Color3.FromArray(a.diffuseFactor):new e.Color3(1,1,1),i.reflectivityColor=a.specularFactor?e.Color3.FromArray(a.specularFactor):new e.Color3(1,1,1),i.microSurface=null==a.glossinessFactor?1:a.glossinessFactor,a.diffuseTexture){var s=t.GLTFUtils.GetArrayItem(r._gltf.textures,a.diffuseTexture.index);if(!s)throw new Error(n+": Failed to find diffuse texture "+a.diffuseTexture.index);i.albedoTexture=r._loadTexture("textures["+s.index+"]",s,a.diffuseTexture.texCoord)}if(a.specularGlossinessTexture){var s=t.GLTFUtils.GetArrayItem(r._gltf.textures,a.specularGlossinessTexture.index);if(!s)throw new Error(n+": Failed to find diffuse texture "+a.specularGlossinessTexture.index);i.reflectivityTexture=r._loadTexture("textures["+s.index+"]",s,a.specularGlossinessTexture.texCoord),i.reflectivityTexture.hasAlpha=!0,i.useMicroSurfaceFromReflectivityMapAlpha=!0}r._loadMaterialAlphaProperties(n,o,a.diffuseFactor)},n})(t.GLTFLoaderExtension);r.KHRMaterialsPbrSpecularGlossiness=n,t.GLTFLoader.RegisterExtension(new n)})(t.Extensions||(t.Extensions={}))})(e.GLTF2||(e.GLTF2={}))})(BABYLON||(BABYLON={}));
|