mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-06-04 11:25:44 +08:00

- Improved compression for triangular meshes (~10%) - Added WebAssembly decoder - Code cleanup + robustness fixes
86 lines
42 KiB
JavaScript
86 lines
42 KiB
JavaScript
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(n,f,k){if(k.get||k.set)throw new TypeError("ES3 does not support getters and setters.");n!=Array.prototype&&n!=Object.prototype&&(n[f]=k.value)};$jscomp.getGlobal=function(n){return"undefined"!=typeof window&&window===n?n:"undefined"!=typeof global&&null!=global?global:n};$jscomp.global=$jscomp.getGlobal(this);
|
|
$jscomp.polyfill=function(n,f,k,P){if(f){k=$jscomp.global;n=n.split(".");for(P=0;P<n.length-1;P++){var H=n[P];H in k||(k[H]={});k=k[H]}n=n[n.length-1];P=k[n];f=f(P);f!=P&&null!=f&&$jscomp.defineProperty(k,n,{configurable:!0,writable:!0,value:f})}};$jscomp.polyfill("Math.imul",function(n){return n?n:function(f,k){f=Number(f);k=Number(k);var n=f&65535,H=k&65535;return n*H+((f>>>16&65535)*H+n*(k>>>16&65535)<<16>>>0)|0}},"es6-impl","es3");
|
|
$jscomp.polyfill("Math.clz32",function(n){return n?n:function(f){f=Number(f)>>>0;if(0===f)return 32;var k=0;0===(f&4294901760)&&(f<<=16,k+=16);0===(f&4278190080)&&(f<<=8,k+=8);0===(f&4026531840)&&(f<<=4,k+=4);0===(f&3221225472)&&(f<<=2,k+=2);0===(f&2147483648)&&k++;return k}},"es6-impl","es3");$jscomp.polyfill("Math.trunc",function(n){return n?n:function(f){f=Number(f);if(isNaN(f)||Infinity===f||-Infinity===f||0===f)return f;var k=Math.floor(Math.abs(f));return 0>f?-k:k}},"es6-impl","es3");
|
|
var DracoModule=function(n){function f(a){eval.call(null,a)}function k(a,c){a||L("Assertion failed: "+c)}function P(a,c,d){c=c||"i8";"*"===c.charAt(c.length-1)&&(c="i32");switch(c){case "i1":return M[a>>0];case "i8":return M[a>>0];case "i16":return fa[a>>1];case "i32":return t[a>>2];case "i64":return t[a>>2];case "float":return ma[a>>2];case "double":return na[a>>3];default:L("invalid type for setValue: "+c)}return null}function H(a,c,d,e){var b,f;"number"===typeof a?(b=!0,f=a):(b=!1,f=a.length);
|
|
var g="string"===typeof c?c:null;d=4==d?e:["function"===typeof S?S:h.staticAlloc,h.stackAlloc,h.staticAlloc,h.dynamicAlloc][void 0===d?2:d](Math.max(f,g?1:c.length));if(b){e=d;k(0==(d&3));for(a=d+(f&-4);e<a;e+=4)t[e>>2]=0;for(a=d+f;e<a;)M[e++>>0]=0;return d}if("i8"===g)return a.subarray||a.slice?D.set(a,d):D.set(new Uint8Array(a),d),d;e=0;for(var n,q;e<f;){var m=a[e];"function"===typeof m&&(m=h.getFunctionIndex(m));b=g||c[e];if(0===b)e++;else{"i64"==b&&(b="i32");var p=d+e,u=b,u=u||"i8";"*"===u.charAt(u.length-
|
|
1)&&(u="i32");switch(u){case "i1":M[p>>0]=m;break;case "i8":M[p>>0]=m;break;case "i16":fa[p>>1]=m;break;case "i32":t[p>>2]=m;break;case "i64":tempI64=[m>>>0,(tempDouble=m,1<=+gb(tempDouble)?0<tempDouble?(hb(+ib(tempDouble/4294967296),4294967295)|0)>>>0:~~+jb((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)];t[p>>2]=tempI64[0];t[p+4>>2]=tempI64[1];break;case "float":ma[p>>2]=m;break;case "double":na[p>>3]=m;break;default:L("invalid type for setValue: "+u)}q!==b&&(n=h.getNativeTypeSize(b),q=b);e+=
|
|
n}}return d}function ga(b,c){if(0===c||!b)return"";for(var d=0,e,l=0;;){e=D[b+l>>0];d|=e;if(0==e&&!c)break;l++;if(c&&l==c)break}c||(c=l);e="";if(128>d){for(;0<c;)d=String.fromCharCode.apply(String,D.subarray(b,b+Math.min(c,1024))),e=e?e+d:d,b+=1024,c-=1024;return e}return a.UTF8ToString(b)}function Ia(a,c,d,e){if(!(0<e))return 0;var b=d;e=d+e-1;for(var k=0;k<a.length;++k){var g=a.charCodeAt(k);55296<=g&&57343>=g&&(g=65536+((g&1023)<<10)|a.charCodeAt(++k)&1023);if(127>=g){if(d>=e)break;c[d++]=g}else{if(2047>=
|
|
g){if(d+1>=e)break;c[d++]=192|g>>6}else{if(65535>=g){if(d+2>=e)break;c[d++]=224|g>>12}else{if(2097151>=g){if(d+3>=e)break;c[d++]=240|g>>18}else{if(67108863>=g){if(d+4>=e)break;c[d++]=248|g>>24}else{if(d+5>=e)break;c[d++]=252|g>>30;c[d++]=128|g>>24&63}c[d++]=128|g>>18&63}c[d++]=128|g>>12&63}c[d++]=128|g>>6&63}c[d++]=128|g&63}}c[d]=0;return d-b}function Ja(a){for(var b=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=
|
|
e?b+2:65535>=e?b+3:2097151>=e?b+4:67108863>=e?b+5:b+6}return b}function kb(b){return b.replace(/__Z[\w\d_]+/g,function(b){var c;a:{var e=a.___cxa_demangle||a.__cxa_demangle;if(e)try{var l=b.substr(1),k=Ja(l)+1,g=S(k);Ia(l,D,g,k);var f=S(4),m=e(g,0,0,f);if(0===P(f,"i32")&&m){c=ga(m);break a}}catch(tc){}finally{g&&va(g),f&&va(f),m&&va(m)}else h.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");c=b}return b===c?b:b+" ["+c+"]"})}function Ka(){var b;a:{b=Error();if(!b.stack){try{throw Error(0);
|
|
}catch(c){b=c}if(!b.stack){b="(no stack trace available)";break a}}b=b.stack.toString()}a.extraStackTrace&&(b+="\n"+a.extraStackTrace());return kb(b)}function wa(a,c){0<a%c&&(a+=c-a%c);return a}function xa(){a.HEAP8=M=new Int8Array(z);a.HEAP16=fa=new Int16Array(z);a.HEAP32=t=new Int32Array(z);a.HEAPU8=D=new Uint8Array(z);a.HEAPU16=La=new Uint16Array(z);a.HEAPU32=Ma=new Uint32Array(z);a.HEAPF32=ma=new Float32Array(z);a.HEAPF64=na=new Float64Array(z)}function Na(){var b=a.usingWasm?ya:Oa,c=2147483648-
|
|
b;if(t[Q>>2]>c)return!1;for(A=Math.max(A,lb);A<t[Q>>2];)A=536870912>=A?wa(2*A,b):Math.min(wa((3*A+2147483648)/4,b),c);b=a.reallocBuffer(A);if(!b||b.byteLength!=A)return!1;a.buffer=z=b;xa();return!0}function Y(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c();else{var d=c.func;"number"===typeof d?void 0===c.arg?a.dynCall_v(d):a.dynCall_vi(d,c.arg):d(void 0===c.arg?null:c.arg)}}}function Pa(a,c,d){d=0<d?d:Ja(a)+1;d=Array(d);a=Ia(a,d,0,d.length);c&&(d.length=a);return d}function Qa(b){V++;
|
|
a.monitorRunDependencies&&a.monitorRunDependencies(V)}function Ra(b){V--;a.monitorRunDependencies&&a.monitorRunDependencies(V);0==V&&(null!==za&&(clearInterval(za),za=null),ha&&(b=ha,ha=null,b()))}function Z(){return!!Z.uncaught_exception}function ia(){var b=y.last;if(!b)return(h.setTempRet0(0),0)|0;var c=y.infos[b],d=c.type;if(!d)return(h.setTempRet0(0),b)|0;var e=Array.prototype.slice.call(arguments);a.___cxa_is_pointer_type(d);ia.buffer||(ia.buffer=S(4));t[ia.buffer>>2]=b;for(var b=ia.buffer,l=
|
|
0;l<e.length;l++)if(e[l]&&a.___cxa_can_catch(e[l],d,b))return b=t[b>>2],c.adjusted=b,(h.setTempRet0(e[l]),b)|0;b=t[b>>2];return(h.setTempRet0(d),b)|0}function oa(b,c){W.push(function(){a.dynCall_vi(b,c)});oa.level=W.length}function ja(b,c){ja.seen||(ja.seen={});b in ja.seen||(a.dynCall_v(c),ja.seen[b]=1)}function T(b,c){u.varargs=c;try{var d=u.get(),e=u.get(),l=u.get(),f=0;T.buffer||(T.buffers=[null,[],[]],T.printChar=function(b,c){var d=T.buffers[b];k(d);if(0===c||10===c){var e=1===b?a.print:a.printErr,
|
|
l;a:{for(var f=l=0;d[f];)++f;if(16<f-l&&d.subarray&&Sa)l=Sa.decode(d.subarray(l,f));else for(var g,m,h,n,p,q,f="";;){g=d[l++];if(!g){l=f;break a}g&128?(m=d[l++]&63,192==(g&224)?f+=String.fromCharCode((g&31)<<6|m):(h=d[l++]&63,224==(g&240)?g=(g&15)<<12|m<<6|h:(n=d[l++]&63,240==(g&248)?g=(g&7)<<18|m<<12|h<<6|n:(p=d[l++]&63,248==(g&252)?g=(g&3)<<24|m<<18|h<<12|n<<6|p:(q=d[l++]&63,g=(g&1)<<30|m<<24|h<<18|n<<12|p<<6|q))),65536>g?f+=String.fromCharCode(g):(g-=65536,f+=String.fromCharCode(55296|g>>10,56320|
|
|
g&1023)))):f+=String.fromCharCode(g)}}e(l);d.length=0}else d.push(c)});for(var g=0;g<l;g++){for(var m=t[e+8*g>>2],h=t[e+(8*g+4)>>2],n=0;n<h;n++)T.printChar(d,D[m+n]);f+=h}return f}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||L(ua),-ua.errno}}function S(a){return h.dynamicAlloc(a+8)+8&4294967288}function aa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function Aa(b){function c(){if(!a.calledRun&&(a.calledRun=!0,!ba)){pa||(pa=!0,
|
|
Y(Ba));Y(Ta);if(a.onRuntimeInitialized)a.onRuntimeInitialized();a._main&&Ua&&a.callMain(b);if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Va.unshift(a.postRun.shift());Y(Va)}}b=b||a.arguments;null===Wa&&(Wa=Date.now());if(!(0<V)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Xa.unshift(a.preRun.shift());Y(Xa);0<V||a.calledRun||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},
|
|
1);c()},1)):c())}}function Ya(b,c){if(!c||!a.noExitRuntime){if(!a.noExitRuntime&&(ba=!0,I=mb,Y(W),a.onExit))a.onExit(b);ca?process.exit(b):ka&&"function"===typeof quit&&quit(b);throw new aa(b);}}function L(b){void 0!==b?(a.print(b),a.printErr(b),b=JSON.stringify(b)):b="";ba=!0;var c="abort("+b+") at "+Ka()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";Za&&Za.forEach(function(a){c=a(c,b)});throw c;}function r(){}function J(a){return(a||r).__cache__}
|
|
function da(a,c){var b=J(c),e=b[a];if(e)return e;e=Object.create((c||r).prototype);e.ptr=a;return b[a]=e}function B(){this.ptr=nb();J(B)[this.ptr]=this}function p(){this.ptr=ob();J(p)[this.ptr]=this}function m(){this.ptr=pb();J(m)[this.ptr]=this}function E(){this.ptr=qb();J(E)[this.ptr]=this}function N(){this.ptr=rb();J(N)[this.ptr]=this}function F(){this.ptr=sb();J(F)[this.ptr]=this}function x(){this.ptr=tb();J(x)[this.ptr]=this}function R(){throw"cannot construct a VoidPtr, no constructor in IDL";
|
|
}function G(){this.ptr=ub();J(G)[this.ptr]=this}var a=n=n||{},$a=!1,ab=!1;a.onRuntimeInitialized=function(){$a=!0;if(ab&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){ab=!0;if($a&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length||0<a[0]||9<a[1]?!1:!0};a||(a=("undefined"!==typeof n?n:null)||{});var la={},U;for(U in a)a.hasOwnProperty(U)&&(la[U]=
|
|
a[U]);var ea=!1,X=!1,ca=!1,ka=!1;if(a.ENVIRONMENT)if("WEB"===a.ENVIRONMENT)ea=!0;else if("WORKER"===a.ENVIRONMENT)X=!0;else if("NODE"===a.ENVIRONMENT)ca=!0;else if("SHELL"===a.ENVIRONMENT)ka=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");else ea="object"===typeof window,X="function"===typeof importScripts,ca="object"===typeof process&&"function"===typeof require&&!ea&&!X,ka=!ea&&!ca&&!X;if(ca){a.print||(a.print=console.log);
|
|
a.printErr||(a.printErr=console.warn);var Ca,Da;a.read=function(a,c){Ca||(Ca=require("fs"));Da||(Da=require("path"));a=Da.normalize(a);var b=Ca.readFileSync(a);return c?b:b.toString()};a.readBinary=function(b){b=a.read(b,!0);b.buffer||(b=new Uint8Array(b));k(b.buffer);return b};a.load=function(a){f(read(a))};a.thisProgram||(a.thisProgram=1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program");a.arguments=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=a);process.on("uncaughtException",
|
|
function(a){if(!(a instanceof aa))throw a;});a.inspect=function(){return"[Emscripten Module object]"}}else if(ka)a.print||(a.print=print),"undefined"!=typeof printErr&&(a.printErr=printErr),a.read="undefined"!=typeof read?read:function(){throw"no read() available";},a.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");k("object"===typeof a);return a},"undefined"!=typeof scriptArgs?a.arguments=scriptArgs:"undefined"!=typeof arguments&&(a.arguments=
|
|
arguments);else if(ea||X)a.read=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},a.readAsync=function(a,c,d){var b=new XMLHttpRequest;b.open("GET",a,!0);b.responseType="arraybuffer";b.onload=function(){200==b.status||0==b.status&&b.response?c(b.response):d()};b.onerror=d;b.send(null)},"undefined"!=typeof arguments&&(a.arguments=arguments),"undefined"!==typeof console?(a.print||(a.print=function(a){console.log(a)}),a.printErr||(a.printErr=function(a){console.warn(a)})):
|
|
a.print||(a.print=function(a){}),X&&(a.load=importScripts),"undefined"===typeof a.setWindowTitle&&(a.setWindowTitle=function(a){document.title=a});else throw"Unknown runtime environment. Where are we?";!a.load&&a.read&&(a.load=function(b){f(a.read(b))});a.print||(a.print=function(){});a.printErr||(a.printErr=a.print);a.arguments||(a.arguments=[]);a.thisProgram||(a.thisProgram="./this.program");a.print=a.print;a.printErr=a.printErr;a.preRun=[];a.postRun=[];for(U in la)la.hasOwnProperty(U)&&(a[U]=la[U]);
|
|
var la=void 0,h={setTempRet0:function(a){return tempRet0=a},getTempRet0:function(){return tempRet0},stackSave:function(){return I},stackRestore:function(a){I=a},getNativeTypeSize:function(a){switch(a){case "i1":case "i8":return 1;case "i16":return 2;case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:return"*"===a[a.length-1]?h.QUANTUM_SIZE:"i"===a[0]?(a=parseInt(a.substr(1)),k(0===a%8),a/8):0}},getNativeFieldSize:function(a){return Math.max(h.getNativeTypeSize(a),
|
|
h.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(a,c){"double"===c||"i64"===c?a&7&&(k(4===(a&7)),a+=4):k(0===(a&3));return a},getAlignSize:function(a,c,d){return d||"i64"!=a&&"double"!=a?a?Math.min(c||(a?h.getNativeFieldSize(a):0),h.QUANTUM_SIZE):Math.min(c,8):8},dynCall:function(b,c,d){return d&&d.length?a["dynCall_"+b].apply(null,[c].concat(d)):a["dynCall_"+b].call(null,c)},functionPointers:[],addFunction:function(a){for(var b=0;b<h.functionPointers.length;b++)if(!h.functionPointers[b])return h.functionPointers[b]=
|
|
a,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";},removeFunction:function(a){h.functionPointers[(a-2)/2]=null},warnOnce:function(b){h.warnOnce.shown||(h.warnOnce.shown={});h.warnOnce.shown[b]||(h.warnOnce.shown[b]=1,a.printErr(b))},funcWrappers:{},getFuncWrapper:function(a,c){k(c);h.funcWrappers[c]||(h.funcWrappers[c]={});var b=h.funcWrappers[c];b[a]||(b[a]=1===c.length?function(){return h.dynCall(c,a)}:2===c.length?function(b){return h.dynCall(c,
|
|
a,[b])}:function(){return h.dynCall(c,a,Array.prototype.slice.call(arguments))});return b[a]},getCompilerSetting:function(a){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work";},stackAlloc:function(a){var b=I;I=I+a|0;I=I+15&-16;return b},staticAlloc:function(a){var b=O;O=O+a|0;O=O+15&-16;return b},dynamicAlloc:function(a){var b=t[Q>>2];a=(b+a+15|0)&-16;t[Q>>2]=a;return a>=A&&!Na()?(t[Q>>2]=b,0):b},alignMemory:function(a,
|
|
c){return Math.ceil(a/(c?c:16))*(c?c:16)},makeBigInt:function(a,c,d){return d?+(a>>>0)+4294967296*+(c>>>0):+(a>>>0)+4294967296*+(c|0)},GLOBAL_BASE:1024,QUANTUM_SIZE:4,__dummy__:0},ba=0,Sa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var ya=65536,Oa=16777216,lb=16777216,z,M,D,fa,La,t,Ma,ma,na,qa,O,Ea,I,ra,Fa,Q;qa=O=Ea=I=ra=Fa=Q=0;a.reallocBuffer||(a.reallocBuffer=function(a){var b;try{if(ArrayBuffer.transfer)b=ArrayBuffer.transfer(z,
|
|
a);else{var d=M;b=new ArrayBuffer(a);(new Int8Array(b)).set(d)}}catch(e){return!1}return vb(b)?b:!1});var sa;try{sa=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),sa(new ArrayBuffer(4))}catch(b){sa=function(a){return a.byteLength}}var Ga=a.TOTAL_STACK||5242880,A=a.TOTAL_MEMORY||16777216;A<Ga&&a.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+A+"! (TOTAL_STACK="+Ga+")");a.buffer?z=a.buffer:"object"===typeof WebAssembly&&"function"===
|
|
typeof WebAssembly.Memory?(a.wasmMemory=new WebAssembly.Memory({initial:A/ya}),z=a.wasmMemory.buffer):z=new ArrayBuffer(A);xa();t[0]=1668509029;fa[1]=25459;if(115!==D[2]||99!==D[3])throw"Runtime error: expected the system to be little-endian!";a.HEAP=void 0;a.buffer=z;a.HEAP8=M;a.HEAP16=fa;a.HEAP32=t;a.HEAPU8=D;a.HEAPU16=La;a.HEAPU32=Ma;a.HEAPF32=ma;a.HEAPF64=na;var Xa=[],Ba=[],Ta=[],W=[],Va=[],pa=!1;Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(a,c){var b=a&65535,e=c&65535;return b*
|
|
e+((a>>>16)*e+b*(c>>>16)<<16)|0});Math.imul=Math.imul;if(!Math.fround){var bb=new Float32Array(1);Math.fround=function(a){bb[0]=a;return bb[0]}}Math.fround=Math.fround;Math.clz32||(Math.clz32=function(a){a>>>=0;for(var b=0;32>b;b++)if(a&1<<31-b)return b;return 32});Math.clz32=Math.clz32;Math.trunc||(Math.trunc=function(a){return 0>a?Math.ceil(a):Math.floor(a)});Math.trunc=Math.trunc;var gb=Math.abs,jb=Math.ceil,ib=Math.floor,hb=Math.min,V=0,za=null,ha=null;a.preloadedImages={};a.preloadedAudios={};
|
|
var K=null;(function(b){function c(a,b){var c=p;if(0>a.indexOf("."))c=(c||{})[a];else var d=a.split("."),c=(c||{})[d[0]],c=(c||{})[d[1]];b&&(c=(c||{})[b]);void 0===c&&L("bad lookupImport to ("+a+")."+b);return c}function d(c){var d=b.buffer;c.byteLength<d.byteLength&&b.printErr("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");var d=new Int8Array(d),e=new Int8Array(c);K||d.set(e.subarray(b.STATIC_BASE,b.STATIC_BASE+b.STATIC_BUMP),b.STATIC_BASE);
|
|
e.set(d);a.buffer=z=c;xa()}function e(){var a;ea||X?(a=b.wasmBinary,k(a,"on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)"),a=new Uint8Array(a)):a=b.readBinary(h);return a}function l(a,c,d){if("function"!==typeof b.asm||b.asm===u)b.asmPreload?b.asm=b.asmPreload:eval(b.read(n));return"function"!==typeof b.asm?(b.printErr("asm evalling did not set the module properly"),!1):b.asm(a,c,d)}function f(a,c,
|
|
l){if("object"!==typeof WebAssembly)return b.printErr("no native wasm support detected"),!1;if(!(b.wasmMemory instanceof WebAssembly.Memory))return b.printErr("no native wasm Memory in use"),!1;c.memory=b.wasmMemory;p.global={NaN:NaN,Infinity:Infinity};p["global.Math"]=a.Math;p.env=c;b.printErr("asynchronously preparing wasm");Qa("wasm-instantiate");WebAssembly.instantiate(e(),p).then(function(a){q=a.instance.exports;q.memory&&d(q.memory);b.asm=q;b.usingWasm=!0;Ra("wasm-instantiate")})["catch"](function(a){b.printErr("failed to asynchronously prepare wasm:\n "+
|
|
a)});return{}}var g=b.wasmJSMethod||"native-wasm";b.wasmJSMethod=g;var m=b.wasmTextFile||"draco_decoder.wast",h=b.wasmBinaryFile||"draco_decoder.wasm",n=b.asmjsCodeFile||"draco_decoder.temp.asm.js",p={global:null,env:null,asm2wasm:{"f64-rem":function(a,b){return a%b},"f64-to-int":function(a){return a|0},"i32s-div":function(a,b){return(a|0)/(b|0)|0},"i32u-div":function(a,b){return(a>>>0)/(b>>>0)>>>0},"i32s-rem":function(a,b){return(a|0)%(b|0)|0},"i32u-rem":function(a,b){return(a>>>0)%(b>>>0)>>>0},
|
|
"debugger":function(){debugger}},parent:b},q=null;b.asmPreload=b.asm;b.reallocBuffer=function(a){a=wa(a,b.usingWasm?ya:Oa);var c=b.buffer,d=c.byteLength;if(b.usingWasm)try{return-1!==b.wasmMemory.grow((a-d)/65536)?b.buffer=b.wasmMemory.buffer:null}catch(uc){return null}else return q.__growWasmMemory((a-d)/65536),b.buffer!==c?b.buffer:null};b.asm=function(a,h,u){if(!h.table){var t=b.wasmTableSize;void 0===t&&(t=1024);var w=b.wasmMaxTableSize;h.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?
|
|
void 0!==w?new WebAssembly.Table({initial:t,maximum:w,element:"anyfunc"}):new WebAssembly.Table({initial:t,element:"anyfunc"}):Array(t);b.wasmTable=h.table}h.memoryBase||(h.memoryBase=b.STATIC_BASE);h.tableBase||(h.tableBase=0);for(var v,t=g.split(","),w=0;w<t.length;w++)if(v=t[w],b.printErr("trying binaryen method: "+v),"native-wasm"===v){if(v=f(a,h,u))break}else if("asmjs"===v){if(v=l(a,h,u))break}else if("interpret-asm2wasm"===v||"interpret-s-expr"===v||"interpret-binary"===v){var r,C;C=a;r=h;
|
|
var y=u,x=v;if("function"!==typeof WasmJS)b.printErr("WasmJS not detected - polyfill not bundled?"),v=!1;else{v=WasmJS({});v.outside=b;v.info=p;v.lookupImport=c;k(y===b.buffer);p.global=C;p.env=r;k(y===b.buffer);r.memory=y;k(r.memory instanceof ArrayBuffer);v.providedTotalMemory=b.buffer.byteLength;C="interpret-binary"===x?e():b.read("interpret-asm2wasm"==x?n:m);if("interpret-asm2wasm"==x)r=v._malloc(C.length+1),v.writeAsciiToMemory(C,r),v._load_asm2wasm(r);else if("interpret-s-expr"===x)r=v._malloc(C.length+
|
|
1),v.writeAsciiToMemory(C,r),v._load_s_expr2wasm(r);else if("interpret-binary"===x)r=v._malloc(C.length),v.HEAPU8.set(C,r),v._load_binary2wasm(r,C.length);else throw"what? "+x;v._free(r);v._instantiate(r);b.newBuffer&&(d(b.newBuffer),b.newBuffer=null);v=q=v.asmExports}if(v)break}else throw"bad method: "+v;if(!v)throw"no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods";b.printErr("binaryen method succeeded.");
|
|
return v};var u=b.asm})(a);qa=1024;O=qa+20016;Ba.push();K=0<=a.wasmJSMethod.indexOf("asmjs")||0<=a.wasmJSMethod.indexOf("interpret-asm2wasm")?"draco_decoder.js.mem":null;a.STATIC_BASE=qa;a.STATIC_BUMP=20016;var wb=O;O+=16;a._llvm_bswap_i16=xb;var y={last:0,caught:[],infos:{},deAdjust:function(a){if(!a||y.infos[a])return a;for(var b in y.infos)if(y.infos[b].adjusted===a)return b;return a},addRef:function(a){a&&y.infos[a].refcount++},decRef:function(b){if(b){var c=y.infos[b];k(0<c.refcount);c.refcount--;
|
|
0!==c.refcount||c.rethrown||(c.destructor&&a.dynCall_vi(c.destructor,b),delete y.infos[b],___cxa_free_exception(b))}},clearRef:function(a){a&&(y.infos[a].refcount=0)}};a._memset=yb;a._memcpy=zb;var u={varargs:0,get:function(a){u.varargs+=4;return t[u.varargs-4>>2]},getStr:function(){return ga(u.get())},get64:function(){var a=u.get(),c=u.get();0<=a?k(0===c):k(-1===c);return a},getZero:function(){k(0===u.get())}},ta={};a._sbrk=Ab;a._memmove=Bb;var Ha=1;a._pthread_self=Cb;a._malloc=S;W.push(function(){var b=
|
|
a._fflush;b&&b(0);if(b=T.printChar){var c=T.buffers;c[1].length&&b(1,10);c[2].length&&b(2,10)}});Q=H(1,"i32",2);Ea=I=h.alignMemory(O);ra=Ea+Ga;Fa=h.alignMemory(ra);t[Q>>2]=Fa;a.wasmTableSize=504;a.wasmMaxTableSize=504;a.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:Infinity,byteLength:sa};a.asmLibraryArg={abort:L,assert:k,
|
|
enlargeMemory:Na,getTotalMemory:function(){return A},abortOnCannotGrowMemory:function(){L("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+A+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},invoke_iiii:function(b,
|
|
c,d,e){try{return a.dynCall_iiii(b,c,d,e)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_viiiii:function(b,c,d,e,l,f){try{a.dynCall_viiiii(b,c,d,e,l,f)}catch(g){if("number"!==typeof g&&"longjmp"!==g)throw g;a.setThrew(1,0)}},invoke_vi:function(b,c){try{a.dynCall_vi(b,c)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_iiiiiii:function(b,c,d,e,l,f,g){try{return a.dynCall_iiiiiii(b,c,d,e,l,f,g)}catch(w){if("number"!==typeof w&&"longjmp"!==
|
|
w)throw w;a.setThrew(1,0)}},invoke_ii:function(b,c){try{return a.dynCall_ii(b,c)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_viii:function(b,c,d,e){try{a.dynCall_viii(b,c,d,e)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_v:function(b){try{a.dynCall_v(b)}catch(c){if("number"!==typeof c&&"longjmp"!==c)throw c;a.setThrew(1,0)}},invoke_viiiiii:function(b,c,d,e,l,f,g){try{a.dynCall_viiiiii(b,c,d,e,l,f,g)}catch(w){if("number"!==typeof w&&
|
|
"longjmp"!==w)throw w;a.setThrew(1,0)}},invoke_iii:function(b,c,d){try{return a.dynCall_iii(b,c,d)}catch(e){if("number"!==typeof e&&"longjmp"!==e)throw e;a.setThrew(1,0)}},invoke_viiii:function(b,c,d,e,l){try{a.dynCall_viiii(b,c,d,e,l)}catch(C){if("number"!==typeof C&&"longjmp"!==C)throw C;a.setThrew(1,0)}},_pthread_cleanup_pop:function(){k(oa.level==W.length,"cannot pop if something else added meanwhile!");W.pop();oa.level=W.length},_pthread_getspecific:function(a){return ta[a]||0},_pthread_setspecific:function(a,
|
|
c){if(!(a in ta))return 22;ta[a]=c;return 0},_pthread_cleanup_push:oa,___cxa_throw:function(a,c,d){y.infos[a]={ptr:a,adjusted:a,type:c,destructor:d,refcount:0,caught:!1,rethrown:!1};y.last=a;"uncaught_exception"in Z?Z.uncaught_exception++:Z.uncaught_exception=1;throw a+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.";},_pthread_key_create:function(a,c){if(0==a)return 22;t[a>>2]=Ha;ta[Ha]=0;
|
|
Ha++;return 0},_abort:function(){a.abort()},___setErrNo:function(b){a.___errno_location&&(t[a.___errno_location()>>2]=b);return b},___syscall6:function(a,c){u.varargs=c;try{var b=u.getStreamFromFD();FS.close(b);return 0}catch(e){return"undefined"!==typeof FS&&e instanceof FS.ErrnoError||L(e),-e.errno}},_pthread_once:ja,___syscall146:T,___cxa_begin_catch:function(a){var b=y.infos[a];b&&!b.caught&&(b.caught=!0,Z.uncaught_exception--);b&&(b.rethrown=!1);y.caught.push(a);y.addRef(y.deAdjust(a));return a},
|
|
_emscripten_memcpy_big:function(a,c,d){D.set(D.subarray(c,c+d),a);return a},___gxx_personality_v0:function(){},___syscall140:function(a,c){u.varargs=c;try{var b=u.getStreamFromFD(),e=u.get(),l=u.get(),f=u.get(),g=u.get();k(0===e);FS.llseek(b,l,g);t[f>>2]=b.position;b.getdents&&0===l&&0===g&&(b.getdents=null);return 0}catch(w){return"undefined"!==typeof FS&&w instanceof FS.ErrnoError||L(w),-w.errno}},___resumeException:function(a){y.last||(y.last=a);throw a+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.";
|
|
},___cxa_find_matching_catch:ia,___assert_fail:function(a,c,d,e){ba=!0;throw"Assertion failed: "+ga(a)+", at: "+[c?ga(c):"unknown filename",d,e?ga(e):"unknown function"]+" at "+Ka();},___cxa_pure_virtual:function(){ba=!0;throw"Pure virtual function called!";},___cxa_allocate_exception:function(a){return S(a)},__ZSt18uncaught_exceptionv:Z,DYNAMICTOP_PTR:Q,tempDoublePtr:wb,ABORT:ba,STACKTOP:I,STACK_MAX:ra};var cb=a.asm(a.asmGlobalArg,a.asmLibraryArg,z);a.asm=cb;var Db=a._emscripten_bind_WebIDLWrapper_DecodeMeshFromBuffer_1=
|
|
function(){return a.asm._emscripten_bind_WebIDLWrapper_DecodeMeshFromBuffer_1.apply(null,arguments)},sb=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm._emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},Eb=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm._emscripten_bind_Mesh___destroy___0.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};var Fb=a._emscripten_bind_PointAttribute_components_count_0=function(){return a.asm._emscripten_bind_PointAttribute_components_count_0.apply(null,
|
|
arguments)},Gb=a._emscripten_bind_WebIDLWrapper_GetEncodedGeometryType_1=function(){return a.asm._emscripten_bind_WebIDLWrapper_GetEncodedGeometryType_1.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Ib=a._emscripten_bind_WebIDLWrapper_DecodePointCloudFromBuffer_1=function(){return a.asm._emscripten_bind_WebIDLWrapper_DecodePointCloudFromBuffer_1.apply(null,arguments)},Jb=a._emscripten_bind_PointAttribute_normalized_0=
|
|
function(){return a.asm._emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Kb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm._emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Lb=a._emscripten_bind_WebIDLWrapper_GetAttributeFloat_3=function(){return a.asm._emscripten_bind_WebIDLWrapper_GetAttributeFloat_3.apply(null,arguments)},Mb=a._emscripten_bind_WebIDLWrapper_GetAttributeId_2=function(){return a.asm._emscripten_bind_WebIDLWrapper_GetAttributeId_2.apply(null,
|
|
arguments)};a.setTempRet0=function(){return a.asm.setTempRet0.apply(null,arguments)};a.setThrew=function(){return a.asm.setThrew.apply(null,arguments)};a.___cxa_is_pointer_type=function(){return a.asm.___cxa_is_pointer_type.apply(null,arguments)};var Nb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm._emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Ob=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,
|
|
arguments)},Pb=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},Qb=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm._emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},yb=a._memset=function(){return a.asm._memset.apply(null,arguments)},Rb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm._emscripten_bind_PointAttribute_attribute_type_0.apply(null,
|
|
arguments)},Ab=a._sbrk=function(){return a.asm._sbrk.apply(null,arguments)},Sb=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm._emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},zb=a._memcpy=function(){return a.asm._memcpy.apply(null,arguments)},Tb=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm._emscripten_bind_DecoderBuffer___destroy___0.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};var Ub=a._emscripten_bind_PointAttribute_custom_id_0=
|
|
function(){return a.asm._emscripten_bind_PointAttribute_custom_id_0.apply(null,arguments)},Vb=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},Wb=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},Xb=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm._emscripten_bind_Mesh_num_points_0.apply(null,
|
|
arguments)},tb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm._emscripten_bind_Mesh_Mesh_0.apply(null,arguments)},Yb=a._emscripten_bind_WebIDLWrapper_GetAttribute_2=function(){return a.asm._emscripten_bind_WebIDLWrapper_GetAttribute_2.apply(null,arguments)},qb=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,arguments)},Zb=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,
|
|
arguments)},$b=a._emscripten_bind_WebIDLWrapper___destroy___0=function(){return a.asm._emscripten_bind_WebIDLWrapper___destroy___0.apply(null,arguments)},ac=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)},bc=a._emscripten_bind_WebIDLWrapper_GetFaceFromMesh_3=function(){return a.asm._emscripten_bind_WebIDLWrapper_GetFaceFromMesh_3.apply(null,arguments)},ub=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=
|
|
function(){return a.asm._emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Cb=a._pthread_self=function(){return a.asm._pthread_self.apply(null,arguments)},pb=a._emscripten_bind_PointAttribute_PointAttribute_0=function(){return a.asm._emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},xb=a._llvm_bswap_i16=function(){return a.asm._llvm_bswap_i16.apply(null,arguments)},cc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm._emscripten_bind_Mesh_num_attributes_0.apply(null,
|
|
arguments)},dc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},fc=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm._emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},gc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoInt32Array___destroy___0.apply(null,
|
|
arguments)},rb=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm._emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,arguments)};a.runPostSets=function(){return a.asm.runPostSets.apply(null,arguments)};var hc=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm._emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)};a.getTempRet0=function(){return a.asm.getTempRet0.apply(null,arguments)};var va=a._free=function(){return a.asm._free.apply(null,
|
|
arguments)},ic=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm._emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},jc=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,arguments)},kc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm._emscripten_bind_Mesh_num_faces_0.apply(null,arguments)};a.establishStackSpace=function(){return a.asm.establishStackSpace.apply(null,
|
|
arguments)};var lc=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},mc=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_stride_0.apply(null,arguments)},S=a._malloc=function(){return a.asm._malloc.apply(null,arguments)},ob=a._emscripten_bind_WebIDLWrapper_WebIDLWrapper_0=function(){return a.asm._emscripten_bind_WebIDLWrapper_WebIDLWrapper_0.apply(null,
|
|
arguments)},Bb=a._memmove=function(){return a.asm._memmove.apply(null,arguments)},vb=a._emscripten_replace_memory=function(){return a.asm._emscripten_replace_memory.apply(null,arguments)},nc=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm._emscripten_bind_PointCloud_num_attributes_0.apply(null,arguments)},oc=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},pc=a._emscripten_bind_DracoInt32Array_GetValue_1=
|
|
function(){return a.asm._emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},qc=a._emscripten_bind_WebIDLWrapper_GetAttributeFloatForAllPoints_3=function(){return a.asm._emscripten_bind_WebIDLWrapper_GetAttributeFloatForAllPoints_3.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};var nb=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm._emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},rc=a._emscripten_bind_PointAttribute___destroy___0=
|
|
function(){return a.asm._emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)};a.___cxa_can_catch=function(){return a.asm.___cxa_can_catch.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,
|
|
arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};h.stackAlloc=a.stackAlloc;h.stackSave=a.stackSave;h.stackRestore=a.stackRestore;h.establishStackSpace=a.establishStackSpace;
|
|
h.setTempRet0=a.setTempRet0;h.getTempRet0=a.getTempRet0;a.asm=cb;if(K)if("function"===typeof a.locateFile?K=a.locateFile(K):a.memoryInitializerPrefixURL&&(K=a.memoryInitializerPrefixURL+K),ca||ka){var sc=a.readBinary(K);D.set(sc,h.GLOBAL_BASE)}else{var eb=function(){a.readAsync(K,db,function(){throw"could not load memory initializer "+K;})};Qa("memory initializer");var db=function(b){b.byteLength&&(b=new Uint8Array(b));D.set(b,h.GLOBAL_BASE);a.memoryInitializerRequest&&delete a.memoryInitializerRequest.response;
|
|
Ra("memory initializer")};if(a.memoryInitializerRequest){var fb=function(){var b=a.memoryInitializerRequest;200!==b.status&&0!==b.status?(console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+b.status+", retrying "+K),eb()):db(b.response)};a.memoryInitializerRequest.response?setTimeout(fb,0):a.memoryInitializerRequest.addEventListener("load",fb)}else eb()}aa.prototype=Error();aa.prototype.constructor=aa;var mb,Wa=null,ha=function c(){a.calledRun||Aa();a.calledRun||
|
|
(ha=c)};a.callMain=a.callMain=function(c){function d(){for(var a=0;3>a;a++)l.push(0)}c=c||[];pa||(pa=!0,Y(Ba));var e=c.length+1,l=[H(Pa(a.thisProgram),"i8",0)];d();for(var f=0;f<e-1;f+=1)l.push(H(Pa(c[f]),"i8",0)),d();l.push(0);l=H(l,"i32",0);try{var g=a._main(e,l,0);Ya(g,!0)}catch(w){if(!(w instanceof aa))if("SimulateInfiniteLoop"==w)a.noExitRuntime=!0;else throw w&&"object"===typeof w&&w.stack&&a.printErr("exception thrown: "+[w,w.stack]),w;}finally{}};a.run=a.run=Aa;a.exit=a.exit=Ya;var Za=[];
|
|
a.abort=a.abort=L;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();var Ua=!0;a.noInitialRun&&(Ua=!1);Aa();r.prototype=Object.create(r.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.WrapperObject=r;a.getCache=J;a.wrapPointer=da;a.castObject=function(a,d){return da(a.ptr,d)};a.NULL=da(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";a.__destroy__();
|
|
delete J(a.__class__)[a.ptr]};a.compare=function(a,d){return a.ptr===d.ptr};a.getPointer=function(a){return a.ptr};a.getClass=function(a){return a.__class__};var q={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(q.needed){for(var c=0;c<q.temps.length;c++)a._free(q.temps[c]);q.temps.length=0;a._free(q.buffer);q.buffer=0;q.size+=q.needed;q.needed=0}q.buffer||(q.size+=128,q.buffer=a._malloc(q.size),k(q.buffer));q.pos=0},alloc:function(c,d){k(q.buffer);var e=c.length*d.BYTES_PER_ELEMENT,
|
|
e=e+7&-8,f;q.pos+e>=q.size?(k(0<e),q.needed+=e,f=a._malloc(e),q.temps.push(f)):(f=q.buffer+q.pos,q.pos+=e);return f},copy:function(a,d,e){switch(d.BYTES_PER_ELEMENT){case 2:e>>=1;break;case 4:e>>=2;break;case 8:e>>=3}for(var c=0;c<a.length;c++)d[e+c]=a[c]}};B.prototype=Object.create(r.prototype);B.prototype.constructor=B;B.prototype.__class__=B;B.__cache__={};a.PointCloud=B;B.prototype.num_attributes=B.prototype.num_attributes=function(){return nc(this.ptr)};B.prototype.num_points=B.prototype.num_points=
|
|
function(){return fc(this.ptr)};B.prototype.__destroy__=B.prototype.__destroy__=function(){Kb(this.ptr)};p.prototype=Object.create(r.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.WebIDLWrapper=p;p.prototype.GetEncodedGeometryType=p.prototype.GetEncodedGeometryType=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Gb(c,a)};p.prototype.DecodePointCloudFromBuffer=p.prototype.DecodePointCloudFromBuffer=function(a){var c=this.ptr;a&&"object"===typeof a&&
|
|
(a=a.ptr);return da(Ib(c,a),B)};p.prototype.DecodeMeshFromBuffer=p.prototype.DecodeMeshFromBuffer=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return da(Db(c,a),x)};p.prototype.GetAttributeId=p.prototype.GetAttributeId=function(a,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return Mb(c,a,d)};p.prototype.GetAttribute=p.prototype.GetAttribute=function(a,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return da(Yb(c,
|
|
a,d),m)};p.prototype.GetFaceFromMesh=p.prototype.GetFaceFromMesh=function(a,d,e){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&(e=e.ptr);return!!bc(c,a,d,e)};p.prototype.GetAttributeFloat=p.prototype.GetAttributeFloat=function(a,d,e){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&(e=e.ptr);return!!Lb(c,a,d,e)};p.prototype.GetAttributeFloatForAllPoints=p.prototype.GetAttributeFloatForAllPoints=
|
|
function(a,d,e){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&(e=e.ptr);return!!qc(c,a,d,e)};p.prototype.__destroy__=p.prototype.__destroy__=function(){$b(this.ptr)};m.prototype=Object.create(r.prototype);m.prototype.constructor=m;m.prototype.__class__=m;m.__cache__={};a.PointAttribute=m;m.prototype.size=m.prototype.size=function(){return Nb(this.ptr)};m.prototype.attribute_type=m.prototype.attribute_type=function(){return Rb(this.ptr)};
|
|
m.prototype.data_type=m.prototype.data_type=function(){return hc(this.ptr)};m.prototype.components_count=m.prototype.components_count=function(){return Fb(this.ptr)};m.prototype.normalized=m.prototype.normalized=function(){return!!Jb(this.ptr)};m.prototype.byte_stride=m.prototype.byte_stride=function(){return mc(this.ptr)};m.prototype.byte_offset=m.prototype.byte_offset=function(){return Hb(this.ptr)};m.prototype.custom_id=m.prototype.custom_id=function(){return Ub(this.ptr)};m.prototype.__destroy__=
|
|
m.prototype.__destroy__=function(){rc(this.ptr)};E.prototype=Object.create(r.prototype);E.prototype.constructor=E;E.prototype.__class__=E;E.__cache__={};a.DracoFloat32Array=E;E.prototype.GetValue=E.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return dc(c,a)};E.prototype.__destroy__=E.prototype.__destroy__=function(){ec(this.ptr)};N.prototype=Object.create(r.prototype);N.prototype.constructor=N;N.prototype.__class__=N;N.__cache__={};a.GeometryAttribute=N;N.prototype.__destroy__=
|
|
N.prototype.__destroy__=function(){ic(this.ptr)};F.prototype=Object.create(r.prototype);F.prototype.constructor=F;F.prototype.__class__=F;F.__cache__={};a.DecoderBuffer=F;F.prototype.Init=F.prototype.Init=function(a,d){var c=this.ptr;q.prepare();if("object"==typeof a){var f=a;if("object"===typeof f){var h=q.alloc(f,M);q.copy(f,M,h);a=h}else a=f}d&&"object"===typeof d&&(d=d.ptr);Sb(c,a,d)};F.prototype.__destroy__=F.prototype.__destroy__=function(){Tb(this.ptr)};x.prototype=Object.create(r.prototype);
|
|
x.prototype.constructor=x;x.prototype.__class__=x;x.__cache__={};a.Mesh=x;x.prototype.num_faces=x.prototype.num_faces=function(){return kc(this.ptr)};x.prototype.num_attributes=x.prototype.num_attributes=function(){return cc(this.ptr)};x.prototype.num_points=x.prototype.num_points=function(){return Xb(this.ptr)};x.prototype.__destroy__=x.prototype.__destroy__=function(){Eb(this.ptr)};R.prototype=Object.create(r.prototype);R.prototype.constructor=R;R.prototype.__class__=R;R.__cache__={};a.VoidPtr=
|
|
R;R.prototype.__destroy__=R.prototype.__destroy__=function(){Qb(this.ptr)};G.prototype=Object.create(r.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.DracoInt32Array=G;G.prototype.GetValue=G.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return pc(c,a)};G.prototype.__destroy__=G.prototype.__destroy__=function(){gc(this.ptr)};(function(){function c(){a.INVALID_GEOMETRY_TYPE=jc();a.POINT_CLOUD=Zb();a.TRIANGULAR_MESH=Wb();a.INVALID=Vb();
|
|
a.POSITION=Pb();a.NORMAL=lc();a.COLOR=Ob();a.TEX_COORD=oc();a.GENERIC=ac()}a.calledRun?c():Ta.unshift(c)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return n};
|