var globalObject="undefined"!=typeof global?global:"undefined"!=typeof window?window:this,babylonDependency=globalObject&&globalObject.BABYLON||BABYLON||"undefined"!=typeof require&&require("babylonjs"),BABYLON=babylonDependency,__decorate=this&&this.__decorate||function(e,t,r,i){var s,n=arguments.length,a=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(a=(n<3?s(a):n>3?s(t,r,a):s(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a},__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 i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}})(),BABYLON;!(function(e){var t=(function(){function t(){}return t.OBJ=function(t,r,i,s){var n=[],a=1;r&&(i||(i="mat"),n.push("mtllib "+i+".mtl"));for(var o=0;o0&&(i.byteOffset=t),i},t.prototype.createAccessor=function(e,t,r,i,s,n,a){var o={name:t,bufferView:e,componentType:i,count:s,type:r};return n&&(o.min=n),a&&(o.max=a),o},t.prototype.calculateMinMax=function(e,t,r,i,s){var n=[1/0,1/0,1/0],a=[-(1/0),-(1/0),-(1/0)],o=t+r;if(r>0)for(var u=t;ua[c]&&(a[c]=e[f]),++f;return{min:n,max:a}},t.prototype.writeAttributeData=function(t,r,i,s,n,a,o){var u=n,f=r.verticesStart+r.verticesCount,c=0;switch(t){case e.VertexBuffer.PositionKind:case e.VertexBuffer.NormalKind:for(var h=r.verticesStart;h0&&(s.scene=0),e||(i.uri=t+".bin"),r?JSON.stringify(s,null,2):JSON.stringify(s)},t.prototype._generateGLTF=function(t){var r=this.generateJSON(!1,t,!0),i=this.generateBinary(),s=new Blob([i],{type:"application/octet-stream"}),n=t+".gltf",a=t+".bin",o=new e._GLTFData;return o._glTFFiles[n]=r,o._glTFFiles[a]=s,o},t.prototype.generateBinary=function(){var e=0,t=new ArrayBuffer(this.totalByteLength),r=new DataView(t);return e=this.createScene(this.babylonScene,e,r),t},t.prototype._generateGLB=function(t){var r=this.generateJSON(!0),i=this.generateBinary(),s=t+".glb",n=r.length,a=n%4,o=i.byteLength%4,u=0===a?a:4-a,f=0===o?o:4-o,c=28+n+u+i.byteLength+f,h=new ArrayBuffer(12),l=new DataView(h);l.setUint32(0,1179937895,!0),l.setUint32(4,2,!0),l.setUint32(8,c,!0);var p=new ArrayBuffer(8+n+u),d=new DataView(p);d.setUint32(0,n+u,!0),d.setUint32(4,1313821514,!0);for(var v=new Uint8Array(p,8),g=0;g0)if(n){for(var D=o.getIndices(),K=u.indexStart,U=u.indexCount+K,P=i,Y=K;Y0){for(var i=e.meshes,s={nodes:new Array},n=0;n