mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-10-18 18:31:28 +08:00
Updated snapshot to 1.2.5
* On average 10% faster decoding * Improved Javascript metadata API * Bug fixes
This commit is contained in:
parent
3ea3cd8b20
commit
3faff31654
@ -529,6 +529,7 @@ set(draco_metadata_dec_sources
|
|||||||
"${draco_src_root}/metadata/metadata_decoder.cc"
|
"${draco_src_root}/metadata/metadata_decoder.cc"
|
||||||
"${draco_src_root}/metadata/metadata_decoder.h")
|
"${draco_src_root}/metadata/metadata_decoder.h")
|
||||||
|
|
||||||
|
|
||||||
set(draco_js_dec_sources
|
set(draco_js_dec_sources
|
||||||
"${draco_src_root}/javascript/emscripten/decoder_webidl_wrapper.cc"
|
"${draco_src_root}/javascript/emscripten/decoder_webidl_wrapper.cc"
|
||||||
"${draco_src_root}/javascript/emscripten/draco_decoder_glue_wrapper.cc")
|
"${draco_src_root}/javascript/emscripten/draco_decoder_glue_wrapper.cc")
|
||||||
@ -537,6 +538,7 @@ set(draco_js_enc_sources
|
|||||||
"${draco_src_root}/javascript/emscripten/draco_encoder_glue_wrapper.cc"
|
"${draco_src_root}/javascript/emscripten/draco_encoder_glue_wrapper.cc"
|
||||||
"${draco_src_root}/javascript/emscripten/encoder_webidl_wrapper.cc")
|
"${draco_src_root}/javascript/emscripten/encoder_webidl_wrapper.cc")
|
||||||
|
|
||||||
|
|
||||||
set(draco_test_sources
|
set(draco_test_sources
|
||||||
"${draco_src_root}/attributes/point_attribute_test.cc"
|
"${draco_src_root}/attributes/point_attribute_test.cc"
|
||||||
"${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_transform_test.cc"
|
"${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_transform_test.cc"
|
||||||
@ -631,6 +633,7 @@ if (EMSCRIPTEN)
|
|||||||
message(FATAL_ERROR "Glue generation failed.")
|
message(FATAL_ERROR "Glue generation failed.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# Add a custom rule depending on the IDL to regenerate
|
# Add a custom rule depending on the IDL to regenerate
|
||||||
# ${draco_build_dir}/glue_decoder.cpp as needed.
|
# ${draco_build_dir}/glue_decoder.cpp as needed.
|
||||||
add_custom_command(OUTPUT ${draco_build_dir}/glue_decoder.cpp
|
add_custom_command(OUTPUT ${draco_build_dir}/glue_decoder.cpp
|
||||||
@ -653,48 +656,55 @@ if (EMSCRIPTEN)
|
|||||||
WORKING_DIRECTORY ${draco_build_dir}
|
WORKING_DIRECTORY ${draco_build_dir}
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
|
|
||||||
|
|
||||||
# Add path to glue_decoder.cpp to draco include paths.
|
# Add path to glue_decoder.cpp to draco include paths.
|
||||||
include_directories("${draco_build_dir}")
|
include_directories("${draco_build_dir}")
|
||||||
|
|
||||||
|
set(draco_decoder_src
|
||||||
|
${draco_attributes_sources}
|
||||||
|
${draco_compression_attributes_dec_sources}
|
||||||
|
${draco_compression_attributes_pred_schemes_dec_sources}
|
||||||
|
${draco_compression_decode_sources}
|
||||||
|
${draco_compression_mesh_dec_sources}
|
||||||
|
${draco_compression_point_cloud_dec_sources}
|
||||||
|
${draco_core_sources}
|
||||||
|
${draco_core_bit_coders_sources}
|
||||||
|
${draco_dec_config_sources}
|
||||||
|
${draco_io_sources}
|
||||||
|
${draco_mesh_sources}
|
||||||
|
${draco_metadata_dec_sources}
|
||||||
|
${draco_metadata_sources}
|
||||||
|
${draco_point_cloud_sources}
|
||||||
|
${draco_points_dec_sources}
|
||||||
|
${draco_version_sources})
|
||||||
|
set(draco_encoder_src
|
||||||
|
${draco_attributes_sources}
|
||||||
|
${draco_compression_attributes_enc_sources}
|
||||||
|
${draco_compression_attributes_pred_schemes_enc_sources}
|
||||||
|
${draco_compression_encode_sources}
|
||||||
|
${draco_compression_mesh_enc_sources}
|
||||||
|
${draco_compression_point_cloud_enc_sources}
|
||||||
|
${draco_core_sources}
|
||||||
|
${draco_core_bit_coders_sources}
|
||||||
|
${draco_enc_config_sources}
|
||||||
|
${draco_io_sources}
|
||||||
|
${draco_mesh_sources}
|
||||||
|
${draco_metadata_enc_sources}
|
||||||
|
${draco_metadata_sources}
|
||||||
|
${draco_point_cloud_sources}
|
||||||
|
${draco_points_enc_sources}
|
||||||
|
${draco_version_sources})
|
||||||
|
|
||||||
|
|
||||||
add_executable(draco_decoder
|
add_executable(draco_decoder
|
||||||
${draco_attributes_sources}
|
|
||||||
${draco_compression_attributes_dec_sources}
|
|
||||||
${draco_compression_attributes_pred_schemes_dec_sources}
|
|
||||||
${draco_compression_decode_sources}
|
|
||||||
${draco_compression_mesh_dec_sources}
|
|
||||||
${draco_compression_point_cloud_dec_sources}
|
|
||||||
${draco_core_sources}
|
|
||||||
${draco_core_bit_coders_sources}
|
|
||||||
${draco_dec_config_sources}
|
|
||||||
${draco_io_sources}
|
|
||||||
${draco_mesh_sources}
|
|
||||||
${draco_metadata_dec_sources}
|
|
||||||
${draco_metadata_sources}
|
|
||||||
${draco_point_cloud_sources}
|
|
||||||
${draco_points_dec_sources}
|
|
||||||
${draco_js_dec_sources}
|
${draco_js_dec_sources}
|
||||||
${draco_version_sources})
|
${draco_decoder_src})
|
||||||
append_link_flag_to_target(draco_decoder
|
append_link_flag_to_target(draco_decoder
|
||||||
"-s EXPORT_NAME=\"'DracoDecoderModule'\"")
|
"-s EXPORT_NAME=\"'DracoDecoderModule'\"")
|
||||||
|
|
||||||
add_executable(draco_encoder
|
add_executable(draco_encoder
|
||||||
${draco_attributes_sources}
|
|
||||||
${draco_compression_attributes_enc_sources}
|
|
||||||
${draco_compression_attributes_pred_schemes_enc_sources}
|
|
||||||
${draco_compression_encode_sources}
|
|
||||||
${draco_compression_mesh_enc_sources}
|
|
||||||
${draco_compression_point_cloud_enc_sources}
|
|
||||||
${draco_core_sources}
|
|
||||||
${draco_core_bit_coders_sources}
|
|
||||||
${draco_enc_config_sources}
|
|
||||||
${draco_io_sources}
|
|
||||||
${draco_mesh_sources}
|
|
||||||
${draco_metadata_enc_sources}
|
|
||||||
${draco_metadata_sources}
|
|
||||||
${draco_point_cloud_sources}
|
|
||||||
${draco_points_enc_sources}
|
|
||||||
${draco_js_enc_sources}
|
${draco_js_enc_sources}
|
||||||
${draco_version_sources})
|
${draco_encoder_src})
|
||||||
append_link_flag_to_target(draco_encoder
|
append_link_flag_to_target(draco_encoder
|
||||||
"-s EXPORT_NAME=\"'DracoEncoderModule'\"")
|
"-s EXPORT_NAME=\"'DracoEncoderModule'\"")
|
||||||
|
|
||||||
@ -723,6 +733,7 @@ if (EMSCRIPTEN)
|
|||||||
em_link_post_js(draco_encoder
|
em_link_post_js(draco_encoder
|
||||||
"${draco_build_dir}/glue_encoder.js"
|
"${draco_build_dir}/glue_encoder.js"
|
||||||
"${draco_src_root}/javascript/emscripten/finalize.js")
|
"${draco_src_root}/javascript/emscripten/finalize.js")
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
# Standard Draco libs, encoder and decoder.
|
# Standard Draco libs, encoder and decoder.
|
||||||
# Object collections that mirror the Draco directory structure.
|
# Object collections that mirror the Draco directory structure.
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
|
|
||||||
News
|
News
|
||||||
=======
|
=======
|
||||||
|
### Version 1.2.5 release
|
||||||
|
* On average 10% faster decoding
|
||||||
|
* Improved Javascript metadata API
|
||||||
|
* Bug fixes
|
||||||
|
|
||||||
### Version 1.2.4 release
|
### Version 1.2.4 release
|
||||||
* Up to 20% faster decoding
|
* Up to 20% faster decoding
|
||||||
* Added support for integer attributes to our Javascript Encoder
|
* Added support for integer attributes to our Javascript Encoder
|
||||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -13,15 +13,15 @@ new g(function(c,f){v=c;R=f});this.callWhenSettled_(n(c,v),n(f,R));return D};g.p
|
|||||||
g.race=function(c){return new g(function(f,g){for(var v=$jscomp.makeIterator(c),u=v.next();!u.done;u=v.next())n(u.value).callWhenSettled_(f,g)})};g.all=function(c){var f=$jscomp.makeIterator(c),u=f.next();return u.done?n([]):new g(function(c,g){function D(f){return function(g){v[f]=g;L--;0==L&&c(v)}}var v=[],L=0;do v.push(void 0),L++,n(u.value).callWhenSettled_(D(v.length-1),g),u=f.next();while(!u.done)})};return g},"es6","es3");
|
g.race=function(c){return new g(function(f,g){for(var v=$jscomp.makeIterator(c),u=v.next();!u.done;u=v.next())n(u.value).callWhenSettled_(f,g)})};g.all=function(c){var f=$jscomp.makeIterator(c),u=f.next();return u.done?n([]):new g(function(c,g){function D(f){return function(g){v[f]=g;L--;0==L&&c(v)}}var v=[],L=0;do v.push(void 0),L++,n(u.value).callWhenSettled_(D(v.length-1),g),u=f.next();while(!u.done)})};return g},"es6","es3");
|
||||||
var DracoDecoderModule=function(c){function f(a,b){a||S("Assertion failed: "+b)}function n(e,b){if(0===b||!e)return"";for(var d=0,l,c=0;;){l=O[e+c>>0];d|=l;if(0==l&&!b)break;c++;if(b&&c==b)break}b||(b=c);l="";if(128>d){for(;0<b;)d=String.fromCharCode.apply(String,O.subarray(e,e+Math.min(b,1024))),l=l?l+d:d,e+=1024,b-=1024;return l}return a.UTF8ToString(e)}function D(a){return a.replace(/__Z[\w\d_]+/g,function(a){return a===a?a:a+" ["+a+"]"})}function g(){a:{var e=Error();if(!e.stack){try{throw Error(0);
|
var DracoDecoderModule=function(c){function f(a,b){a||S("Assertion failed: "+b)}function n(e,b){if(0===b||!e)return"";for(var d=0,l,c=0;;){l=O[e+c>>0];d|=l;if(0==l&&!b)break;c++;if(b&&c==b)break}b||(b=c);l="";if(128>d){for(;0<b;)d=String.fromCharCode.apply(String,O.subarray(e,e+Math.min(b,1024))),l=l?l+d:d,e+=1024,b-=1024;return l}return a.UTF8ToString(e)}function D(a){return a.replace(/__Z[\w\d_]+/g,function(a){return a===a?a:a+" ["+a+"]"})}function g(){a:{var e=Error();if(!e.stack){try{throw Error(0);
|
||||||
}catch(b){e=b}if(!e.stack){e="(no stack trace available)";break a}}e=e.stack.toString()}a.extraStackTrace&&(e+="\n"+a.extraStackTrace());return D(e)}function ha(a,b){0<a%b&&(a+=b-a%b);return a}function R(){a.HEAP8=ba=new Int8Array(E);a.HEAP16=ua=new Int16Array(E);a.HEAP32=w=new Int32Array(E);a.HEAPU8=O=new Uint8Array(E);a.HEAPU16=Ja=new Uint16Array(E);a.HEAPU32=Ka=new Uint32Array(E);a.HEAPF32=La=new Float32Array(E);a.HEAPF64=Ma=new Float64Array(E)}function Ha(){var e=a.usingWasm?va:Na,b=2147483648-
|
}catch(b){e=b}if(!e.stack){e="(no stack trace available)";break a}}e=e.stack.toString()}a.extraStackTrace&&(e+="\n"+a.extraStackTrace());return D(e)}function ha(a,b){0<a%b&&(a+=b-a%b);return a}function R(){a.HEAP8=ba=new Int8Array(E);a.HEAP16=ua=new Int16Array(E);a.HEAP32=w=new Int32Array(E);a.HEAPU8=O=new Uint8Array(E);a.HEAPU16=Ja=new Uint16Array(E);a.HEAPU32=Ka=new Uint32Array(E);a.HEAPF32=La=new Float32Array(E);a.HEAPF64=Ma=new Float64Array(E)}function Ha(){var e=a.usingWasm?va:Na,b=2147483648-
|
||||||
e;if(w[W>>2]>b)return!1;var d=x;for(x=Math.max(x,db);x<w[W>>2];)x=536870912>=x?ha(2*x,e):Math.min(ha((3*x+2147483648)/4,e),b);e=a.reallocBuffer(x);if(!e||e.byteLength!=x)return x=d,!1;a.buffer=E=e;R();return!0}function u(e){for(;0<e.length;){var b=e.shift();if("function"==typeof b)b();else{var d=b.func;"number"===typeof d?void 0===b.arg?a.dynCall_v(d):a.dynCall_vi(d,b.arg):d(void 0===b.arg?null:b.arg)}}}function v(e){ca++;a.monitorRunDependencies&&a.monitorRunDependencies(ca)}function Ia(e){ca--;
|
e;if(w[X>>2]>b)return!1;var d=x;for(x=Math.max(x,db);x<w[X>>2];)x=536870912>=x?ha(2*x,e):Math.min(ha((3*x+2147483648)/4,e),b);e=a.reallocBuffer(x);if(!e||e.byteLength!=x)return x=d,!1;a.buffer=E=e;R();return!0}function u(e){for(;0<e.length;){var b=e.shift();if("function"==typeof b)b();else{var d=b.func;"number"===typeof d?void 0===b.arg?a.dynCall_v(d):a.dynCall_vi(d,b.arg):d(void 0===b.arg?null:b.arg)}}}function v(e){ca++;a.monitorRunDependencies&&a.monitorRunDependencies(ca)}function Ia(e){ca--;
|
||||||
a.monitorRunDependencies&&a.monitorRunDependencies(ca);0==ca&&(null!==wa&&(clearInterval(wa),wa=null),oa&&(e=oa,oa=null,e()))}function ia(){return!!ia.uncaught_exception}function ma(){var e=z.last;if(!e)return(m.setTempRet0(0),0)|0;var b=z.infos[e],d=b.type;if(!d)return(m.setTempRet0(0),e)|0;var l=Array.prototype.slice.call(arguments);a.___cxa_is_pointer_type(d);ma.buffer||(ma.buffer=Oa(4));w[ma.buffer>>2]=e;e=ma.buffer;for(var c=0;c<l.length;c++)if(l[c]&&a.___cxa_can_catch(l[c],d,e))return e=w[e>>
|
a.monitorRunDependencies&&a.monitorRunDependencies(ca);0==ca&&(null!==wa&&(clearInterval(wa),wa=null),oa&&(e=oa,oa=null,e()))}function ia(){return!!ia.uncaught_exception}function ma(){var e=z.last;if(!e)return(m.setTempRet0(0),0)|0;var b=z.infos[e],d=b.type;if(!d)return(m.setTempRet0(0),e)|0;var l=Array.prototype.slice.call(arguments);a.___cxa_is_pointer_type(d);ma.buffer||(ma.buffer=Oa(4));w[ma.buffer>>2]=e;e=ma.buffer;for(var c=0;c<l.length;c++)if(l[c]&&a.___cxa_can_catch(l[c],d,e))return e=w[e>>
|
||||||
2],b.adjusted=e,(m.setTempRet0(l[c]),e)|0;e=w[e>>2];return(m.setTempRet0(d),e)|0}function L(e,b){t.varargs=b;try{var d=t.get(),l=t.get(),c=t.get();e=0;L.buffer||(L.buffers=[null,[],[]],L.printChar=function(b,e){var d=L.buffers[b];f(d);if(0===e||10===e){b=1===b?a.print:a.printErr;a:{for(var l=e=0;d[l];)++l;if(16<l-e&&d.subarray&&Pa)e=Pa.decode(d.subarray(e,l));else for(l="";;){var c=d[e++];if(!c){e=l;break a}if(c&128){var g=d[e++]&63;if(192==(c&224))l+=String.fromCharCode((c&31)<<6|g);else{var h=d[e++]&
|
2],b.adjusted=e,(m.setTempRet0(l[c]),e)|0;e=w[e>>2];return(m.setTempRet0(d),e)|0}function L(e,b){t.varargs=b;try{var d=t.get(),l=t.get(),c=t.get();e=0;L.buffer||(L.buffers=[null,[],[]],L.printChar=function(b,e){var d=L.buffers[b];f(d);if(0===e||10===e){b=1===b?a.print:a.printErr;a:{for(var l=e=0;d[l];)++l;if(16<l-e&&d.subarray&&Pa)e=Pa.decode(d.subarray(e,l));else for(l="";;){var c=d[e++];if(!c){e=l;break a}if(c&128){var g=d[e++]&63;if(192==(c&224))l+=String.fromCharCode((c&31)<<6|g);else{var h=d[e++]&
|
||||||
63;if(224==(c&240))c=(c&15)<<12|g<<6|h;else{var F=d[e++]&63;if(240==(c&248))c=(c&7)<<18|g<<12|h<<6|F;else{var k=d[e++]&63;if(248==(c&252))c=(c&3)<<24|g<<18|h<<12|F<<6|k;else{var pa=d[e++]&63;c=(c&1)<<30|g<<24|h<<18|F<<12|k<<6|pa}}}65536>c?l+=String.fromCharCode(c):(c-=65536,l+=String.fromCharCode(55296|c>>10,56320|c&1023))}}else l+=String.fromCharCode(c)}}b(e);d.length=0}else d.push(e)});for(b=0;b<c;b++){for(var g=w[l+8*b>>2],h=w[l+(8*b+4)>>2],k=0;k<h;k++)L.printChar(d,O[g+k]);e+=h}return e}catch(xa){return"undefined"!==
|
63;if(224==(c&240))c=(c&15)<<12|g<<6|h;else{var F=d[e++]&63;if(240==(c&248))c=(c&7)<<18|g<<12|h<<6|F;else{var k=d[e++]&63;if(248==(c&252))c=(c&3)<<24|g<<18|h<<12|F<<6|k;else{var pa=d[e++]&63;c=(c&1)<<30|g<<24|h<<18|F<<12|k<<6|pa}}}65536>c?l+=String.fromCharCode(c):(c-=65536,l+=String.fromCharCode(55296|c>>10,56320|c&1023))}}else l+=String.fromCharCode(c)}}b(e);d.length=0}else d.push(e)});for(b=0;b<c;b++){for(var g=w[l+8*b>>2],h=w[l+(8*b+4)>>2],k=0;k<h;k++)L.printChar(d,O[g+k]);e+=h}return e}catch(xa){return"undefined"!==
|
||||||
typeof FS&&xa instanceof FS.ErrnoError||S(xa),-xa.errno}}function na(e,b){na.seen||(na.seen={});e in na.seen||(a.dynCall_v(b),na.seen[e]=1)}function aa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function ya(e){function b(){if(!a.calledRun&&(a.calledRun=!0,!ja)){Qa||(Qa=!0,u(Ra));u(Sa);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ta.unshift(a.postRun.shift());
|
typeof FS&&xa instanceof FS.ErrnoError||S(xa),-xa.errno}}function na(e,b){na.seen||(na.seen={});e in na.seen||(a.dynCall_v(b),na.seen[e]=1)}function aa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function ya(e){function b(){if(!a.calledRun&&(a.calledRun=!0,!ja)){Qa||(Qa=!0,u(Ra));u(Sa);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ta.unshift(a.postRun.shift());
|
||||||
u(Ta)}}null===Ua&&(Ua=Date.now());if(!(0<ca)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Va.unshift(a.preRun.shift());u(Va);0<ca||a.calledRun||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}function S(e){if(a.onAbort)a.onAbort(e);void 0!==e?(a.print(e),a.printErr(e),e=JSON.stringify(e)):e="";ja=!0;var b="abort("+e+") at "+g()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";
|
u(Ta)}}null===Ua&&(Ua=Date.now());if(!(0<ca)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Va.unshift(a.preRun.shift());u(Va);0<ca||a.calledRun||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}function S(e){if(a.onAbort)a.onAbort(e);void 0!==e?(a.print(e),a.printErr(e),e=JSON.stringify(e)):e="";ja=!0;var b="abort("+e+") at "+g()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";
|
||||||
Wa&&Wa.forEach(function(a){b=a(b,e)});throw b;}function q(){}function B(a){return(a||q).__cache__}function T(a,b){var e=B(b),c=e[a];if(c)return c;c=Object.create((b||q).prototype);c.ptr=a;return e[a]=c}function X(a){if("string"===typeof a){for(var b=0,e=0;e<a.length;++e){var c=a.charCodeAt(e);55296<=c&&57343>=c&&(c=65536+((c&1023)<<10)|a.charCodeAt(++e)&1023);127>=c?++b:b=2047>=c?b+2:65535>=c?b+3:2097151>=c?b+4:67108863>=c?b+5:b+6}b=Array(b+1);e=0;c=b.length;if(0<c){c=e+c-1;for(var f=0;f<a.length;++f){var g=
|
Wa&&Wa.forEach(function(a){b=a(b,e)});throw b;}function r(){}function B(a){return(a||r).__cache__}function T(a,b){var e=B(b),c=e[a];if(c)return c;c=Object.create((b||r).prototype);c.ptr=a;return e[a]=c}function U(a){if("string"===typeof a){for(var b=0,e=0;e<a.length;++e){var c=a.charCodeAt(e);55296<=c&&57343>=c&&(c=65536+((c&1023)<<10)|a.charCodeAt(++e)&1023);127>=c?++b:b=2047>=c?b+2:65535>=c?b+3:2097151>=c?b+4:67108863>=c?b+5:b+6}b=Array(b+1);e=0;c=b.length;if(0<c){c=e+c-1;for(var f=0;f<a.length;++f){var g=
|
||||||
a.charCodeAt(f);55296<=g&&57343>=g&&(g=65536+((g&1023)<<10)|a.charCodeAt(++f)&1023);if(127>=g){if(e>=c)break;b[e++]=g}else{if(2047>=g){if(e+1>=c)break;b[e++]=192|g>>6}else{if(65535>=g){if(e+2>=c)break;b[e++]=224|g>>12}else{if(2097151>=g){if(e+3>=c)break;b[e++]=240|g>>18}else{if(67108863>=g){if(e+4>=c)break;b[e++]=248|g>>24}else{if(e+5>=c)break;b[e++]=252|g>>30;b[e++]=128|g>>24&63}b[e++]=128|g>>18&63}b[e++]=128|g>>12&63}b[e++]=128|g>>6&63}b[e++]=128|g&63}}b[e]=0}a=k.alloc(b,ba);k.copy(b,ba,a)}return a}
|
a.charCodeAt(f);55296<=g&&57343>=g&&(g=65536+((g&1023)<<10)|a.charCodeAt(++f)&1023);if(127>=g){if(e>=c)break;b[e++]=g}else{if(2047>=g){if(e+1>=c)break;b[e++]=192|g>>6}else{if(65535>=g){if(e+2>=c)break;b[e++]=224|g>>12}else{if(2097151>=g){if(e+3>=c)break;b[e++]=240|g>>18}else{if(67108863>=g){if(e+4>=c)break;b[e++]=248|g>>24}else{if(e+5>=c)break;b[e++]=252|g>>30;b[e++]=128|g>>24&63}b[e++]=128|g>>18&63}b[e++]=128|g>>12&63}b[e++]=128|g>>6&63}b[e++]=128|g&63}}b[e]=0}a=k.alloc(b,ba);k.copy(b,ba,a)}return a}
|
||||||
function A(){throw"cannot construct a Status, no constructor in IDL";}function G(){this.ptr=gb();B(G)[this.ptr]=this}function H(){this.ptr=hb();B(H)[this.ptr]=this}function p(){this.ptr=ib();B(p)[this.ptr]=this}function K(){this.ptr=jb();B(K)[this.ptr]=this}function y(){this.ptr=kb();B(y)[this.ptr]=this}function r(){this.ptr=lb();B(r)[this.ptr]=this}function I(){this.ptr=mb();B(I)[this.ptr]=this}function U(){this.ptr=nb();B(U)[this.ptr]=this}function M(){this.ptr=ob();B(M)[this.ptr]=this}function h(){this.ptr=
|
function A(){throw"cannot construct a Status, no constructor in IDL";}function G(){this.ptr=gb();B(G)[this.ptr]=this}function H(){this.ptr=hb();B(H)[this.ptr]=this}function p(){this.ptr=ib();B(p)[this.ptr]=this}function K(){this.ptr=jb();B(K)[this.ptr]=this}function y(){this.ptr=kb();B(y)[this.ptr]=this}function q(){this.ptr=lb();B(q)[this.ptr]=this}function I(){this.ptr=mb();B(I)[this.ptr]=this}function V(){this.ptr=nb();B(V)[this.ptr]=this}function M(){this.ptr=ob();B(M)[this.ptr]=this}function h(){this.ptr=
|
||||||
pb();B(h)[this.ptr]=this}function C(){this.ptr=qb();B(C)[this.ptr]=this}function Y(){throw"cannot construct a VoidPtr, no constructor in IDL";}function J(){this.ptr=rb();B(J)[this.ptr]=this}function N(){this.ptr=sb();B(N)[this.ptr]=this}var a=c=c||{},Xa=!1,Ya=!1;a.onRuntimeInitialized=function(){Xa=!0;if(Ya&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ya=!0;if(Xa&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==
|
pb();B(h)[this.ptr]=this}function C(){this.ptr=qb();B(C)[this.ptr]=this}function Y(){throw"cannot construct a VoidPtr, no constructor in IDL";}function J(){this.ptr=rb();B(J)[this.ptr]=this}function N(){this.ptr=sb();B(N)[this.ptr]=this}var a=c=c||{},Xa=!1,Ya=!1;a.onRuntimeInitialized=function(){Xa=!0;if(Ya&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ya=!0;if(Xa&&"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?!1:1==a[0]&&0<=a[1]&&2>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};a||(a=("undefined"!==typeof c?c:null)||{});var qa={},Z;for(Z in a)a.hasOwnProperty(Z)&&(qa[Z]=a[Z]);var ka=!1,fa=!1,la=!1,ra=!1;if(a.ENVIRONMENT)if("WEB"===a.ENVIRONMENT)ka=!0;else if("WORKER"===a.ENVIRONMENT)fa=!0;else if("NODE"===a.ENVIRONMENT)la=!0;else if("SHELL"===a.ENVIRONMENT)ra=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");
|
typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0<=a[1]&&2>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};a||(a=("undefined"!==typeof c?c:null)||{});var qa={},Z;for(Z in a)a.hasOwnProperty(Z)&&(qa[Z]=a[Z]);var ka=!1,fa=!1,la=!1,ra=!1;if(a.ENVIRONMENT)if("WEB"===a.ENVIRONMENT)ka=!0;else if("WORKER"===a.ENVIRONMENT)fa=!0;else if("NODE"===a.ENVIRONMENT)la=!0;else if("SHELL"===a.ENVIRONMENT)ra=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");
|
||||||
else ka="object"===typeof window,fa="function"===typeof importScripts,la="object"===typeof process&&"function"===typeof require&&!ka&&!fa,ra=!ka&&!la&&!fa;if(la){a.print||(a.print=console.log);a.printErr||(a.printErr=console.warn);var za,Aa;a.read=function(a,b){za||(za=require("fs"));Aa||(Aa=require("path"));a=Aa.normalize(a);a=za.readFileSync(a);return b?a:a.toString()};a.readBinary=function(e){e=a.read(e,!0);e.buffer||(e=new Uint8Array(e));f(e.buffer);return e};a.thisProgram||(a.thisProgram=1<process.argv.length?
|
else ka="object"===typeof window,fa="function"===typeof importScripts,la="object"===typeof process&&"function"===typeof require&&!ka&&!fa,ra=!ka&&!la&&!fa;if(la){a.print||(a.print=console.log);a.printErr||(a.printErr=console.warn);var za,Aa;a.read=function(a,b){za||(za=require("fs"));Aa||(Aa=require("path"));a=Aa.normalize(a);a=za.readFileSync(a);return b?a:a.toString()};a.readBinary=function(e){e=a.read(e,!0);e.buffer||(e=new Uint8Array(e));f(e.buffer);return e};a.thisProgram||(a.thisProgram=1<process.argv.length?
|
||||||
@ -32,18 +32,18 @@ a.print||(a.print=function(){});a.printErr||(a.printErr=a.print);a.arguments||(a
|
|||||||
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]?m.QUANTUM_SIZE:"i"===a[0]?(a=parseInt(a.substr(1)),f(0===a%8),a/8):0}},getNativeFieldSize:function(a){return Math.max(m.getNativeTypeSize(a),m.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(a,b){"double"===b||"i64"===b?a&7&&(f(4===(a&7)),a+=4):f(0===(a&3));return a},getAlignSize:function(a,b,d){return d||"i64"!=a&&"double"!=a?a?Math.min(b||(a?m.getNativeFieldSize(a):
|
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]?m.QUANTUM_SIZE:"i"===a[0]?(a=parseInt(a.substr(1)),f(0===a%8),a/8):0}},getNativeFieldSize:function(a){return Math.max(m.getNativeTypeSize(a),m.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(a,b){"double"===b||"i64"===b?a&7&&(f(4===(a&7)),a+=4):f(0===(a&3));return a},getAlignSize:function(a,b,d){return d||"i64"!=a&&"double"!=a?a?Math.min(b||(a?m.getNativeFieldSize(a):
|
||||||
0),m.QUANTUM_SIZE):Math.min(b,8):8},dynCall:function(e,b,d){return d&&d.length?a["dynCall_"+e].apply(null,[b].concat(d)):a["dynCall_"+e].call(null,b)},functionPointers:[],addFunction:function(a){for(var b=0;b<m.functionPointers.length;b++)if(!m.functionPointers[b])return m.functionPointers[b]=a,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";},removeFunction:function(a){m.functionPointers[(a-2)/2]=null},warnOnce:function(e){m.warnOnce.shown||
|
0),m.QUANTUM_SIZE):Math.min(b,8):8},dynCall:function(e,b,d){return d&&d.length?a["dynCall_"+e].apply(null,[b].concat(d)):a["dynCall_"+e].call(null,b)},functionPointers:[],addFunction:function(a){for(var b=0;b<m.functionPointers.length;b++)if(!m.functionPointers[b])return m.functionPointers[b]=a,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";},removeFunction:function(a){m.functionPointers[(a-2)/2]=null},warnOnce:function(e){m.warnOnce.shown||
|
||||||
(m.warnOnce.shown={});m.warnOnce.shown[e]||(m.warnOnce.shown[e]=1,a.printErr(e))},funcWrappers:{},getFuncWrapper:function(a,b){if(a){f(b);m.funcWrappers[b]||(m.funcWrappers[b]={});var d=m.funcWrappers[b];d[a]||(d[a]=1===b.length?function(){return m.dynCall(b,a)}:2===b.length?function(d){return m.dynCall(b,a,[d])}:function(){return m.dynCall(b,a,Array.prototype.slice.call(arguments))});return d[a]}},getCompilerSetting:function(a){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work";
|
(m.warnOnce.shown={});m.warnOnce.shown[e]||(m.warnOnce.shown[e]=1,a.printErr(e))},funcWrappers:{},getFuncWrapper:function(a,b){if(a){f(b);m.funcWrappers[b]||(m.funcWrappers[b]={});var d=m.funcWrappers[b];d[a]||(d[a]=1===b.length?function(){return m.dynCall(b,a)}:2===b.length?function(d){return m.dynCall(b,a,[d])}:function(){return m.dynCall(b,a,Array.prototype.slice.call(arguments))});return d[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=P;P=P+a|0;P=P+15&-16;return b},staticAlloc:function(a){var b=V;V=V+a|0;V=V+15&-16;return b},dynamicAlloc:function(a){var b=w[W>>2];a=(b+a+15|0)&-16;w[W>>2]=a;return a>=x&&!Ha()?(w[W>>2]=b,0):b},alignMemory:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},makeBigInt:function(a,b,d){return d?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*+(b|0)},GLOBAL_BASE:1024,QUANTUM_SIZE:4,__dummy__:0},ja=0,Pa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==
|
},stackAlloc:function(a){var b=P;P=P+a|0;P=P+15&-16;return b},staticAlloc:function(a){var b=W;W=W+a|0;W=W+15&-16;return b},dynamicAlloc:function(a){var b=w[X>>2];a=(b+a+15|0)&-16;w[X>>2]=a;return a>=x&&!Ha()?(w[X>>2]=b,0):b},alignMemory:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},makeBigInt:function(a,b,d){return d?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*+(b|0)},GLOBAL_BASE:1024,QUANTUM_SIZE:4,__dummy__:0},ja=0,Pa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==
|
||||||
typeof TextDecoder&&new TextDecoder("utf-16le");var va=65536,Na=16777216,db=16777216,ba,O,ua,Ja,w,Ka,La,Ma,V,Ba,P,sa,Ca,W;var Da=V=Ba=P=sa=Ca=W=0;a.reallocBuffer||(a.reallocBuffer=function(a){try{if(ArrayBuffer.transfer)var b=ArrayBuffer.transfer(E,a);else{var d=ba;b=new ArrayBuffer(a);(new Int8Array(b)).set(d)}}catch(l){return!1}return tb(b)?b:!1});try{var Ea=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);Ea(new ArrayBuffer(4))}catch(e){Ea=function(a){return a.byteLength}}var Fa=
|
typeof TextDecoder&&new TextDecoder("utf-16le");var va=65536,Na=16777216,db=16777216,ba,O,ua,Ja,w,Ka,La,Ma,W,Ba,P,sa,Ca,X;var Da=W=Ba=P=sa=Ca=X=0;a.reallocBuffer||(a.reallocBuffer=function(a){try{if(ArrayBuffer.transfer)var b=ArrayBuffer.transfer(E,a);else{var d=ba;b=new ArrayBuffer(a);(new Int8Array(b)).set(d)}}catch(l){return!1}return tb(b)?b:!1});try{var Ea=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);Ea(new ArrayBuffer(4))}catch(e){Ea=function(a){return a.byteLength}}var Fa=
|
||||||
a.TOTAL_STACK||5242880,x=a.TOTAL_MEMORY||16777216;x<Fa&&a.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+x+"! (TOTAL_STACK="+Fa+")");if(a.buffer)var E=a.buffer;else"object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory?(a.wasmMemory=new WebAssembly.Memory({initial:x/va}),E=a.wasmMemory.buffer):E=new ArrayBuffer(x);R();w[0]=1668509029;ua[1]=25459;if(115!==O[2]||99!==O[3])throw"Runtime error: expected the system to be little-endian!";a.HEAP=void 0;a.buffer=E;a.HEAP8=
|
a.TOTAL_STACK||5242880,x=a.TOTAL_MEMORY||16777216;x<Fa&&a.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+x+"! (TOTAL_STACK="+Fa+")");if(a.buffer)var E=a.buffer;else"object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory?(a.wasmMemory=new WebAssembly.Memory({initial:x/va}),E=a.wasmMemory.buffer):E=new ArrayBuffer(x);R();w[0]=1668509029;ua[1]=25459;if(115!==O[2]||99!==O[3])throw"Runtime error: expected the system to be little-endian!";a.HEAP=void 0;a.buffer=E;a.HEAP8=
|
||||||
ba;a.HEAP16=ua;a.HEAP32=w;a.HEAPU8=O;a.HEAPU16=Ja;a.HEAPU32=Ka;a.HEAPF32=La;a.HEAPF64=Ma;var Va=[],Ra=[],Sa=[],Za=[],Ta=[],Qa=!1;f(Math.imul&&Math.fround&&Math.clz32&&Math.trunc,"this is a legacy browser, build with LEGACY_VM_SUPPORT");var ca=0,wa=null,oa=null;a.preloadedImages={};a.preloadedAudios={};var Q=null;(function(){function e(){try{if(a.wasmBinary)return new Uint8Array(a.wasmBinary);if(a.readBinary)return a.readBinary(c);throw"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)";
|
ba;a.HEAP16=ua;a.HEAP32=w;a.HEAPU8=O;a.HEAPU16=Ja;a.HEAPU32=Ka;a.HEAPF32=La;a.HEAPF64=Ma;var Va=[],Ra=[],Sa=[],Za=[],Ta=[],Qa=!1;f(Math.imul&&Math.fround&&Math.clz32&&Math.trunc,"this is a legacy browser, build with LEGACY_VM_SUPPORT");var ca=0,wa=null,oa=null;a.preloadedImages={};a.preloadedAudios={};var Q=null;(function(){function e(){try{if(a.wasmBinary)return new Uint8Array(a.wasmBinary);if(a.readBinary)return a.readBinary(c);throw"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)";
|
||||||
}catch(eb){S(eb)}}function b(){return a.wasmBinary||!ka&&!fa||"function"!==typeof fetch?new Promise(function(a,b){a(e())}):fetch(c,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+c+"'";return a.arrayBuffer()}).catch(function(){return e()})}function d(d,e,l){function f(b,d){h=b.exports;if(h.memory){b=h.memory;d=a.buffer;b.byteLength<d.byteLength&&a.printErr("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");
|
}catch(eb){S(eb)}}function b(){return a.wasmBinary||!ka&&!fa||"function"!==typeof fetch?new Promise(function(a,b){a(e())}):fetch(c,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+c+"'";return a.arrayBuffer()}).catch(function(){return e()})}function d(d,e,l){function f(b,d){h=b.exports;if(h.memory){b=h.memory;d=a.buffer;b.byteLength<d.byteLength&&a.printErr("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");
|
||||||
d=new Int8Array(d);var e=new Int8Array(b);Q||d.set(e.subarray(a.STATIC_BASE,a.STATIC_BASE+a.STATIC_BUMP),a.STATIC_BASE);e.set(d);a.buffer=E=b;R()}a.asm=h;a.usingWasm=!0;Ia("wasm-instantiate")}function k(a){f(a.instance,a.module)}function F(d){b().then(function(a){return WebAssembly.instantiate(a,g)}).then(d).catch(function(b){a.printErr("failed to asynchronously prepare wasm: "+b);S(b)})}if("object"!==typeof WebAssembly)return a.printErr("no native wasm support detected"),!1;if(!(a.wasmMemory instanceof
|
d=new Int8Array(d);var e=new Int8Array(b);Q||d.set(e.subarray(a.STATIC_BASE,a.STATIC_BASE+a.STATIC_BUMP),a.STATIC_BASE);e.set(d);a.buffer=E=b;R()}a.asm=h;a.usingWasm=!0;Ia("wasm-instantiate")}function k(a){f(a.instance,a.module)}function F(d){b().then(function(a){return WebAssembly.instantiate(a,g)}).then(d).catch(function(b){a.printErr("failed to asynchronously prepare wasm: "+b);S(b)})}if("object"!==typeof WebAssembly)return a.printErr("no native wasm support detected"),!1;if(!(a.wasmMemory instanceof
|
||||||
WebAssembly.Memory))return a.printErr("no native wasm Memory in use"),!1;e.memory=a.wasmMemory;g.global={NaN:NaN,Infinity:Infinity};g["global.Math"]=d.Math;g.env=e;v("wasm-instantiate");if(a.instantiateWasm)try{return a.instantiateWasm(g,f)}catch(fb){return a.printErr("Module.instantiateWasm callback failed with error: "+fb),!1}a.wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||0===c.indexOf("data:")||"function"!==typeof fetch?F(k):WebAssembly.instantiateStreaming(fetch(c,{credentials:"same-origin"}),
|
WebAssembly.Memory))return a.printErr("no native wasm Memory in use"),!1;e.memory=a.wasmMemory;g.global={NaN:NaN,Infinity:Infinity};g["global.Math"]=d.Math;g.env=e;v("wasm-instantiate");if(a.instantiateWasm)try{return a.instantiateWasm(g,f)}catch(fb){return a.printErr("Module.instantiateWasm callback failed with error: "+fb),!1}a.wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||0===c.indexOf("data:")||"function"!==typeof fetch?F(k):WebAssembly.instantiateStreaming(fetch(c,{credentials:"same-origin"}),
|
||||||
g).then(k).catch(function(b){a.printErr("wasm streaming compile failed: "+b);a.printErr("falling back to ArrayBuffer instantiation");F(k)});return{}}var c="draco_decoder.wasm",f="draco_decoder.temp.asm.js";"function"===typeof a.locateFile&&(a.locateFile("draco_decoder.wast"),c=a.locateFile(c),f=a.locateFile(f));var g={global:null,env:null,asm2wasm:{"f64-rem":function(a,b){return a%b},"debugger":function(){debugger}},parent:a},h=null;a.asmPreload=a.asm;var k=a.reallocBuffer;a.reallocBuffer=function(b){if("asmjs"===
|
g).then(k).catch(function(b){a.printErr("wasm streaming compile failed: "+b);a.printErr("falling back to ArrayBuffer instantiation");F(k)});return{}}var c="draco_decoder.wasm",f="draco_decoder.temp.asm.js";"function"===typeof a.locateFile&&(a.locateFile("draco_decoder.wast"),c=a.locateFile(c),f=a.locateFile(f));var g={global:null,env:null,asm2wasm:{"f64-rem":function(a,b){return a%b},"debugger":function(){debugger}},parent:a},h=null;a.asmPreload=a.asm;var k=a.reallocBuffer;a.reallocBuffer=function(b){if("asmjs"===
|
||||||
m)var d=k(b);else a:{b=ha(b,a.usingWasm?va:Na);var e=a.buffer.byteLength;if(a.usingWasm)try{d=-1!==a.wasmMemory.grow((b-e)/65536)?a.buffer=a.wasmMemory.buffer:null;break a}catch(cd){d=null;break a}d=void 0}return d};var m="";a.asm=function(b,e,c){if(!e.table){var l=a.wasmTableSize;void 0===l&&(l=1024);var f=a.wasmMaxTableSize;e.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==f?new WebAssembly.Table({initial:l,maximum:f,element:"anyfunc"}):new WebAssembly.Table({initial:l,
|
m)var d=k(b);else a:{b=ha(b,a.usingWasm?va:Na);var e=a.buffer.byteLength;if(a.usingWasm)try{d=-1!==a.wasmMemory.grow((b-e)/65536)?a.buffer=a.wasmMemory.buffer:null;break a}catch(fd){d=null;break a}d=void 0}return d};var m="";a.asm=function(b,e,c){if(!e.table){var l=a.wasmTableSize;void 0===l&&(l=1024);var f=a.wasmMaxTableSize;e.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==f?new WebAssembly.Table({initial:l,maximum:f,element:"anyfunc"}):new WebAssembly.Table({initial:l,
|
||||||
element:"anyfunc"}):Array(l);a.wasmTable=e.table}e.memoryBase||(e.memoryBase=a.STATIC_BASE);e.tableBase||(e.tableBase=0);(b=d(b,e,c))||S("no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods");return b}})();Da=m.GLOBAL_BASE;V=Da+23360;Ra.push();Q=null;a.STATIC_BASE=Da;a.STATIC_BUMP=23360;var ub=V;V+=16;var z={last:0,caught:[],infos:{},deAdjust:function(a){if(!a||z.infos[a])return a;
|
element:"anyfunc"}):Array(l);a.wasmTable=e.table}e.memoryBase||(e.memoryBase=a.STATIC_BASE);e.tableBase||(e.tableBase=0);(b=d(b,e,c))||S("no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods");return b}})();Da=m.GLOBAL_BASE;W=Da+23664;Ra.push();Q=null;a.STATIC_BASE=Da;a.STATIC_BUMP=23664;var ub=W;W+=16;var z={last:0,caught:[],infos:{},deAdjust:function(a){if(!a||z.infos[a])return a;
|
||||||
for(var b in z.infos)if(z.infos[b].adjusted===a)return b;return a},addRef:function(a){a&&z.infos[a].refcount++},decRef:function(e){if(e){var b=z.infos[e];f(0<b.refcount);b.refcount--;0!==b.refcount||b.rethrown||(b.destructor&&a.dynCall_vi(b.destructor,e),delete z.infos[e],___cxa_free_exception(e))}},clearRef:function(a){a&&(z.infos[a].refcount=0)}},t={varargs:0,get:function(a){t.varargs+=4;return w[t.varargs-4>>2]},getStr:function(){return n(t.get())},get64:function(){var a=t.get(),b=t.get();0<=a?
|
for(var b in z.infos)if(z.infos[b].adjusted===a)return b;return a},addRef:function(a){a&&z.infos[a].refcount++},decRef:function(e){if(e){var b=z.infos[e];f(0<b.refcount);b.refcount--;0!==b.refcount||b.rethrown||(b.destructor&&a.dynCall_vi(b.destructor,e),delete z.infos[e],___cxa_free_exception(e))}},clearRef:function(a){a&&(z.infos[a].refcount=0)}},t={varargs:0,get:function(a){t.varargs+=4;return w[t.varargs-4>>2]},getStr:function(){return n(t.get())},get64:function(){var a=t.get(),b=t.get();0<=a?
|
||||||
f(0===b):f(-1===b);return a},getZero:function(){f(0===t.get())}},ta={},Ga=1;Za.push(function(){var e=a._fflush;e&&e(0);if(e=L.printChar){var b=L.buffers;b[1].length&&e(1,10);b[2].length&&e(2,10)}});W=m.staticAlloc(4);Ba=P=m.alignMemory(V);sa=Ba+Fa;Ca=m.alignMemory(sa);w[W>>2]=Ca;a.wasmTableSize=492;a.wasmMaxTableSize=492;a.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,
|
f(0===b):f(-1===b);return a},getZero:function(){f(0===t.get())}},ta={},Ga=1;Za.push(function(){var e=a._fflush;e&&e(0);if(e=L.printChar){var b=L.buffers;b[1].length&&e(1,10);b[2].length&&e(2,10)}});X=m.staticAlloc(4);Ba=P=m.alignMemory(W);sa=Ba+Fa;Ca=m.alignMemory(sa);w[X>>2]=Ca;a.wasmTableSize=492;a.wasmMaxTableSize=492;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:Ea};a.asmLibraryArg={abort:S,assert:f,enlargeMemory:Ha,getTotalMemory:function(){return x},abortOnCannotGrowMemory:function(){S("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+x+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},
|
Float64Array:Float64Array,NaN:NaN,Infinity:Infinity,byteLength:Ea};a.asmLibraryArg={abort:S,assert:f,enlargeMemory:Ha,getTotalMemory:function(){return x},abortOnCannotGrowMemory:function(){S("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+x+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},
|
||||||
invoke_ii:function(e,b){try{return a.dynCall_ii(e,b)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_iii:function(e,b,d){try{return a.dynCall_iii(e,b,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_iiii:function(e,b,d,c){try{return a.dynCall_iiii(e,b,d,c)}catch(F){if("number"!==typeof F&&"longjmp"!==F)throw F;a.setThrew(1,0)}},invoke_iiiiiii:function(e,b,d,c,f,g,h){try{return a.dynCall_iiiiiii(e,b,d,c,f,g,h)}catch(ea){if("number"!==
|
invoke_ii:function(e,b){try{return a.dynCall_ii(e,b)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_iii:function(e,b,d){try{return a.dynCall_iii(e,b,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_iiii:function(e,b,d,c){try{return a.dynCall_iiii(e,b,d,c)}catch(F){if("number"!==typeof F&&"longjmp"!==F)throw F;a.setThrew(1,0)}},invoke_iiiiiii:function(e,b,d,c,f,g,h){try{return a.dynCall_iiiiiii(e,b,d,c,f,g,h)}catch(ea){if("number"!==
|
||||||
typeof ea&&"longjmp"!==ea)throw ea;a.setThrew(1,0)}},invoke_v:function(e){try{a.dynCall_v(e)}catch(b){if("number"!==typeof b&&"longjmp"!==b)throw b;a.setThrew(1,0)}},invoke_vi:function(e,b){try{a.dynCall_vi(e,b)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_vii:function(e,b,d){try{a.dynCall_vii(e,b,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_viii:function(e,b,d,c){try{a.dynCall_viii(e,b,d,c)}catch(F){if("number"!==typeof F&&
|
typeof ea&&"longjmp"!==ea)throw ea;a.setThrew(1,0)}},invoke_v:function(e){try{a.dynCall_v(e)}catch(b){if("number"!==typeof b&&"longjmp"!==b)throw b;a.setThrew(1,0)}},invoke_vi:function(e,b){try{a.dynCall_vi(e,b)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_vii:function(e,b,d){try{a.dynCall_vii(e,b,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_viii:function(e,b,d,c){try{a.dynCall_viii(e,b,d,c)}catch(F){if("number"!==typeof F&&
|
||||||
@ -51,7 +51,7 @@ typeof ea&&"longjmp"!==ea)throw ea;a.setThrew(1,0)}},invoke_v:function(e){try{a.
|
|||||||
___assert_fail:function(a,b,d,c){ja=!0;throw"Assertion failed: "+n(a)+", at: "+[b?n(b):"unknown filename",d,c?n(c):"unknown function"]+" at "+g();},___cxa_allocate_exception:function(a){return Oa(a)},___cxa_begin_catch:function(a){var b=z.infos[a];b&&!b.caught&&(b.caught=!0,ia.uncaught_exception--);b&&(b.rethrown=!1);z.caught.push(a);z.addRef(z.deAdjust(a));return a},___cxa_find_matching_catch:ma,___cxa_pure_virtual:function(){ja=!0;throw"Pure virtual function called!";},___cxa_throw:function(a,b,
|
___assert_fail:function(a,b,d,c){ja=!0;throw"Assertion failed: "+n(a)+", at: "+[b?n(b):"unknown filename",d,c?n(c):"unknown function"]+" at "+g();},___cxa_allocate_exception:function(a){return Oa(a)},___cxa_begin_catch:function(a){var b=z.infos[a];b&&!b.caught&&(b.caught=!0,ia.uncaught_exception--);b&&(b.rethrown=!1);z.caught.push(a);z.addRef(z.deAdjust(a));return a},___cxa_find_matching_catch:ma,___cxa_pure_virtual:function(){ja=!0;throw"Pure virtual function called!";},___cxa_throw:function(a,b,
|
||||||
d){z.infos[a]={ptr:a,adjusted:a,type:b,destructor:d,refcount:0,caught:!1,rethrown:!1};z.last=a;"uncaught_exception"in ia?ia.uncaught_exception++:ia.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.";},___gxx_personality_v0:function(){},___resumeException:function(a){z.last||(z.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.";
|
d){z.infos[a]={ptr:a,adjusted:a,type:b,destructor:d,refcount:0,caught:!1,rethrown:!1};z.last=a;"uncaught_exception"in ia?ia.uncaught_exception++:ia.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.";},___gxx_personality_v0:function(){},___resumeException:function(a){z.last||(z.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.";
|
||||||
},___setErrNo:function(c){a.___errno_location&&(w[a.___errno_location()>>2]=c);return c},___syscall140:function(a,b){t.varargs=b;try{var d=t.getStreamFromFD();t.get();var c=t.get(),e=t.get(),f=t.get();FS.llseek(d,c,f);w[e>>2]=d.position;d.getdents&&0===c&&0===f&&(d.getdents=null);return 0}catch(da){return"undefined"!==typeof FS&&da instanceof FS.ErrnoError||S(da),-da.errno}},___syscall146:L,___syscall54:function(a,b){t.varargs=b;return 0},___syscall6:function(a,b){t.varargs=b;try{var d=t.getStreamFromFD();
|
},___setErrNo:function(c){a.___errno_location&&(w[a.___errno_location()>>2]=c);return c},___syscall140:function(a,b){t.varargs=b;try{var d=t.getStreamFromFD();t.get();var c=t.get(),e=t.get(),f=t.get();FS.llseek(d,c,f);w[e>>2]=d.position;d.getdents&&0===c&&0===f&&(d.getdents=null);return 0}catch(da){return"undefined"!==typeof FS&&da instanceof FS.ErrnoError||S(da),-da.errno}},___syscall146:L,___syscall54:function(a,b){t.varargs=b;return 0},___syscall6:function(a,b){t.varargs=b;try{var d=t.getStreamFromFD();
|
||||||
FS.close(d);return 0}catch(l){return"undefined"!==typeof FS&&l instanceof FS.ErrnoError||S(l),-l.errno}},_abort:function(){a.abort()},_emscripten_memcpy_big:function(a,b,d){O.set(O.subarray(b,b+d),a);return a},_pthread_getspecific:function(a){return ta[a]||0},_pthread_key_create:function(a,b){if(0==a)return 22;w[a>>2]=Ga;ta[Ga]=0;Ga++;return 0},_pthread_once:na,_pthread_setspecific:function(a,b){if(!(a in ta))return 22;ta[a]=b;return 0},DYNAMICTOP_PTR:W,tempDoublePtr:ub,ABORT:ja,STACKTOP:P,STACK_MAX:sa};
|
FS.close(d);return 0}catch(l){return"undefined"!==typeof FS&&l instanceof FS.ErrnoError||S(l),-l.errno}},_abort:function(){a.abort()},_emscripten_memcpy_big:function(a,b,d){O.set(O.subarray(b,b+d),a);return a},_pthread_getspecific:function(a){return ta[a]||0},_pthread_key_create:function(a,b){if(0==a)return 22;w[a>>2]=Ga;ta[Ga]=0;Ga++;return 0},_pthread_once:na,_pthread_setspecific:function(a,b){if(!(a in ta))return 22;ta[a]=b;return 0},DYNAMICTOP_PTR:X,tempDoublePtr:ub,ABORT:ja,STACKTOP:P,STACK_MAX:sa};
|
||||||
var $a=a.asm(a.asmGlobalArg,a.asmLibraryArg,E);a.asm=$a;a.___cxa_can_catch=function(){return a.asm.___cxa_can_catch.apply(null,arguments)};a.___cxa_is_pointer_type=function(){return a.asm.___cxa_is_pointer_type.apply(null,arguments)};var hb=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},vb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=
|
var $a=a.asm(a.asmGlobalArg,a.asmLibraryArg,E);a.asm=$a;a.___cxa_can_catch=function(){return a.asm.___cxa_can_catch.apply(null,arguments)};a.___cxa_is_pointer_type=function(){return a.asm.___cxa_is_pointer_type.apply(null,arguments)};var hb=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},vb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=
|
||||||
function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},wb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},xb=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},kb=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=
|
function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},wb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},xb=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},kb=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=
|
||||||
function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},yb=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},zb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},Ab=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=
|
function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},yb=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},zb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},Ab=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=
|
||||||
@ -66,48 +66,50 @@ Wb=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.as
|
|||||||
arguments)},Zb=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},$b=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},ac=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm._emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},rb=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm._emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,
|
arguments)},Zb=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},$b=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},ac=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm._emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},rb=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm._emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,
|
||||||
arguments)},bc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},cc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm._emscripten_bind_DracoInt32Array_size_0.apply(null,arguments)},nb=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm._emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
|
arguments)},bc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},cc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm._emscripten_bind_DracoInt32Array_size_0.apply(null,arguments)},nb=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm._emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
|
||||||
arguments)},ec=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm._emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},qb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm._emscripten_bind_Mesh_Mesh_0.apply(null,arguments)},fc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm._emscripten_bind_Mesh___destroy___0.apply(null,arguments)},gc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm._emscripten_bind_Mesh_num_attributes_0.apply(null,
|
arguments)},ec=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm._emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},qb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm._emscripten_bind_Mesh_Mesh_0.apply(null,arguments)},fc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm._emscripten_bind_Mesh___destroy___0.apply(null,arguments)},gc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm._emscripten_bind_Mesh_num_attributes_0.apply(null,
|
||||||
arguments)},hc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm._emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},ic=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm._emscripten_bind_Mesh_num_points_0.apply(null,arguments)},jc=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},kc=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,
|
arguments)},hc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm._emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},ic=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm._emscripten_bind_Mesh_num_points_0.apply(null,arguments)},jc=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},kc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,
|
||||||
arguments)},lc=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},mc=a._emscripten_bind_MetadataQuerier_HasDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasDoubleEntry_2.apply(null,arguments)},nc=a._emscripten_bind_MetadataQuerier_HasIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasIntEntry_2.apply(null,arguments)},oc=a._emscripten_bind_MetadataQuerier_HasStringEntry_2=
|
arguments)},lc=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},mc=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},nc=a._emscripten_bind_MetadataQuerier_HasDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasDoubleEntry_2.apply(null,arguments)},oc=a._emscripten_bind_MetadataQuerier_HasEntry_2=
|
||||||
function(){return a.asm._emscripten_bind_MetadataQuerier_HasStringEntry_2.apply(null,arguments)},lb=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm._emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},pc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm._emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},sb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm._emscripten_bind_Metadata_Metadata_0.apply(null,
|
function(){return a.asm._emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},pc=a._emscripten_bind_MetadataQuerier_HasIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasIntEntry_2.apply(null,arguments)},qc=a._emscripten_bind_MetadataQuerier_HasStringEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasStringEntry_2.apply(null,arguments)},lb=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm._emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,
|
||||||
arguments)},qc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm._emscripten_bind_Metadata___destroy___0.apply(null,arguments)},rc=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm._emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},ib=a._emscripten_bind_PointAttribute_PointAttribute_0=function(){return a.asm._emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},sc=a._emscripten_bind_PointAttribute___destroy___0=
|
arguments)},rc=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm._emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,arguments)},sc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm._emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},sb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm._emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},tc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm._emscripten_bind_Metadata___destroy___0.apply(null,
|
||||||
function(){return a.asm._emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},tc=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm._emscripten_bind_PointAttribute_attribute_type_0.apply(null,arguments)},uc=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},vc=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_stride_0.apply(null,
|
arguments)},uc=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm._emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},ib=a._emscripten_bind_PointAttribute_PointAttribute_0=function(){return a.asm._emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},vc=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm._emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},wc=a._emscripten_bind_PointAttribute_attribute_type_0=
|
||||||
arguments)},wc=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm._emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},xc=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm._emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},yc=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm._emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},zc=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm._emscripten_bind_PointAttribute_size_0.apply(null,
|
function(){return a.asm._emscripten_bind_PointAttribute_attribute_type_0.apply(null,arguments)},xc=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},yc=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_stride_0.apply(null,arguments)},zc=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm._emscripten_bind_PointAttribute_data_type_0.apply(null,
|
||||||
arguments)},Ac=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm._emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},gb=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm._emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},Bc=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm._emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Cc=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm._emscripten_bind_PointCloud_num_attributes_0.apply(null,
|
arguments)},Ac=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm._emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Bc=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm._emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Cc=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm._emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Dc=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm._emscripten_bind_PointAttribute_unique_id_0.apply(null,
|
||||||
arguments)},Dc=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm._emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},Ec=a._emscripten_bind_Status___destroy___0=function(){return a.asm._emscripten_bind_Status___destroy___0.apply(null,arguments)},Fc=a._emscripten_bind_Status_code_0=function(){return a.asm._emscripten_bind_Status_code_0.apply(null,arguments)},Gc=a._emscripten_bind_Status_error_msg_0=function(){return a.asm._emscripten_bind_Status_error_msg_0.apply(null,arguments)},
|
arguments)},gb=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm._emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},Ec=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm._emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Fc=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm._emscripten_bind_PointCloud_num_attributes_0.apply(null,arguments)},Gc=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm._emscripten_bind_PointCloud_num_points_0.apply(null,
|
||||||
Hc=a._emscripten_bind_Status_ok_0=function(){return a.asm._emscripten_bind_Status_ok_0.apply(null,arguments)},Ic=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm._emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},Jc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,arguments)},Kc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=
|
arguments)},Hc=a._emscripten_bind_Status___destroy___0=function(){return a.asm._emscripten_bind_Status___destroy___0.apply(null,arguments)},Ic=a._emscripten_bind_Status_code_0=function(){return a.asm._emscripten_bind_Status_code_0.apply(null,arguments)},Jc=a._emscripten_bind_Status_error_msg_0=function(){return a.asm._emscripten_bind_Status_error_msg_0.apply(null,arguments)},Kc=a._emscripten_bind_Status_ok_0=function(){return a.asm._emscripten_bind_Status_ok_0.apply(null,arguments)},Lc=a._emscripten_bind_VoidPtr___destroy___0=
|
||||||
function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},Lc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,arguments)},Mc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,
|
function(){return a.asm._emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},Mc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,arguments)},Nc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},Oc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=
|
||||||
arguments)},Nc=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,arguments)},Oc=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},Pc=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,
|
function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,arguments)},Pc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},Qc=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,
|
||||||
arguments)},Qc=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},Rc=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)},Sc=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},Tc=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=
|
arguments)},Rc=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},Sc=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},Tc=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},Uc=
|
||||||
function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},Uc=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},Vc=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},Wc=a._emscripten_enum_draco_StatusCode_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_ERROR.apply(null,
|
a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)},Vc=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},Wc=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},Xc=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=
|
||||||
arguments)},Xc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm._emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm._emscripten_enum_draco_StatusCode_OK.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,
|
function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},Yc=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_ERROR.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm._emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,
|
||||||
arguments)},ad=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)};a._emscripten_get_global_libc=function(){return a.asm._emscripten_get_global_libc.apply(null,arguments)};var tb=a._emscripten_replace_memory=function(){return a.asm._emscripten_replace_memory.apply(null,arguments)};a._free=function(){return a.asm._free.apply(null,arguments)};a._llvm_bswap_i32=function(){return a.asm._llvm_bswap_i32.apply(null,
|
arguments)},ad=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},bd=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm._emscripten_enum_draco_StatusCode_OK.apply(null,arguments)},cd=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},dd=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,
|
||||||
arguments)};var Oa=a._malloc=function(){return a.asm._malloc.apply(null,arguments)};a._memcpy=function(){return a.asm._memcpy.apply(null,arguments)};a._memmove=function(){return a.asm._memmove.apply(null,arguments)};a._memset=function(){return a.asm._memset.apply(null,arguments)};a._sbrk=function(){return a.asm._sbrk.apply(null,arguments)};a.establishStackSpace=function(){return a.asm.establishStackSpace.apply(null,arguments)};a.getTempRet0=function(){return a.asm.getTempRet0.apply(null,arguments)};
|
arguments)};a._emscripten_get_global_libc=function(){return a.asm._emscripten_get_global_libc.apply(null,arguments)};var tb=a._emscripten_replace_memory=function(){return a.asm._emscripten_replace_memory.apply(null,arguments)};a._free=function(){return a.asm._free.apply(null,arguments)};a._llvm_bswap_i32=function(){return a.asm._llvm_bswap_i32.apply(null,arguments)};var Oa=a._malloc=function(){return a.asm._malloc.apply(null,arguments)};a._memcpy=function(){return a.asm._memcpy.apply(null,arguments)};
|
||||||
a.runPostSets=function(){return a.asm.runPostSets.apply(null,arguments)};a.setTempRet0=function(){return a.asm.setTempRet0.apply(null,arguments)};a.setThrew=function(){return a.asm.setThrew.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_iii=
|
a._memmove=function(){return a.asm._memmove.apply(null,arguments)};a._memset=function(){return a.asm._memset.apply(null,arguments)};a._sbrk=function(){return a.asm._sbrk.apply(null,arguments)};a.establishStackSpace=function(){return a.asm.establishStackSpace.apply(null,arguments)};a.getTempRet0=function(){return a.asm.getTempRet0.apply(null,arguments)};a.runPostSets=function(){return a.asm.runPostSets.apply(null,arguments)};a.setTempRet0=function(){return a.asm.setTempRet0.apply(null,arguments)};
|
||||||
function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};
|
a.setThrew=function(){return a.asm.setThrew.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};
|
||||||
a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};m.stackAlloc=a.stackAlloc;m.stackSave=a.stackSave;m.stackRestore=a.stackRestore;m.establishStackSpace=a.establishStackSpace;m.setTempRet0=a.setTempRet0;m.getTempRet0=a.getTempRet0;a.asm=$a;if(Q)if("function"===typeof a.locateFile?Q=a.locateFile(Q):a.memoryInitializerPrefixURL&&
|
a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,
|
||||||
(Q=a.memoryInitializerPrefixURL+Q),la||ra){var bd=a.readBinary(Q);O.set(bd,m.GLOBAL_BASE)}else{var bb=function(){a.readAsync(Q,ab,function(){throw"could not load memory initializer "+Q;})};v("memory initializer");var ab=function(c){c.byteLength&&(c=new Uint8Array(c));O.set(c,m.GLOBAL_BASE);a.memoryInitializerRequest&&delete a.memoryInitializerRequest.response;Ia("memory initializer")};if(a.memoryInitializerRequest){var cb=function(){var c=a.memoryInitializerRequest,b=c.response;200!==c.status&&0!==
|
arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};m.stackAlloc=a.stackAlloc;m.stackSave=a.stackSave;m.stackRestore=a.stackRestore;m.establishStackSpace=a.establishStackSpace;m.setTempRet0=a.setTempRet0;m.getTempRet0=a.getTempRet0;a.asm=$a;if(Q)if("function"===typeof a.locateFile?Q=a.locateFile(Q):a.memoryInitializerPrefixURL&&(Q=a.memoryInitializerPrefixURL+Q),la||ra){var ed=a.readBinary(Q);O.set(ed,m.GLOBAL_BASE)}else{var bb=function(){a.readAsync(Q,ab,
|
||||||
c.status?(console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+c.status+", retrying "+Q),bb()):ab(b)};a.memoryInitializerRequest.response?setTimeout(cb,0):a.memoryInitializerRequest.addEventListener("load",cb)}else bb()}a.then=function(c){if(a.calledRun)c(a);else{var b=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){b&&b();c(a)}}return a};aa.prototype=Error();aa.prototype.constructor=aa;var Ua=null;oa=function b(){a.calledRun||ya();a.calledRun||(oa=
|
function(){throw"could not load memory initializer "+Q;})};v("memory initializer");var ab=function(c){c.byteLength&&(c=new Uint8Array(c));O.set(c,m.GLOBAL_BASE);a.memoryInitializerRequest&&delete a.memoryInitializerRequest.response;Ia("memory initializer")};if(a.memoryInitializerRequest){var cb=function(){var c=a.memoryInitializerRequest,b=c.response;200!==c.status&&0!==c.status?(console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+c.status+", retrying "+
|
||||||
b)};a.run=ya;a.exit=function(b,d){if(!d||!a.noExitRuntime){if(!a.noExitRuntime&&(ja=!0,P=void 0,u(Za),a.onExit))a.onExit(b);la&&process.exit(b);a.quit(b,new aa(b))}};var Wa=[];a.abort=S;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ya();q.prototype=Object.create(q.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.WrapperObject=q;a.getCache=B;a.wrapPointer=T;a.castObject=function(a,d){return T(a.ptr,d)};a.NULL=
|
Q),bb()):ab(b)};a.memoryInitializerRequest.response?setTimeout(cb,0):a.memoryInitializerRequest.addEventListener("load",cb)}else bb()}a.then=function(c){if(a.calledRun)c(a);else{var b=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){b&&b();c(a)}}return a};aa.prototype=Error();aa.prototype.constructor=aa;var Ua=null;oa=function b(){a.calledRun||ya();a.calledRun||(oa=b)};a.run=ya;a.exit=function(b,d){if(!d||!a.noExitRuntime){if(!a.noExitRuntime&&(ja=!0,P=void 0,u(Za),a.onExit))a.onExit(b);la&&
|
||||||
T(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";a.__destroy__();delete B(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 k={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(k.needed){for(var b=0;b<k.temps.length;b++)a._free(k.temps[b]);k.temps.length=0;a._free(k.buffer);k.buffer=0;k.size+=k.needed;k.needed=0}k.buffer||
|
process.exit(b);a.quit(b,new aa(b))}};var Wa=[];a.abort=S;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ya();r.prototype=Object.create(r.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.WrapperObject=r;a.getCache=B;a.wrapPointer=T;a.castObject=function(a,d){return T(a.ptr,d)};a.NULL=T(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";a.__destroy__();
|
||||||
(k.size+=128,k.buffer=a._malloc(k.size),f(k.buffer));k.pos=0},alloc:function(b,d){f(k.buffer);b=b.length*d.BYTES_PER_ELEMENT;b=b+7&-8;k.pos+b>=k.size?(f(0<b),k.needed+=b,d=a._malloc(b),k.temps.push(d)):(d=k.buffer+k.pos,k.pos+=b);return d},copy:function(a,d,c){switch(d.BYTES_PER_ELEMENT){case 2:c>>=1;break;case 4:c>>=2;break;case 8:c>>=3}for(var b=0;b<a.length;b++)d[c+b]=a[b]}};A.prototype=Object.create(q.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.Status=A;A.prototype.code=
|
delete B(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 k={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(k.needed){for(var b=0;b<k.temps.length;b++)a._free(k.temps[b]);k.temps.length=0;a._free(k.buffer);k.buffer=0;k.size+=k.needed;k.needed=0}k.buffer||(k.size+=128,k.buffer=a._malloc(k.size),f(k.buffer));k.pos=0},alloc:function(b,d){f(k.buffer);b=b.length*d.BYTES_PER_ELEMENT;b=
|
||||||
A.prototype.code=function(){return Fc(this.ptr)};A.prototype.ok=A.prototype.ok=function(){return!!Hc(this.ptr)};A.prototype.error_msg=A.prototype.error_msg=function(){return n(Gc(this.ptr))};A.prototype.__destroy__=A.prototype.__destroy__=function(){Ec(this.ptr)};G.prototype=Object.create(q.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.PointCloud=G;G.prototype.num_attributes=G.prototype.num_attributes=function(){return Cc(this.ptr)};G.prototype.num_points=G.prototype.num_points=
|
b+7&-8;k.pos+b>=k.size?(f(0<b),k.needed+=b,d=a._malloc(b),k.temps.push(d)):(d=k.buffer+k.pos,k.pos+=b);return d},copy:function(a,d,c){switch(d.BYTES_PER_ELEMENT){case 2:c>>=1;break;case 4:c>>=2;break;case 8:c>>=3}for(var b=0;b<a.length;b++)d[c+b]=a[b]}};A.prototype=Object.create(r.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.Status=A;A.prototype.code=A.prototype.code=function(){return Ic(this.ptr)};A.prototype.ok=A.prototype.ok=function(){return!!Kc(this.ptr)};A.prototype.error_msg=
|
||||||
function(){return Dc(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){Bc(this.ptr)};H.prototype=Object.create(q.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.AttributeOctahedronTransform=H;H.prototype.InitFromAttribute=H.prototype.InitFromAttribute=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!vb(b,a)};H.prototype.quantization_bits=H.prototype.quantization_bits=function(){return xb(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=
|
A.prototype.error_msg=function(){return n(Jc(this.ptr))};A.prototype.__destroy__=A.prototype.__destroy__=function(){Hc(this.ptr)};G.prototype=Object.create(r.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.PointCloud=G;G.prototype.num_attributes=G.prototype.num_attributes=function(){return Fc(this.ptr)};G.prototype.num_points=G.prototype.num_points=function(){return Gc(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){Ec(this.ptr)};H.prototype=Object.create(r.prototype);
|
||||||
function(){wb(this.ptr)};p.prototype=Object.create(q.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.PointAttribute=p;p.prototype.size=p.prototype.size=function(){return zc(this.ptr)};p.prototype.GetAttributeTransformData=p.prototype.GetAttributeTransformData=function(){return T(rc(this.ptr),K)};p.prototype.attribute_type=p.prototype.attribute_type=function(){return tc(this.ptr)};p.prototype.data_type=p.prototype.data_type=function(){return wc(this.ptr)};p.prototype.num_components=
|
H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.AttributeOctahedronTransform=H;H.prototype.InitFromAttribute=H.prototype.InitFromAttribute=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!vb(b,a)};H.prototype.quantization_bits=H.prototype.quantization_bits=function(){return xb(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){wb(this.ptr)};p.prototype=Object.create(r.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__=
|
||||||
p.prototype.num_components=function(){return yc(this.ptr)};p.prototype.normalized=p.prototype.normalized=function(){return!!xc(this.ptr)};p.prototype.byte_stride=p.prototype.byte_stride=function(){return vc(this.ptr)};p.prototype.byte_offset=p.prototype.byte_offset=function(){return uc(this.ptr)};p.prototype.unique_id=p.prototype.unique_id=function(){return Ac(this.ptr)};p.prototype.__destroy__=p.prototype.__destroy__=function(){sc(this.ptr)};K.prototype=Object.create(q.prototype);K.prototype.constructor=
|
{};a.PointAttribute=p;p.prototype.size=p.prototype.size=function(){return Cc(this.ptr)};p.prototype.GetAttributeTransformData=p.prototype.GetAttributeTransformData=function(){return T(uc(this.ptr),K)};p.prototype.attribute_type=p.prototype.attribute_type=function(){return wc(this.ptr)};p.prototype.data_type=p.prototype.data_type=function(){return zc(this.ptr)};p.prototype.num_components=p.prototype.num_components=function(){return Bc(this.ptr)};p.prototype.normalized=p.prototype.normalized=function(){return!!Ac(this.ptr)};
|
||||||
K;K.prototype.__class__=K;K.__cache__={};a.AttributeTransformData=K;K.prototype.transform_type=K.prototype.transform_type=function(){return Eb(this.ptr)};K.prototype.__destroy__=K.prototype.__destroy__=function(){Db(this.ptr)};y.prototype=Object.create(q.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.AttributeQuantizationTransform=y;y.prototype.InitFromAttribute=y.prototype.InitFromAttribute=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!yb(b,a)};
|
p.prototype.byte_stride=p.prototype.byte_stride=function(){return yc(this.ptr)};p.prototype.byte_offset=p.prototype.byte_offset=function(){return xc(this.ptr)};p.prototype.unique_id=p.prototype.unique_id=function(){return Dc(this.ptr)};p.prototype.__destroy__=p.prototype.__destroy__=function(){vc(this.ptr)};K.prototype=Object.create(r.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.AttributeTransformData=K;K.prototype.transform_type=K.prototype.transform_type=function(){return Eb(this.ptr)};
|
||||||
y.prototype.quantization_bits=y.prototype.quantization_bits=function(){return Bb(this.ptr)};y.prototype.min_value=y.prototype.min_value=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Ab(b,a)};y.prototype.range=y.prototype.range=function(){return Cb(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){zb(this.ptr)};r.prototype=Object.create(q.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.MetadataQuerier=r;r.prototype.HasIntEntry=
|
K.prototype.__destroy__=K.prototype.__destroy__=function(){Db(this.ptr)};y.prototype=Object.create(r.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.AttributeQuantizationTransform=y;y.prototype.InitFromAttribute=y.prototype.InitFromAttribute=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!yb(b,a)};y.prototype.quantization_bits=y.prototype.quantization_bits=function(){return Bb(this.ptr)};y.prototype.min_value=y.prototype.min_value=function(a){var b=
|
||||||
r.prototype.HasIntEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return!!nc(b,a,d)};r.prototype.GetIntEntry=r.prototype.GetIntEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return kc(b,a,d)};r.prototype.HasDoubleEntry=r.prototype.HasDoubleEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return!!mc(b,
|
this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Ab(b,a)};y.prototype.range=y.prototype.range=function(){return Cb(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){zb(this.ptr)};q.prototype=Object.create(r.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.MetadataQuerier=q;q.prototype.HasEntry=q.prototype.HasEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!oc(b,a,d)};q.prototype.HasIntEntry=
|
||||||
a,d)};r.prototype.GetDoubleEntry=r.prototype.GetDoubleEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return jc(b,a,d)};r.prototype.HasStringEntry=r.prototype.HasStringEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return!!oc(b,a,d)};r.prototype.GetStringEntry=r.prototype.GetStringEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);
|
q.prototype.HasIntEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!pc(b,a,d)};q.prototype.GetIntEntry=q.prototype.GetIntEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return lc(b,a,d)};q.prototype.HasDoubleEntry=q.prototype.HasDoubleEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!nc(b,
|
||||||
d=d&&"object"===typeof d?d.ptr:X(d);return n(lc(b,a,d))};r.prototype.__destroy__=r.prototype.__destroy__=function(){pc(this.ptr)};I.prototype=Object.create(q.prototype);I.prototype.constructor=I;I.prototype.__class__=I;I.__cache__={};a.DracoFloat32Array=I;I.prototype.GetValue=I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Zb(b,a)};I.prototype.size=I.prototype.size=function(){return ac(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){$b(this.ptr)};
|
a,d)};q.prototype.GetDoubleEntry=q.prototype.GetDoubleEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return jc(b,a,d)};q.prototype.HasStringEntry=q.prototype.HasStringEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!qc(b,a,d)};q.prototype.GetStringEntry=q.prototype.GetStringEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);
|
||||||
U.prototype=Object.create(q.prototype);U.prototype.constructor=U;U.prototype.__class__=U;U.__cache__={};a.GeometryAttribute=U;U.prototype.__destroy__=U.prototype.__destroy__=function(){ec(this.ptr)};M.prototype=Object.create(q.prototype);M.prototype.constructor=M;M.prototype.__class__=M;M.__cache__={};a.DecoderBuffer=M;M.prototype.Init=M.prototype.Init=function(a,d){var b=this.ptr;k.prepare();if("object"==typeof a&&"object"===typeof a){var c=k.alloc(a,ba);k.copy(a,ba,c);a=c}d&&"object"===typeof d&&
|
d=d&&"object"===typeof d?d.ptr:U(d);return n(mc(b,a,d))};q.prototype.NumEntries=q.prototype.NumEntries=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return rc(b,a)};q.prototype.GetEntryName=q.prototype.GetEntryName=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return n(kc(b,a,d))};q.prototype.__destroy__=q.prototype.__destroy__=function(){sc(this.ptr)};I.prototype=Object.create(r.prototype);I.prototype.constructor=I;I.prototype.__class__=
|
||||||
(d=d.ptr);Fb(b,a,d)};M.prototype.__destroy__=M.prototype.__destroy__=function(){Gb(this.ptr)};h.prototype=Object.create(q.prototype);h.prototype.constructor=h;h.prototype.__class__=h;h.__cache__={};a.Decoder=h;h.prototype.GetEncodedGeometryType=h.prototype.GetEncodedGeometryType=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(b,a)};h.prototype.DecodeBufferToPointCloud=h.prototype.DecodeBufferToPointCloud=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===
|
I;I.__cache__={};a.DracoFloat32Array=I;I.prototype.GetValue=I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Zb(b,a)};I.prototype.size=I.prototype.size=function(){return ac(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){$b(this.ptr)};V.prototype=Object.create(r.prototype);V.prototype.constructor=V;V.prototype.__class__=V;V.__cache__={};a.GeometryAttribute=V;V.prototype.__destroy__=V.prototype.__destroy__=function(){ec(this.ptr)};M.prototype=
|
||||||
typeof d&&(d=d.ptr);return T(Ib(b,a,d),A)};h.prototype.DecodeBufferToMesh=h.prototype.DecodeBufferToMesh=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Hb(b,a,d),A)};h.prototype.GetAttributeId=h.prototype.GetAttributeId=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return Ob(b,a,d)};h.prototype.GetAttributeIdByName=h.prototype.GetAttributeIdByName=function(a,d){var b=this.ptr;k.prepare();
|
Object.create(r.prototype);M.prototype.constructor=M;M.prototype.__class__=M;M.__cache__={};a.DecoderBuffer=M;M.prototype.Init=M.prototype.Init=function(a,d){var b=this.ptr;k.prepare();if("object"==typeof a&&"object"===typeof a){var c=k.alloc(a,ba);k.copy(a,ba,c);a=c}d&&"object"===typeof d&&(d=d.ptr);Fb(b,a,d)};M.prototype.__destroy__=M.prototype.__destroy__=function(){Gb(this.ptr)};h.prototype=Object.create(r.prototype);h.prototype.constructor=h;h.prototype.__class__=h;h.__cache__={};a.Decoder=h;
|
||||||
a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return Nb(b,a,d)};h.prototype.GetAttributeIdByMetadataEntry=h.prototype.GetAttributeIdByMetadataEntry=function(a,d,c){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);c=c&&"object"===typeof c?c.ptr:X(c);return Mb(b,a,d,c)};h.prototype.GetAttribute=h.prototype.GetAttribute=function(a,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);return T(Sb(b,
|
h.prototype.GetEncodedGeometryType=h.prototype.GetEncodedGeometryType=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(b,a)};h.prototype.DecodeBufferToPointCloud=h.prototype.DecodeBufferToPointCloud=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Ib(b,a,d),A)};h.prototype.DecodeBufferToMesh=h.prototype.DecodeBufferToMesh=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Hb(b,
|
||||||
a,c),p)};h.prototype.GetAttributeByUniqueId=h.prototype.GetAttributeByUniqueId=function(a,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);return T(Jb(b,a,c),p)};h.prototype.GetMetadata=h.prototype.GetMetadata=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return T(Vb(b,a),N)};h.prototype.GetAttributeMetadata=h.prototype.GetAttributeMetadata=function(a,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);return T(Rb(b,
|
a,d),A)};h.prototype.GetAttributeId=h.prototype.GetAttributeId=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return Ob(b,a,d)};h.prototype.GetAttributeIdByName=h.prototype.GetAttributeIdByName=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return Nb(b,a,d)};h.prototype.GetAttributeIdByMetadataEntry=h.prototype.GetAttributeIdByMetadataEntry=function(a,d,c){var b=this.ptr;k.prepare();a&&
|
||||||
a,c),N)};h.prototype.GetFaceFromMesh=h.prototype.GetFaceFromMesh=function(a,c,f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Ub(b,a,c,f)};h.prototype.GetTriangleStripsFromMesh=h.prototype.GetTriangleStripsFromMesh=function(a,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);return Wb(b,a,c)};h.prototype.GetAttributeFloat=h.prototype.GetAttributeFloat=function(a,c,f){var b=this.ptr;
|
"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);c=c&&"object"===typeof c?c.ptr:U(c);return Mb(b,a,d,c)};h.prototype.GetAttribute=h.prototype.GetAttribute=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Sb(b,a,d),p)};h.prototype.GetAttributeByUniqueId=h.prototype.GetAttributeByUniqueId=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Jb(b,a,d),p)};h.prototype.GetMetadata=
|
||||||
a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Lb(b,a,c,f)};h.prototype.GetAttributeFloatForAllPoints=h.prototype.GetAttributeFloatForAllPoints=function(a,c,f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Kb(b,a,c,f)};h.prototype.GetAttributeIntForAllPoints=h.prototype.GetAttributeIntForAllPoints=function(a,c,f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);
|
h.prototype.GetMetadata=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return T(Vb(b,a),N)};h.prototype.GetAttributeMetadata=h.prototype.GetAttributeMetadata=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Rb(b,a,d),N)};h.prototype.GetFaceFromMesh=h.prototype.GetFaceFromMesh=function(a,d,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);c&&"object"===typeof c&&(c=c.ptr);return!!Ub(b,a,d,c)};
|
||||||
c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Qb(b,a,c,f)};h.prototype.GetAttributeInt32ForAllPoints=h.prototype.GetAttributeInt32ForAllPoints=function(a,c,f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Pb(b,a,c,f)};h.prototype.SkipAttributeTransform=h.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Xb(b,a)};h.prototype.__destroy__=h.prototype.__destroy__=
|
h.prototype.GetTriangleStripsFromMesh=h.prototype.GetTriangleStripsFromMesh=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return Wb(b,a,d)};h.prototype.GetAttributeFloat=h.prototype.GetAttributeFloat=function(a,d,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);c&&"object"===typeof c&&(c=c.ptr);return!!Lb(b,a,d,c)};h.prototype.GetAttributeFloatForAllPoints=h.prototype.GetAttributeFloatForAllPoints=function(a,c,
|
||||||
function(){Yb(this.ptr)};C.prototype=Object.create(q.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.Mesh=C;C.prototype.num_faces=C.prototype.num_faces=function(){return hc(this.ptr)};C.prototype.num_attributes=C.prototype.num_attributes=function(){return gc(this.ptr)};C.prototype.num_points=C.prototype.num_points=function(){return ic(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){fc(this.ptr)};Y.prototype=Object.create(q.prototype);Y.prototype.constructor=
|
f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Kb(b,a,c,f)};h.prototype.GetAttributeIntForAllPoints=h.prototype.GetAttributeIntForAllPoints=function(a,c,f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Qb(b,a,c,f)};h.prototype.GetAttributeInt32ForAllPoints=h.prototype.GetAttributeInt32ForAllPoints=function(a,c,f){var b=this.ptr;a&&"object"===
|
||||||
Y;Y.prototype.__class__=Y;Y.__cache__={};a.VoidPtr=Y;Y.prototype.__destroy__=Y.prototype.__destroy__=function(){Ic(this.ptr)};J.prototype=Object.create(q.prototype);J.prototype.constructor=J;J.prototype.__class__=J;J.__cache__={};a.DracoInt32Array=J;J.prototype.GetValue=J.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return bc(b,a)};J.prototype.size=J.prototype.size=function(){return dc(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){cc(this.ptr)};
|
typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Pb(b,a,c,f)};h.prototype.SkipAttributeTransform=h.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Xb(b,a)};h.prototype.__destroy__=h.prototype.__destroy__=function(){Yb(this.ptr)};C.prototype=Object.create(r.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.Mesh=C;C.prototype.num_faces=C.prototype.num_faces=function(){return hc(this.ptr)};
|
||||||
N.prototype=Object.create(q.prototype);N.prototype.constructor=N;N.prototype.__class__=N;N.__cache__={};a.Metadata=N;N.prototype.__destroy__=N.prototype.__destroy__=function(){qc(this.ptr)};(function(){function b(){a.OK=Zc();a.ERROR=Wc();a.IO_ERROR=Yc();a.INVALID_PARAMETER=Xc();a.UNSUPPORTED_VERSION=ad();a.UNKNOWN_VERSION=$c();a.INVALID_GEOMETRY_TYPE=Nc();a.POINT_CLOUD=Oc();a.TRIANGULAR_MESH=Pc();a.ATTRIBUTE_INVALID_TRANSFORM=Jc();a.ATTRIBUTE_NO_TRANSFORM=Kc();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=Mc();
|
C.prototype.num_attributes=C.prototype.num_attributes=function(){return gc(this.ptr)};C.prototype.num_points=C.prototype.num_points=function(){return ic(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){fc(this.ptr)};Y.prototype=Object.create(r.prototype);Y.prototype.constructor=Y;Y.prototype.__class__=Y;Y.__cache__={};a.VoidPtr=Y;Y.prototype.__destroy__=Y.prototype.__destroy__=function(){Lc(this.ptr)};J.prototype=Object.create(r.prototype);J.prototype.constructor=J;J.prototype.__class__=
|
||||||
a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Lc();a.INVALID=Sc();a.POSITION=Uc();a.NORMAL=Tc();a.COLOR=Qc();a.TEX_COORD=Vc();a.GENERIC=Rc()}a.calledRun?b():Sa.unshift(b)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return c};"object"===typeof module&&module.exports&&(module.exports=DracoDecoderModule);
|
J;J.__cache__={};a.DracoInt32Array=J;J.prototype.GetValue=J.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return bc(b,a)};J.prototype.size=J.prototype.size=function(){return dc(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){cc(this.ptr)};N.prototype=Object.create(r.prototype);N.prototype.constructor=N;N.prototype.__class__=N;N.__cache__={};a.Metadata=N;N.prototype.__destroy__=N.prototype.__destroy__=function(){tc(this.ptr)};(function(){function b(){a.OK=
|
||||||
|
bd();a.ERROR=Zc();a.IO_ERROR=ad();a.INVALID_PARAMETER=$c();a.UNSUPPORTED_VERSION=dd();a.UNKNOWN_VERSION=cd();a.INVALID_GEOMETRY_TYPE=Qc();a.POINT_CLOUD=Rc();a.TRIANGULAR_MESH=Sc();a.ATTRIBUTE_INVALID_TRANSFORM=Mc();a.ATTRIBUTE_NO_TRANSFORM=Nc();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=Pc();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Oc();a.INVALID=Vc();a.POSITION=Xc();a.NORMAL=Wc();a.COLOR=Tc();a.TEX_COORD=Yc();a.GENERIC=Uc()}a.calledRun?b():Sa.unshift(b)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();
|
||||||
|
return c};"object"===typeof module&&module.exports&&(module.exports=DracoDecoderModule);
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,f,n){b!=Array.prototype&&b!=Object.prototype&&(b[f]=n.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};$jscomp.global=$jscomp.getGlobal(this);
|
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,f,n){c!=Array.prototype&&c!=Object.prototype&&(c[f]=n.value)};$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);
|
||||||
$jscomp.polyfill=function(b,f,n,D){if(f){n=$jscomp.global;b=b.split(".");for(D=0;D<b.length-1;D++){var g=b[D];g in n||(n[g]={});n=n[g]}b=b[b.length-1];D=n[b];f=f(D);f!=D&&null!=f&&$jscomp.defineProperty(n,b,{configurable:!0,writable:!0,value:f})}};$jscomp.polyfill("Math.imul",function(b){return b?b:function(f,b){f=Number(f);b=Number(b);var n=f&65535,g=b&65535;return n*g+((f>>>16&65535)*g+n*(b>>>16&65535)<<16>>>0)|0}},"es6","es3");
|
$jscomp.polyfill=function(c,f,n,D){if(f){n=$jscomp.global;c=c.split(".");for(D=0;D<c.length-1;D++){var g=c[D];g in n||(n[g]={});n=n[g]}c=c[c.length-1];D=n[c];f=f(D);f!=D&&null!=f&&$jscomp.defineProperty(n,c,{configurable:!0,writable:!0,value:f})}};$jscomp.polyfill("Math.imul",function(c){return c?c:function(f,c){f=Number(f);c=Number(c);var n=f&65535,g=c&65535;return n*g+((f>>>16&65535)*g+n*(c>>>16&65535)<<16>>>0)|0}},"es6","es3");
|
||||||
$jscomp.polyfill("Math.clz32",function(b){return b?b:function(f){f=Number(f)>>>0;if(0===f)return 32;var b=0;0===(f&4294901760)&&(f<<=16,b+=16);0===(f&4278190080)&&(f<<=8,b+=8);0===(f&4026531840)&&(f<<=4,b+=4);0===(f&3221225472)&&(f<<=2,b+=2);0===(f&2147483648)&&b++;return b}},"es6","es3");$jscomp.polyfill("Math.trunc",function(b){return b?b:function(b){b=Number(b);if(isNaN(b)||Infinity===b||-Infinity===b||0===b)return b;var f=Math.floor(Math.abs(b));return 0>b?-f:f}},"es6","es3");
|
$jscomp.polyfill("Math.clz32",function(c){return c?c:function(f){f=Number(f)>>>0;if(0===f)return 32;var c=0;0===(f&4294901760)&&(f<<=16,c+=16);0===(f&4278190080)&&(f<<=8,c+=8);0===(f&4026531840)&&(f<<=4,c+=4);0===(f&3221225472)&&(f<<=2,c+=2);0===(f&2147483648)&&c++;return c}},"es6","es3");$jscomp.polyfill("Math.trunc",function(c){return c?c:function(c){c=Number(c);if(isNaN(c)||Infinity===c||-Infinity===c||0===c)return c;var f=Math.floor(Math.abs(c));return 0>c?-f:f}},"es6","es3");
|
||||||
$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+$jscomp.symbolCounter_++};
|
$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(c){return $jscomp.SYMBOL_PREFIX+(c||"")+$jscomp.symbolCounter_++};
|
||||||
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var b=$jscomp.global.Symbol.iterator;b||(b=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[b]&&$jscomp.defineProperty(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(b){var f=0;return $jscomp.iteratorPrototype(function(){return f<b.length?{done:!1,value:b[f++]}:{done:!0}})};
|
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.iterator;c||(c=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[c]&&$jscomp.defineProperty(Array.prototype,c,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(c){var f=0;return $jscomp.iteratorPrototype(function(){return f<c.length?{done:!1,value:c[f++]}:{done:!0}})};
|
||||||
$jscomp.iteratorPrototype=function(b){$jscomp.initSymbolIterator();b={next:b};b[$jscomp.global.Symbol.iterator]=function(){return this};return b};$jscomp.makeIterator=function(b){$jscomp.initSymbolIterator();var f=b[Symbol.iterator];return f?f.call(b):$jscomp.arrayIterator(b)};$jscomp.FORCE_POLYFILL_PROMISE=!1;
|
$jscomp.iteratorPrototype=function(c){$jscomp.initSymbolIterator();c={next:c};c[$jscomp.global.Symbol.iterator]=function(){return this};return c};$jscomp.makeIterator=function(c){$jscomp.initSymbolIterator();var f=c[Symbol.iterator];return f?f.call(c):$jscomp.arrayIterator(c)};$jscomp.FORCE_POLYFILL_PROMISE=!1;
|
||||||
$jscomp.polyfill("Promise",function(b){function f(){this.batch_=null}function n(b){return b instanceof g?b:new g(function(f,R){f(b)})}if(b&&!$jscomp.FORCE_POLYFILL_PROMISE)return b;f.prototype.asyncExecute=function(b){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(b);return this};f.prototype.asyncExecuteBatch_=function(){var b=this;this.asyncExecuteFunction(function(){b.executeBatch_()})};var D=$jscomp.global.setTimeout;f.prototype.asyncExecuteFunction=function(b){D(b,
|
$jscomp.polyfill("Promise",function(c){function f(){this.batch_=null}function n(c){return c instanceof g?c:new g(function(f,R){f(c)})}if(c&&!$jscomp.FORCE_POLYFILL_PROMISE)return c;f.prototype.asyncExecute=function(c){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(c);return this};f.prototype.asyncExecuteBatch_=function(){var c=this;this.asyncExecuteFunction(function(){c.executeBatch_()})};var D=$jscomp.global.setTimeout;f.prototype.asyncExecuteFunction=function(c){D(c,
|
||||||
0)};f.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var b=this.batch_;this.batch_=[];for(var f=0;f<b.length;++f){var g=b[f];delete b[f];try{g()}catch(v){this.asyncThrow_(v)}}}this.batch_=null};f.prototype.asyncThrow_=function(b){this.asyncExecuteFunction(function(){throw b;})};var g=function(b){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var f=this.createResolveAndReject_();try{b(f.resolve,f.reject)}catch(u){f.reject(u)}};g.prototype.createResolveAndReject_=
|
0)};f.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var c=this.batch_;this.batch_=[];for(var f=0;f<c.length;++f){var g=c[f];delete c[f];try{g()}catch(v){this.asyncThrow_(v)}}}this.batch_=null};f.prototype.asyncThrow_=function(c){this.asyncExecuteFunction(function(){throw c;})};var g=function(c){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var f=this.createResolveAndReject_();try{c(f.resolve,f.reject)}catch(u){f.reject(u)}};g.prototype.createResolveAndReject_=
|
||||||
function(){function b(b){return function(R){g||(g=!0,b.call(f,R))}}var f=this,g=!1;return{resolve:b(this.resolveTo_),reject:b(this.reject_)}};g.prototype.resolveTo_=function(b){if(b===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(b instanceof g)this.settleSameAsPromise_(b);else{a:switch(typeof b){case "object":var f=null!=b;break a;case "function":f=!0;break a;default:f=!1}f?this.resolveToNonPromiseObj_(b):this.fulfill_(b)}};g.prototype.resolveToNonPromiseObj_=function(b){var f=
|
function(){function c(c){return function(R){g||(g=!0,c.call(f,R))}}var f=this,g=!1;return{resolve:c(this.resolveTo_),reject:c(this.reject_)}};g.prototype.resolveTo_=function(c){if(c===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(c instanceof g)this.settleSameAsPromise_(c);else{a:switch(typeof c){case "object":var f=null!=c;break a;case "function":f=!0;break a;default:f=!1}f?this.resolveToNonPromiseObj_(c):this.fulfill_(c)}};g.prototype.resolveToNonPromiseObj_=function(c){var f=
|
||||||
void 0;try{f=b.then}catch(u){this.reject_(u);return}"function"==typeof f?this.settleSameAsThenable_(f,b):this.fulfill_(b)};g.prototype.reject_=function(b){this.settle_(2,b)};g.prototype.fulfill_=function(b){this.settle_(1,b)};g.prototype.settle_=function(b,f){if(0!=this.state_)throw Error("Cannot settle("+b+", "+f|"): Promise already settled in state"+this.state_);this.state_=b;this.result_=f;this.executeOnSettledCallbacks_()};g.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var b=
|
void 0;try{f=c.then}catch(u){this.reject_(u);return}"function"==typeof f?this.settleSameAsThenable_(f,c):this.fulfill_(c)};g.prototype.reject_=function(c){this.settle_(2,c)};g.prototype.fulfill_=function(c){this.settle_(1,c)};g.prototype.settle_=function(c,f){if(0!=this.state_)throw Error("Cannot settle("+c+", "+f|"): Promise already settled in state"+this.state_);this.state_=c;this.result_=f;this.executeOnSettledCallbacks_()};g.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var c=
|
||||||
this.onSettledCallbacks_,f=0;f<b.length;++f)b[f].call(),b[f]=null;this.onSettledCallbacks_=null}};var ha=new f;g.prototype.settleSameAsPromise_=function(b){var f=this.createResolveAndReject_();b.callWhenSettled_(f.resolve,f.reject)};g.prototype.settleSameAsThenable_=function(b,f){var g=this.createResolveAndReject_();try{b.call(f,g.resolve,g.reject)}catch(v){g.reject(v)}};g.prototype.then=function(b,f){function n(b,f){return"function"==typeof b?function(f){try{v(b(f))}catch(aa){R(aa)}}:f}var v,R,D=
|
this.onSettledCallbacks_,f=0;f<c.length;++f)c[f].call(),c[f]=null;this.onSettledCallbacks_=null}};var ha=new f;g.prototype.settleSameAsPromise_=function(c){var f=this.createResolveAndReject_();c.callWhenSettled_(f.resolve,f.reject)};g.prototype.settleSameAsThenable_=function(c,f){var g=this.createResolveAndReject_();try{c.call(f,g.resolve,g.reject)}catch(v){g.reject(v)}};g.prototype.then=function(c,f){function n(c,f){return"function"==typeof c?function(f){try{v(c(f))}catch(aa){R(aa)}}:f}var v,R,D=
|
||||||
new g(function(b,f){v=b;R=f});this.callWhenSettled_(n(b,v),n(f,R));return D};g.prototype.catch=function(b){return this.then(void 0,b)};g.prototype.callWhenSettled_=function(b,f){function g(){switch(n.state_){case 1:b(n.result_);break;case 2:f(n.result_);break;default:throw Error("Unexpected state: "+n.state_);}}var n=this;null==this.onSettledCallbacks_?ha.asyncExecute(g):this.onSettledCallbacks_.push(function(){ha.asyncExecute(g)})};g.resolve=n;g.reject=function(b){return new g(function(f,g){g(b)})};
|
new g(function(c,f){v=c;R=f});this.callWhenSettled_(n(c,v),n(f,R));return D};g.prototype.catch=function(c){return this.then(void 0,c)};g.prototype.callWhenSettled_=function(c,f){function g(){switch(n.state_){case 1:c(n.result_);break;case 2:f(n.result_);break;default:throw Error("Unexpected state: "+n.state_);}}var n=this;null==this.onSettledCallbacks_?ha.asyncExecute(g):this.onSettledCallbacks_.push(function(){ha.asyncExecute(g)})};g.resolve=n;g.reject=function(c){return new g(function(f,g){g(c)})};
|
||||||
g.race=function(b){return new g(function(f,g){for(var v=$jscomp.makeIterator(b),u=v.next();!u.done;u=v.next())n(u.value).callWhenSettled_(f,g)})};g.all=function(b){var f=$jscomp.makeIterator(b),u=f.next();return u.done?n([]):new g(function(b,g){function D(f){return function(g){v[f]=g;L--;0==L&&b(v)}}var v=[],L=0;do v.push(void 0),L++,n(u.value).callWhenSettled_(D(v.length-1),g),u=f.next();while(!u.done)})};return g},"es6","es3");
|
g.race=function(c){return new g(function(f,g){for(var v=$jscomp.makeIterator(c),u=v.next();!u.done;u=v.next())n(u.value).callWhenSettled_(f,g)})};g.all=function(c){var f=$jscomp.makeIterator(c),u=f.next();return u.done?n([]):new g(function(c,g){function D(f){return function(g){v[f]=g;L--;0==L&&c(v)}}var v=[],L=0;do v.push(void 0),L++,n(u.value).callWhenSettled_(D(v.length-1),g),u=f.next();while(!u.done)})};return g},"es6","es3");
|
||||||
var DracoDecoderModule=function(b){function f(a,c){a||S("Assertion failed: "+c)}function n(e,c){if(0===c||!e)return"";for(var d=0,l,b=0;;){l=O[e+b>>0];d|=l;if(0==l&&!c)break;b++;if(c&&b==c)break}c||(c=b);l="";if(128>d){for(;0<c;)d=String.fromCharCode.apply(String,O.subarray(e,e+Math.min(c,1024))),l=l?l+d:d,e+=1024,c-=1024;return l}return a.UTF8ToString(e)}function D(a){return a.replace(/__Z[\w\d_]+/g,function(a){return a===a?a:a+" ["+a+"]"})}function g(){a:{var e=Error();if(!e.stack){try{throw Error(0);
|
var DracoDecoderModule=function(c){function f(a,b){a||S("Assertion failed: "+b)}function n(e,b){if(0===b||!e)return"";for(var d=0,l,c=0;;){l=O[e+c>>0];d|=l;if(0==l&&!b)break;c++;if(b&&c==b)break}b||(b=c);l="";if(128>d){for(;0<b;)d=String.fromCharCode.apply(String,O.subarray(e,e+Math.min(b,1024))),l=l?l+d:d,e+=1024,b-=1024;return l}return a.UTF8ToString(e)}function D(a){return a.replace(/__Z[\w\d_]+/g,function(a){return a===a?a:a+" ["+a+"]"})}function g(){a:{var e=Error();if(!e.stack){try{throw Error(0);
|
||||||
}catch(c){e=c}if(!e.stack){e="(no stack trace available)";break a}}e=e.stack.toString()}a.extraStackTrace&&(e+="\n"+a.extraStackTrace());return D(e)}function ha(a,c){0<a%c&&(a+=c-a%c);return a}function R(){a.HEAP8=ba=new Int8Array(E);a.HEAP16=ua=new Int16Array(E);a.HEAP32=w=new Int32Array(E);a.HEAPU8=O=new Uint8Array(E);a.HEAPU16=Ja=new Uint16Array(E);a.HEAPU32=Ka=new Uint32Array(E);a.HEAPF32=La=new Float32Array(E);a.HEAPF64=Ma=new Float64Array(E)}function Ha(){var e=a.usingWasm?va:Na,c=2147483648-
|
}catch(b){e=b}if(!e.stack){e="(no stack trace available)";break a}}e=e.stack.toString()}a.extraStackTrace&&(e+="\n"+a.extraStackTrace());return D(e)}function ha(a,b){0<a%b&&(a+=b-a%b);return a}function R(){a.HEAP8=ba=new Int8Array(E);a.HEAP16=ua=new Int16Array(E);a.HEAP32=w=new Int32Array(E);a.HEAPU8=O=new Uint8Array(E);a.HEAPU16=Ja=new Uint16Array(E);a.HEAPU32=Ka=new Uint32Array(E);a.HEAPF32=La=new Float32Array(E);a.HEAPF64=Ma=new Float64Array(E)}function Ha(){var e=a.usingWasm?va:Na,b=2147483648-
|
||||||
e;if(w[W>>2]>c)return!1;var d=x;for(x=Math.max(x,db);x<w[W>>2];)x=536870912>=x?ha(2*x,e):Math.min(ha((3*x+2147483648)/4,e),c);e=a.reallocBuffer(x);if(!e||e.byteLength!=x)return x=d,!1;a.buffer=E=e;R();return!0}function u(e){for(;0<e.length;){var c=e.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 v(e){ca++;a.monitorRunDependencies&&a.monitorRunDependencies(ca)}function Ia(e){ca--;
|
e;if(w[X>>2]>b)return!1;var d=x;for(x=Math.max(x,db);x<w[X>>2];)x=536870912>=x?ha(2*x,e):Math.min(ha((3*x+2147483648)/4,e),b);e=a.reallocBuffer(x);if(!e||e.byteLength!=x)return x=d,!1;a.buffer=E=e;R();return!0}function u(e){for(;0<e.length;){var b=e.shift();if("function"==typeof b)b();else{var d=b.func;"number"===typeof d?void 0===b.arg?a.dynCall_v(d):a.dynCall_vi(d,b.arg):d(void 0===b.arg?null:b.arg)}}}function v(e){ca++;a.monitorRunDependencies&&a.monitorRunDependencies(ca)}function Ia(e){ca--;
|
||||||
a.monitorRunDependencies&&a.monitorRunDependencies(ca);0==ca&&(null!==wa&&(clearInterval(wa),wa=null),oa&&(e=oa,oa=null,e()))}function ia(){return!!ia.uncaught_exception}function ma(){var e=z.last;if(!e)return(m.setTempRet0(0),0)|0;var c=z.infos[e],d=c.type;if(!d)return(m.setTempRet0(0),e)|0;var l=Array.prototype.slice.call(arguments);a.___cxa_is_pointer_type(d);ma.buffer||(ma.buffer=Oa(4));w[ma.buffer>>2]=e;e=ma.buffer;for(var b=0;b<l.length;b++)if(l[b]&&a.___cxa_can_catch(l[b],d,e))return e=w[e>>
|
a.monitorRunDependencies&&a.monitorRunDependencies(ca);0==ca&&(null!==wa&&(clearInterval(wa),wa=null),oa&&(e=oa,oa=null,e()))}function ia(){return!!ia.uncaught_exception}function ma(){var e=z.last;if(!e)return(m.setTempRet0(0),0)|0;var b=z.infos[e],d=b.type;if(!d)return(m.setTempRet0(0),e)|0;var l=Array.prototype.slice.call(arguments);a.___cxa_is_pointer_type(d);ma.buffer||(ma.buffer=Oa(4));w[ma.buffer>>2]=e;e=ma.buffer;for(var c=0;c<l.length;c++)if(l[c]&&a.___cxa_can_catch(l[c],d,e))return e=w[e>>
|
||||||
2],c.adjusted=e,(m.setTempRet0(l[b]),e)|0;e=w[e>>2];return(m.setTempRet0(d),e)|0}function L(e,c){t.varargs=c;try{var d=t.get(),l=t.get(),b=t.get();e=0;L.buffer||(L.buffers=[null,[],[]],L.printChar=function(c,e){var d=L.buffers[c];f(d);if(0===e||10===e){c=1===c?a.print:a.printErr;a:{for(var l=e=0;d[l];)++l;if(16<l-e&&d.subarray&&Pa)e=Pa.decode(d.subarray(e,l));else for(l="";;){var b=d[e++];if(!b){e=l;break a}if(b&128){var g=d[e++]&63;if(192==(b&224))l+=String.fromCharCode((b&31)<<6|g);else{var h=d[e++]&
|
2],b.adjusted=e,(m.setTempRet0(l[c]),e)|0;e=w[e>>2];return(m.setTempRet0(d),e)|0}function L(e,b){t.varargs=b;try{var d=t.get(),l=t.get(),c=t.get();e=0;L.buffer||(L.buffers=[null,[],[]],L.printChar=function(b,e){var d=L.buffers[b];f(d);if(0===e||10===e){b=1===b?a.print:a.printErr;a:{for(var l=e=0;d[l];)++l;if(16<l-e&&d.subarray&&Pa)e=Pa.decode(d.subarray(e,l));else for(l="";;){var c=d[e++];if(!c){e=l;break a}if(c&128){var g=d[e++]&63;if(192==(c&224))l+=String.fromCharCode((c&31)<<6|g);else{var h=d[e++]&
|
||||||
63;if(224==(b&240))b=(b&15)<<12|g<<6|h;else{var F=d[e++]&63;if(240==(b&248))b=(b&7)<<18|g<<12|h<<6|F;else{var k=d[e++]&63;if(248==(b&252))b=(b&3)<<24|g<<18|h<<12|F<<6|k;else{var pa=d[e++]&63;b=(b&1)<<30|g<<24|h<<18|F<<12|k<<6|pa}}}65536>b?l+=String.fromCharCode(b):(b-=65536,l+=String.fromCharCode(55296|b>>10,56320|b&1023))}}else l+=String.fromCharCode(b)}}c(e);d.length=0}else d.push(e)});for(c=0;c<b;c++){for(var g=w[l+8*c>>2],h=w[l+(8*c+4)>>2],k=0;k<h;k++)L.printChar(d,O[g+k]);e+=h}return e}catch(xa){return"undefined"!==
|
63;if(224==(c&240))c=(c&15)<<12|g<<6|h;else{var F=d[e++]&63;if(240==(c&248))c=(c&7)<<18|g<<12|h<<6|F;else{var k=d[e++]&63;if(248==(c&252))c=(c&3)<<24|g<<18|h<<12|F<<6|k;else{var pa=d[e++]&63;c=(c&1)<<30|g<<24|h<<18|F<<12|k<<6|pa}}}65536>c?l+=String.fromCharCode(c):(c-=65536,l+=String.fromCharCode(55296|c>>10,56320|c&1023))}}else l+=String.fromCharCode(c)}}b(e);d.length=0}else d.push(e)});for(b=0;b<c;b++){for(var g=w[l+8*b>>2],h=w[l+(8*b+4)>>2],k=0;k<h;k++)L.printChar(d,O[g+k]);e+=h}return e}catch(xa){return"undefined"!==
|
||||||
typeof FS&&xa instanceof FS.ErrnoError||S(xa),-xa.errno}}function na(e,c){na.seen||(na.seen={});e in na.seen||(a.dynCall_v(c),na.seen[e]=1)}function aa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function ya(e){function c(){if(!a.calledRun&&(a.calledRun=!0,!ja)){Qa||(Qa=!0,u(Ra));u(Sa);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ta.unshift(a.postRun.shift());
|
typeof FS&&xa instanceof FS.ErrnoError||S(xa),-xa.errno}}function na(e,b){na.seen||(na.seen={});e in na.seen||(a.dynCall_v(b),na.seen[e]=1)}function aa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function ya(e){function b(){if(!a.calledRun&&(a.calledRun=!0,!ja)){Qa||(Qa=!0,u(Ra));u(Sa);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ta.unshift(a.postRun.shift());
|
||||||
u(Ta)}}null===Ua&&(Ua=Date.now());if(!(0<ca)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Va.unshift(a.preRun.shift());u(Va);0<ca||a.calledRun||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);c()},1)):c())}}function S(e){if(a.onAbort)a.onAbort(e);void 0!==e?(a.print(e),a.printErr(e),e=JSON.stringify(e)):e="";ja=!0;var c="abort("+e+") at "+g()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";
|
u(Ta)}}null===Ua&&(Ua=Date.now());if(!(0<ca)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Va.unshift(a.preRun.shift());u(Va);0<ca||a.calledRun||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}function S(e){if(a.onAbort)a.onAbort(e);void 0!==e?(a.print(e),a.printErr(e),e=JSON.stringify(e)):e="";ja=!0;var b="abort("+e+") at "+g()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";
|
||||||
Wa&&Wa.forEach(function(a){c=a(c,e)});throw c;}function q(){}function B(a){return(a||q).__cache__}function T(a,c){var e=B(c),b=e[a];if(b)return b;b=Object.create((c||q).prototype);b.ptr=a;return e[a]=b}function X(a){if("string"===typeof a){for(var c=0,e=0;e<a.length;++e){var b=a.charCodeAt(e);55296<=b&&57343>=b&&(b=65536+((b&1023)<<10)|a.charCodeAt(++e)&1023);127>=b?++c:c=2047>=b?c+2:65535>=b?c+3:2097151>=b?c+4:67108863>=b?c+5:c+6}c=Array(c+1);e=0;b=c.length;if(0<b){b=e+b-1;for(var f=0;f<a.length;++f){var g=
|
Wa&&Wa.forEach(function(a){b=a(b,e)});throw b;}function r(){}function B(a){return(a||r).__cache__}function T(a,b){var e=B(b),c=e[a];if(c)return c;c=Object.create((b||r).prototype);c.ptr=a;return e[a]=c}function U(a){if("string"===typeof a){for(var b=0,e=0;e<a.length;++e){var c=a.charCodeAt(e);55296<=c&&57343>=c&&(c=65536+((c&1023)<<10)|a.charCodeAt(++e)&1023);127>=c?++b:b=2047>=c?b+2:65535>=c?b+3:2097151>=c?b+4:67108863>=c?b+5:b+6}b=Array(b+1);e=0;c=b.length;if(0<c){c=e+c-1;for(var f=0;f<a.length;++f){var g=
|
||||||
a.charCodeAt(f);55296<=g&&57343>=g&&(g=65536+((g&1023)<<10)|a.charCodeAt(++f)&1023);if(127>=g){if(e>=b)break;c[e++]=g}else{if(2047>=g){if(e+1>=b)break;c[e++]=192|g>>6}else{if(65535>=g){if(e+2>=b)break;c[e++]=224|g>>12}else{if(2097151>=g){if(e+3>=b)break;c[e++]=240|g>>18}else{if(67108863>=g){if(e+4>=b)break;c[e++]=248|g>>24}else{if(e+5>=b)break;c[e++]=252|g>>30;c[e++]=128|g>>24&63}c[e++]=128|g>>18&63}c[e++]=128|g>>12&63}c[e++]=128|g>>6&63}c[e++]=128|g&63}}c[e]=0}a=k.alloc(c,ba);k.copy(c,ba,a)}return a}
|
a.charCodeAt(f);55296<=g&&57343>=g&&(g=65536+((g&1023)<<10)|a.charCodeAt(++f)&1023);if(127>=g){if(e>=c)break;b[e++]=g}else{if(2047>=g){if(e+1>=c)break;b[e++]=192|g>>6}else{if(65535>=g){if(e+2>=c)break;b[e++]=224|g>>12}else{if(2097151>=g){if(e+3>=c)break;b[e++]=240|g>>18}else{if(67108863>=g){if(e+4>=c)break;b[e++]=248|g>>24}else{if(e+5>=c)break;b[e++]=252|g>>30;b[e++]=128|g>>24&63}b[e++]=128|g>>18&63}b[e++]=128|g>>12&63}b[e++]=128|g>>6&63}b[e++]=128|g&63}}b[e]=0}a=k.alloc(b,ba);k.copy(b,ba,a)}return a}
|
||||||
function A(){throw"cannot construct a Status, no constructor in IDL";}function G(){this.ptr=gb();B(G)[this.ptr]=this}function H(){this.ptr=hb();B(H)[this.ptr]=this}function p(){this.ptr=ib();B(p)[this.ptr]=this}function K(){this.ptr=jb();B(K)[this.ptr]=this}function y(){this.ptr=kb();B(y)[this.ptr]=this}function r(){this.ptr=lb();B(r)[this.ptr]=this}function I(){this.ptr=mb();B(I)[this.ptr]=this}function U(){this.ptr=nb();B(U)[this.ptr]=this}function M(){this.ptr=ob();B(M)[this.ptr]=this}function h(){this.ptr=
|
function A(){throw"cannot construct a Status, no constructor in IDL";}function G(){this.ptr=gb();B(G)[this.ptr]=this}function H(){this.ptr=hb();B(H)[this.ptr]=this}function p(){this.ptr=ib();B(p)[this.ptr]=this}function K(){this.ptr=jb();B(K)[this.ptr]=this}function y(){this.ptr=kb();B(y)[this.ptr]=this}function q(){this.ptr=lb();B(q)[this.ptr]=this}function I(){this.ptr=mb();B(I)[this.ptr]=this}function V(){this.ptr=nb();B(V)[this.ptr]=this}function M(){this.ptr=ob();B(M)[this.ptr]=this}function h(){this.ptr=
|
||||||
pb();B(h)[this.ptr]=this}function C(){this.ptr=qb();B(C)[this.ptr]=this}function Y(){throw"cannot construct a VoidPtr, no constructor in IDL";}function J(){this.ptr=rb();B(J)[this.ptr]=this}function N(){this.ptr=sb();B(N)[this.ptr]=this}var a=b=b||{},Xa=!1,Ya=!1;a.onRuntimeInitialized=function(){Xa=!0;if(Ya&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ya=!0;if(Xa&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==
|
pb();B(h)[this.ptr]=this}function C(){this.ptr=qb();B(C)[this.ptr]=this}function Y(){throw"cannot construct a VoidPtr, no constructor in IDL";}function J(){this.ptr=rb();B(J)[this.ptr]=this}function N(){this.ptr=sb();B(N)[this.ptr]=this}var a=c=c||{},Xa=!1,Ya=!1;a.onRuntimeInitialized=function(){Xa=!0;if(Ya&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ya=!0;if(Xa&&"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?!1:1==a[0]&&0<=a[1]&&2>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};a||(a=("undefined"!==typeof b?b:null)||{});var qa={},Z;for(Z in a)a.hasOwnProperty(Z)&&(qa[Z]=a[Z]);var ka=!1,fa=!1,la=!1,ra=!1;if(a.ENVIRONMENT)if("WEB"===a.ENVIRONMENT)ka=!0;else if("WORKER"===a.ENVIRONMENT)fa=!0;else if("NODE"===a.ENVIRONMENT)la=!0;else if("SHELL"===a.ENVIRONMENT)ra=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");
|
typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0<=a[1]&&2>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};a||(a=("undefined"!==typeof c?c:null)||{});var qa={},Z;for(Z in a)a.hasOwnProperty(Z)&&(qa[Z]=a[Z]);var ka=!1,fa=!1,la=!1,ra=!1;if(a.ENVIRONMENT)if("WEB"===a.ENVIRONMENT)ka=!0;else if("WORKER"===a.ENVIRONMENT)fa=!0;else if("NODE"===a.ENVIRONMENT)la=!0;else if("SHELL"===a.ENVIRONMENT)ra=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");
|
||||||
else ka="object"===typeof window,fa="function"===typeof importScripts,la="object"===typeof process&&"function"===typeof require&&!ka&&!fa,ra=!ka&&!la&&!fa;if(la){a.print||(a.print=console.log);a.printErr||(a.printErr=console.warn);var za,Aa;a.read=function(a,c){za||(za=require("fs"));Aa||(Aa=require("path"));a=Aa.normalize(a);a=za.readFileSync(a);return c?a:a.toString()};a.readBinary=function(e){e=a.read(e,!0);e.buffer||(e=new Uint8Array(e));f(e.buffer);return e};a.thisProgram||(a.thisProgram=1<process.argv.length?
|
else ka="object"===typeof window,fa="function"===typeof importScripts,la="object"===typeof process&&"function"===typeof require&&!ka&&!fa,ra=!ka&&!la&&!fa;if(la){a.print||(a.print=console.log);a.printErr||(a.printErr=console.warn);var za,Aa;a.read=function(a,b){za||(za=require("fs"));Aa||(Aa=require("path"));a=Aa.normalize(a);a=za.readFileSync(a);return b?a:a.toString()};a.readBinary=function(e){e=a.read(e,!0);e.buffer||(e=new Uint8Array(e));f(e.buffer);return e};a.thisProgram||(a.thisProgram=1<process.argv.length?
|
||||||
process.argv[1].replace(/\\/g,"/"):"unknown-program");a.arguments=process.argv.slice(2);process.on("uncaughtException",function(a){if(!(a instanceof aa))throw a;});a.inspect=function(){return"[Emscripten Module object]"}}else if(ra)a.print||(a.print=print),"undefined"!=typeof printErr&&(a.printErr=printErr),a.read="undefined"!=typeof read?function(a){return read(a)}:function(){throw"no read() available";},a.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));
|
process.argv[1].replace(/\\/g,"/"):"unknown-program");a.arguments=process.argv.slice(2);process.on("uncaughtException",function(a){if(!(a instanceof aa))throw a;});a.inspect=function(){return"[Emscripten Module object]"}}else if(ra)a.print||(a.print=print),"undefined"!=typeof printErr&&(a.printErr=printErr),a.read="undefined"!=typeof read?function(a){return read(a)}:function(){throw"no read() available";},a.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));
|
||||||
a=read(a,"binary");f("object"===typeof a);return a},"undefined"!=typeof scriptArgs?a.arguments=scriptArgs:"undefined"!=typeof arguments&&(a.arguments=arguments),"function"===typeof quit&&(a.quit=function(a,c){quit(a)});else if(ka||fa)a.read=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},fa&&(a.readBinary=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),a.readAsync=function(a,
|
a=read(a,"binary");f("object"===typeof a);return a},"undefined"!=typeof scriptArgs?a.arguments=scriptArgs:"undefined"!=typeof arguments&&(a.arguments=arguments),"function"===typeof quit&&(a.quit=function(a,b){quit(a)});else if(ka||fa)a.read=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},fa&&(a.readBinary=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),a.readAsync=function(a,
|
||||||
c,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=function(){200==e.status||0==e.status&&e.response?c(e.response):d()};e.onerror=d;e.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){}),"undefined"===typeof a.setWindowTitle&&(a.setWindowTitle=function(a){document.title=a});else throw Error("Unknown runtime environment. Where are we?");
|
b,d){var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=function(){200==e.status||0==e.status&&e.response?b(e.response):d()};e.onerror=d;e.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){}),"undefined"===typeof a.setWindowTitle&&(a.setWindowTitle=function(a){document.title=a});else throw Error("Unknown runtime environment. Where are we?");
|
||||||
a.print||(a.print=function(){});a.printErr||(a.printErr=a.print);a.arguments||(a.arguments=[]);a.thisProgram||(a.thisProgram="./this.program");a.quit||(a.quit=function(a,c){throw c;});a.print=a.print;a.printErr=a.printErr;a.preRun=[];a.postRun=[];for(Z in qa)qa.hasOwnProperty(Z)&&(a[Z]=qa[Z]);qa=void 0;var m={setTempRet0:function(a){return tempRet0=a},getTempRet0:function(){return tempRet0},stackSave:function(){return P},stackRestore:function(a){P=a},getNativeTypeSize:function(a){switch(a){case "i1":case "i8":return 1;
|
a.print||(a.print=function(){});a.printErr||(a.printErr=a.print);a.arguments||(a.arguments=[]);a.thisProgram||(a.thisProgram="./this.program");a.quit||(a.quit=function(a,b){throw b;});a.print=a.print;a.printErr=a.printErr;a.preRun=[];a.postRun=[];for(Z in qa)qa.hasOwnProperty(Z)&&(a[Z]=qa[Z]);qa=void 0;var m={setTempRet0:function(a){return tempRet0=a},getTempRet0:function(){return tempRet0},stackSave:function(){return P},stackRestore:function(a){P=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]?m.QUANTUM_SIZE:"i"===a[0]?(a=parseInt(a.substr(1)),f(0===a%8),a/8):0}},getNativeFieldSize:function(a){return Math.max(m.getNativeTypeSize(a),m.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(a,c){"double"===c||"i64"===c?a&7&&(f(4===(a&7)),a+=4):f(0===(a&3));return a},getAlignSize:function(a,c,d){return d||"i64"!=a&&"double"!=a?a?Math.min(c||(a?m.getNativeFieldSize(a):
|
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]?m.QUANTUM_SIZE:"i"===a[0]?(a=parseInt(a.substr(1)),f(0===a%8),a/8):0}},getNativeFieldSize:function(a){return Math.max(m.getNativeTypeSize(a),m.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(a,b){"double"===b||"i64"===b?a&7&&(f(4===(a&7)),a+=4):f(0===(a&3));return a},getAlignSize:function(a,b,d){return d||"i64"!=a&&"double"!=a?a?Math.min(b||(a?m.getNativeFieldSize(a):
|
||||||
0),m.QUANTUM_SIZE):Math.min(c,8):8},dynCall:function(e,c,d){return d&&d.length?a["dynCall_"+e].apply(null,[c].concat(d)):a["dynCall_"+e].call(null,c)},functionPointers:[],addFunction:function(a){for(var c=0;c<m.functionPointers.length;c++)if(!m.functionPointers[c])return m.functionPointers[c]=a,2*(1+c);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";},removeFunction:function(a){m.functionPointers[(a-2)/2]=null},warnOnce:function(e){m.warnOnce.shown||
|
0),m.QUANTUM_SIZE):Math.min(b,8):8},dynCall:function(e,b,d){return d&&d.length?a["dynCall_"+e].apply(null,[b].concat(d)):a["dynCall_"+e].call(null,b)},functionPointers:[],addFunction:function(a){for(var b=0;b<m.functionPointers.length;b++)if(!m.functionPointers[b])return m.functionPointers[b]=a,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";},removeFunction:function(a){m.functionPointers[(a-2)/2]=null},warnOnce:function(e){m.warnOnce.shown||
|
||||||
(m.warnOnce.shown={});m.warnOnce.shown[e]||(m.warnOnce.shown[e]=1,a.printErr(e))},funcWrappers:{},getFuncWrapper:function(a,c){if(a){f(c);m.funcWrappers[c]||(m.funcWrappers[c]={});var d=m.funcWrappers[c];d[a]||(d[a]=1===c.length?function(){return m.dynCall(c,a)}:2===c.length?function(d){return m.dynCall(c,a,[d])}:function(){return m.dynCall(c,a,Array.prototype.slice.call(arguments))});return d[a]}},getCompilerSetting:function(a){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work";
|
(m.warnOnce.shown={});m.warnOnce.shown[e]||(m.warnOnce.shown[e]=1,a.printErr(e))},funcWrappers:{},getFuncWrapper:function(a,b){if(a){f(b);m.funcWrappers[b]||(m.funcWrappers[b]={});var d=m.funcWrappers[b];d[a]||(d[a]=1===b.length?function(){return m.dynCall(b,a)}:2===b.length?function(d){return m.dynCall(b,a,[d])}:function(){return m.dynCall(b,a,Array.prototype.slice.call(arguments))});return d[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 c=P;P=P+a|0;P=P+15&-16;return c},staticAlloc:function(a){var c=V;V=V+a|0;V=V+15&-16;return c},dynamicAlloc:function(a){var c=w[W>>2];a=(c+a+15|0)&-16;w[W>>2]=a;return a>=x&&!Ha()?(w[W>>2]=c,0):c},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},ja=0,Pa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==
|
},stackAlloc:function(a){var b=P;P=P+a|0;P=P+15&-16;return b},staticAlloc:function(a){var b=W;W=W+a|0;W=W+15&-16;return b},dynamicAlloc:function(a){var b=w[X>>2];a=(b+a+15|0)&-16;w[X>>2]=a;return a>=x&&!Ha()?(w[X>>2]=b,0):b},alignMemory:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},makeBigInt:function(a,b,d){return d?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*+(b|0)},GLOBAL_BASE:1024,QUANTUM_SIZE:4,__dummy__:0},ja=0,Pa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==
|
||||||
typeof TextDecoder&&new TextDecoder("utf-16le");var va=65536,Na=16777216,db=16777216,ba,O,ua,Ja,w,Ka,La,Ma,V,Ba,P,sa,Ca,W;var Da=V=Ba=P=sa=Ca=W=0;a.reallocBuffer||(a.reallocBuffer=function(a){try{if(ArrayBuffer.transfer)var c=ArrayBuffer.transfer(E,a);else{var d=ba;c=new ArrayBuffer(a);(new Int8Array(c)).set(d)}}catch(l){return!1}return tb(c)?c:!1});try{var Ea=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);Ea(new ArrayBuffer(4))}catch(e){Ea=function(a){return a.byteLength}}var Fa=
|
typeof TextDecoder&&new TextDecoder("utf-16le");var va=65536,Na=16777216,db=16777216,ba,O,ua,Ja,w,Ka,La,Ma,W,Ba,P,sa,Ca,X;var Da=W=Ba=P=sa=Ca=X=0;a.reallocBuffer||(a.reallocBuffer=function(a){try{if(ArrayBuffer.transfer)var b=ArrayBuffer.transfer(E,a);else{var d=ba;b=new ArrayBuffer(a);(new Int8Array(b)).set(d)}}catch(l){return!1}return tb(b)?b:!1});try{var Ea=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);Ea(new ArrayBuffer(4))}catch(e){Ea=function(a){return a.byteLength}}var Fa=
|
||||||
a.TOTAL_STACK||5242880,x=a.TOTAL_MEMORY||16777216;x<Fa&&a.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+x+"! (TOTAL_STACK="+Fa+")");if(a.buffer)var E=a.buffer;else"object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory?(a.wasmMemory=new WebAssembly.Memory({initial:x/va}),E=a.wasmMemory.buffer):E=new ArrayBuffer(x);R();w[0]=1668509029;ua[1]=25459;if(115!==O[2]||99!==O[3])throw"Runtime error: expected the system to be little-endian!";a.HEAP=void 0;a.buffer=E;a.HEAP8=
|
a.TOTAL_STACK||5242880,x=a.TOTAL_MEMORY||16777216;x<Fa&&a.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+x+"! (TOTAL_STACK="+Fa+")");if(a.buffer)var E=a.buffer;else"object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory?(a.wasmMemory=new WebAssembly.Memory({initial:x/va}),E=a.wasmMemory.buffer):E=new ArrayBuffer(x);R();w[0]=1668509029;ua[1]=25459;if(115!==O[2]||99!==O[3])throw"Runtime error: expected the system to be little-endian!";a.HEAP=void 0;a.buffer=E;a.HEAP8=
|
||||||
ba;a.HEAP16=ua;a.HEAP32=w;a.HEAPU8=O;a.HEAPU16=Ja;a.HEAPU32=Ka;a.HEAPF32=La;a.HEAPF64=Ma;var Va=[],Ra=[],Sa=[],Za=[],Ta=[],Qa=!1;f(Math.imul&&Math.fround&&Math.clz32&&Math.trunc,"this is a legacy browser, build with LEGACY_VM_SUPPORT");var ca=0,wa=null,oa=null;a.preloadedImages={};a.preloadedAudios={};var Q=null;(function(){function e(){try{if(a.wasmBinary)return new Uint8Array(a.wasmBinary);if(a.readBinary)return a.readBinary(b);throw"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)";
|
ba;a.HEAP16=ua;a.HEAP32=w;a.HEAPU8=O;a.HEAPU16=Ja;a.HEAPU32=Ka;a.HEAPF32=La;a.HEAPF64=Ma;var Va=[],Ra=[],Sa=[],Za=[],Ta=[],Qa=!1;f(Math.imul&&Math.fround&&Math.clz32&&Math.trunc,"this is a legacy browser, build with LEGACY_VM_SUPPORT");var ca=0,wa=null,oa=null;a.preloadedImages={};a.preloadedAudios={};var Q=null;(function(){function e(){try{if(a.wasmBinary)return new Uint8Array(a.wasmBinary);if(a.readBinary)return a.readBinary(c);throw"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)";
|
||||||
}catch(eb){S(eb)}}function c(){return a.wasmBinary||!ka&&!fa||"function"!==typeof fetch?new Promise(function(a,c){a(e())}):fetch(b,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+b+"'";return a.arrayBuffer()}).catch(function(){return e()})}function d(d,e,l){function f(c,d){h=c.exports;if(h.memory){c=h.memory;d=a.buffer;c.byteLength<d.byteLength&&a.printErr("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");
|
}catch(eb){S(eb)}}function b(){return a.wasmBinary||!ka&&!fa||"function"!==typeof fetch?new Promise(function(a,b){a(e())}):fetch(c,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+c+"'";return a.arrayBuffer()}).catch(function(){return e()})}function d(d,e,l){function f(b,d){h=b.exports;if(h.memory){b=h.memory;d=a.buffer;b.byteLength<d.byteLength&&a.printErr("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");
|
||||||
d=new Int8Array(d);var e=new Int8Array(c);Q||d.set(e.subarray(a.STATIC_BASE,a.STATIC_BASE+a.STATIC_BUMP),a.STATIC_BASE);e.set(d);a.buffer=E=c;R()}a.asm=h;a.usingWasm=!0;Ia("wasm-instantiate")}function k(a){f(a.instance,a.module)}function F(d){c().then(function(a){return WebAssembly.instantiate(a,g)}).then(d).catch(function(c){a.printErr("failed to asynchronously prepare wasm: "+c);S(c)})}if("object"!==typeof WebAssembly)return a.printErr("no native wasm support detected"),!1;if(!(a.wasmMemory instanceof
|
d=new Int8Array(d);var e=new Int8Array(b);Q||d.set(e.subarray(a.STATIC_BASE,a.STATIC_BASE+a.STATIC_BUMP),a.STATIC_BASE);e.set(d);a.buffer=E=b;R()}a.asm=h;a.usingWasm=!0;Ia("wasm-instantiate")}function k(a){f(a.instance,a.module)}function F(d){b().then(function(a){return WebAssembly.instantiate(a,g)}).then(d).catch(function(b){a.printErr("failed to asynchronously prepare wasm: "+b);S(b)})}if("object"!==typeof WebAssembly)return a.printErr("no native wasm support detected"),!1;if(!(a.wasmMemory instanceof
|
||||||
WebAssembly.Memory))return a.printErr("no native wasm Memory in use"),!1;e.memory=a.wasmMemory;g.global={NaN:NaN,Infinity:Infinity};g["global.Math"]=d.Math;g.env=e;v("wasm-instantiate");if(a.instantiateWasm)try{return a.instantiateWasm(g,f)}catch(fb){return a.printErr("Module.instantiateWasm callback failed with error: "+fb),!1}a.wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||0===b.indexOf("data:")||"function"!==typeof fetch?F(k):WebAssembly.instantiateStreaming(fetch(b,{credentials:"same-origin"}),
|
WebAssembly.Memory))return a.printErr("no native wasm Memory in use"),!1;e.memory=a.wasmMemory;g.global={NaN:NaN,Infinity:Infinity};g["global.Math"]=d.Math;g.env=e;v("wasm-instantiate");if(a.instantiateWasm)try{return a.instantiateWasm(g,f)}catch(fb){return a.printErr("Module.instantiateWasm callback failed with error: "+fb),!1}a.wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||0===c.indexOf("data:")||"function"!==typeof fetch?F(k):WebAssembly.instantiateStreaming(fetch(c,{credentials:"same-origin"}),
|
||||||
g).then(k).catch(function(c){a.printErr("wasm streaming compile failed: "+c);a.printErr("falling back to ArrayBuffer instantiation");F(k)});return{}}var b="draco_decoder.wasm",f="draco_decoder.temp.asm.js";"function"===typeof a.locateFile&&(a.locateFile("draco_decoder.wast"),b=a.locateFile(b),f=a.locateFile(f));var g={global:null,env:null,asm2wasm:{"f64-rem":function(a,c){return a%c},"debugger":function(){debugger}},parent:a},h=null;a.asmPreload=a.asm;var k=a.reallocBuffer;a.reallocBuffer=function(c){if("asmjs"===
|
g).then(k).catch(function(b){a.printErr("wasm streaming compile failed: "+b);a.printErr("falling back to ArrayBuffer instantiation");F(k)});return{}}var c="draco_decoder.wasm",f="draco_decoder.temp.asm.js";"function"===typeof a.locateFile&&(a.locateFile("draco_decoder.wast"),c=a.locateFile(c),f=a.locateFile(f));var g={global:null,env:null,asm2wasm:{"f64-rem":function(a,b){return a%b},"debugger":function(){debugger}},parent:a},h=null;a.asmPreload=a.asm;var k=a.reallocBuffer;a.reallocBuffer=function(b){if("asmjs"===
|
||||||
m)var d=k(c);else a:{c=ha(c,a.usingWasm?va:Na);var e=a.buffer.byteLength;if(a.usingWasm)try{d=-1!==a.wasmMemory.grow((c-e)/65536)?a.buffer=a.wasmMemory.buffer:null;break a}catch(cd){d=null;break a}d=void 0}return d};var m="";a.asm=function(c,e,b){if(!e.table){var l=a.wasmTableSize;void 0===l&&(l=1024);var f=a.wasmMaxTableSize;e.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==f?new WebAssembly.Table({initial:l,maximum:f,element:"anyfunc"}):new WebAssembly.Table({initial:l,
|
m)var d=k(b);else a:{b=ha(b,a.usingWasm?va:Na);var e=a.buffer.byteLength;if(a.usingWasm)try{d=-1!==a.wasmMemory.grow((b-e)/65536)?a.buffer=a.wasmMemory.buffer:null;break a}catch(fd){d=null;break a}d=void 0}return d};var m="";a.asm=function(b,e,c){if(!e.table){var l=a.wasmTableSize;void 0===l&&(l=1024);var f=a.wasmMaxTableSize;e.table="object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==f?new WebAssembly.Table({initial:l,maximum:f,element:"anyfunc"}):new WebAssembly.Table({initial:l,
|
||||||
element:"anyfunc"}):Array(l);a.wasmTable=e.table}e.memoryBase||(e.memoryBase=a.STATIC_BASE);e.tableBase||(e.tableBase=0);(c=d(c,e,b))||S("no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods");return c}})();Da=m.GLOBAL_BASE;V=Da+17616;Ra.push();Q=null;a.STATIC_BASE=Da;a.STATIC_BUMP=17616;var ub=V;V+=16;var z={last:0,caught:[],infos:{},deAdjust:function(a){if(!a||z.infos[a])return a;
|
element:"anyfunc"}):Array(l);a.wasmTable=e.table}e.memoryBase||(e.memoryBase=a.STATIC_BASE);e.tableBase||(e.tableBase=0);(b=d(b,e,c))||S("no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods");return b}})();Da=m.GLOBAL_BASE;W=Da+17952;Ra.push();Q=null;a.STATIC_BASE=Da;a.STATIC_BUMP=17952;var ub=W;W+=16;var z={last:0,caught:[],infos:{},deAdjust:function(a){if(!a||z.infos[a])return a;
|
||||||
for(var c in z.infos)if(z.infos[c].adjusted===a)return c;return a},addRef:function(a){a&&z.infos[a].refcount++},decRef:function(e){if(e){var c=z.infos[e];f(0<c.refcount);c.refcount--;0!==c.refcount||c.rethrown||(c.destructor&&a.dynCall_vi(c.destructor,e),delete z.infos[e],___cxa_free_exception(e))}},clearRef:function(a){a&&(z.infos[a].refcount=0)}},t={varargs:0,get:function(a){t.varargs+=4;return w[t.varargs-4>>2]},getStr:function(){return n(t.get())},get64:function(){var a=t.get(),c=t.get();0<=a?
|
for(var b in z.infos)if(z.infos[b].adjusted===a)return b;return a},addRef:function(a){a&&z.infos[a].refcount++},decRef:function(e){if(e){var b=z.infos[e];f(0<b.refcount);b.refcount--;0!==b.refcount||b.rethrown||(b.destructor&&a.dynCall_vi(b.destructor,e),delete z.infos[e],___cxa_free_exception(e))}},clearRef:function(a){a&&(z.infos[a].refcount=0)}},t={varargs:0,get:function(a){t.varargs+=4;return w[t.varargs-4>>2]},getStr:function(){return n(t.get())},get64:function(){var a=t.get(),b=t.get();0<=a?
|
||||||
f(0===c):f(-1===c);return a},getZero:function(){f(0===t.get())}},ta={},Ga=1;Za.push(function(){var e=a._fflush;e&&e(0);if(e=L.printChar){var c=L.buffers;c[1].length&&e(1,10);c[2].length&&e(2,10)}});W=m.staticAlloc(4);Ba=P=m.alignMemory(V);sa=Ba+Fa;Ca=m.alignMemory(sa);w[W>>2]=Ca;a.wasmTableSize=468;a.wasmMaxTableSize=468;a.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,
|
f(0===b):f(-1===b);return a},getZero:function(){f(0===t.get())}},ta={},Ga=1;Za.push(function(){var e=a._fflush;e&&e(0);if(e=L.printChar){var b=L.buffers;b[1].length&&e(1,10);b[2].length&&e(2,10)}});X=m.staticAlloc(4);Ba=P=m.alignMemory(W);sa=Ba+Fa;Ca=m.alignMemory(sa);w[X>>2]=Ca;a.wasmTableSize=468;a.wasmMaxTableSize=468;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:Ea};a.asmLibraryArg={abort:S,assert:f,enlargeMemory:Ha,getTotalMemory:function(){return x},abortOnCannotGrowMemory:function(){S("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+x+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},
|
Float64Array:Float64Array,NaN:NaN,Infinity:Infinity,byteLength:Ea};a.asmLibraryArg={abort:S,assert:f,enlargeMemory:Ha,getTotalMemory:function(){return x},abortOnCannotGrowMemory:function(){S("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+x+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},
|
||||||
invoke_ii:function(e,c){try{return a.dynCall_ii(e,c)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_iii:function(e,c,d){try{return a.dynCall_iii(e,c,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_iiii:function(e,c,d,b){try{return a.dynCall_iiii(e,c,d,b)}catch(F){if("number"!==typeof F&&"longjmp"!==F)throw F;a.setThrew(1,0)}},invoke_iiiiiii:function(e,c,d,b,f,g,h){try{return a.dynCall_iiiiiii(e,c,d,b,f,g,h)}catch(ea){if("number"!==
|
invoke_ii:function(e,b){try{return a.dynCall_ii(e,b)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_iii:function(e,b,d){try{return a.dynCall_iii(e,b,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_iiii:function(e,b,d,c){try{return a.dynCall_iiii(e,b,d,c)}catch(F){if("number"!==typeof F&&"longjmp"!==F)throw F;a.setThrew(1,0)}},invoke_iiiiiii:function(e,b,d,c,f,g,h){try{return a.dynCall_iiiiiii(e,b,d,c,f,g,h)}catch(ea){if("number"!==
|
||||||
typeof ea&&"longjmp"!==ea)throw ea;a.setThrew(1,0)}},invoke_v:function(e){try{a.dynCall_v(e)}catch(c){if("number"!==typeof c&&"longjmp"!==c)throw c;a.setThrew(1,0)}},invoke_vi:function(e,c){try{a.dynCall_vi(e,c)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_vii:function(e,c,d){try{a.dynCall_vii(e,c,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_viii:function(e,c,d,b){try{a.dynCall_viii(e,c,d,b)}catch(F){if("number"!==typeof F&&
|
typeof ea&&"longjmp"!==ea)throw ea;a.setThrew(1,0)}},invoke_v:function(e){try{a.dynCall_v(e)}catch(b){if("number"!==typeof b&&"longjmp"!==b)throw b;a.setThrew(1,0)}},invoke_vi:function(e,b){try{a.dynCall_vi(e,b)}catch(d){if("number"!==typeof d&&"longjmp"!==d)throw d;a.setThrew(1,0)}},invoke_vii:function(e,b,d){try{a.dynCall_vii(e,b,d)}catch(l){if("number"!==typeof l&&"longjmp"!==l)throw l;a.setThrew(1,0)}},invoke_viii:function(e,b,d,c){try{a.dynCall_viii(e,b,d,c)}catch(F){if("number"!==typeof F&&
|
||||||
"longjmp"!==F)throw F;a.setThrew(1,0)}},invoke_viiii:function(e,c,d,b,f){try{a.dynCall_viiii(e,c,d,b,f)}catch(pa){if("number"!==typeof pa&&"longjmp"!==pa)throw pa;a.setThrew(1,0)}},invoke_viiiii:function(e,c,d,b,f,g){try{a.dynCall_viiiii(e,c,d,b,f,g)}catch(da){if("number"!==typeof da&&"longjmp"!==da)throw da;a.setThrew(1,0)}},invoke_viiiiii:function(e,c,d,b,f,g,h){try{a.dynCall_viiiiii(e,c,d,b,f,g,h)}catch(ea){if("number"!==typeof ea&&"longjmp"!==ea)throw ea;a.setThrew(1,0)}},__ZSt18uncaught_exceptionv:ia,
|
"longjmp"!==F)throw F;a.setThrew(1,0)}},invoke_viiii:function(e,b,d,c,f){try{a.dynCall_viiii(e,b,d,c,f)}catch(pa){if("number"!==typeof pa&&"longjmp"!==pa)throw pa;a.setThrew(1,0)}},invoke_viiiii:function(e,b,d,c,f,g){try{a.dynCall_viiiii(e,b,d,c,f,g)}catch(da){if("number"!==typeof da&&"longjmp"!==da)throw da;a.setThrew(1,0)}},invoke_viiiiii:function(e,b,d,c,f,g,h){try{a.dynCall_viiiiii(e,b,d,c,f,g,h)}catch(ea){if("number"!==typeof ea&&"longjmp"!==ea)throw ea;a.setThrew(1,0)}},__ZSt18uncaught_exceptionv:ia,
|
||||||
___assert_fail:function(a,c,d,b){ja=!0;throw"Assertion failed: "+n(a)+", at: "+[c?n(c):"unknown filename",d,b?n(b):"unknown function"]+" at "+g();},___cxa_allocate_exception:function(a){return Oa(a)},___cxa_begin_catch:function(a){var c=z.infos[a];c&&!c.caught&&(c.caught=!0,ia.uncaught_exception--);c&&(c.rethrown=!1);z.caught.push(a);z.addRef(z.deAdjust(a));return a},___cxa_find_matching_catch:ma,___cxa_pure_virtual:function(){ja=!0;throw"Pure virtual function called!";},___cxa_throw:function(a,c,
|
___assert_fail:function(a,b,d,c){ja=!0;throw"Assertion failed: "+n(a)+", at: "+[b?n(b):"unknown filename",d,c?n(c):"unknown function"]+" at "+g();},___cxa_allocate_exception:function(a){return Oa(a)},___cxa_begin_catch:function(a){var b=z.infos[a];b&&!b.caught&&(b.caught=!0,ia.uncaught_exception--);b&&(b.rethrown=!1);z.caught.push(a);z.addRef(z.deAdjust(a));return a},___cxa_find_matching_catch:ma,___cxa_pure_virtual:function(){ja=!0;throw"Pure virtual function called!";},___cxa_throw:function(a,b,
|
||||||
d){z.infos[a]={ptr:a,adjusted:a,type:c,destructor:d,refcount:0,caught:!1,rethrown:!1};z.last=a;"uncaught_exception"in ia?ia.uncaught_exception++:ia.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.";},___gxx_personality_v0:function(){},___resumeException:function(a){z.last||(z.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.";
|
d){z.infos[a]={ptr:a,adjusted:a,type:b,destructor:d,refcount:0,caught:!1,rethrown:!1};z.last=a;"uncaught_exception"in ia?ia.uncaught_exception++:ia.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.";},___gxx_personality_v0:function(){},___resumeException:function(a){z.last||(z.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.";
|
||||||
},___setErrNo:function(b){a.___errno_location&&(w[a.___errno_location()>>2]=b);return b},___syscall140:function(a,c){t.varargs=c;try{var d=t.getStreamFromFD();t.get();var b=t.get(),e=t.get(),f=t.get();FS.llseek(d,b,f);w[e>>2]=d.position;d.getdents&&0===b&&0===f&&(d.getdents=null);return 0}catch(da){return"undefined"!==typeof FS&&da instanceof FS.ErrnoError||S(da),-da.errno}},___syscall146:L,___syscall6:function(a,c){t.varargs=c;try{var d=t.getStreamFromFD();FS.close(d);return 0}catch(l){return"undefined"!==
|
},___setErrNo:function(c){a.___errno_location&&(w[a.___errno_location()>>2]=c);return c},___syscall140:function(a,b){t.varargs=b;try{var d=t.getStreamFromFD();t.get();var c=t.get(),e=t.get(),f=t.get();FS.llseek(d,c,f);w[e>>2]=d.position;d.getdents&&0===c&&0===f&&(d.getdents=null);return 0}catch(da){return"undefined"!==typeof FS&&da instanceof FS.ErrnoError||S(da),-da.errno}},___syscall146:L,___syscall6:function(a,b){t.varargs=b;try{var d=t.getStreamFromFD();FS.close(d);return 0}catch(l){return"undefined"!==
|
||||||
typeof FS&&l instanceof FS.ErrnoError||S(l),-l.errno}},_abort:function(){a.abort()},_emscripten_memcpy_big:function(a,c,d){O.set(O.subarray(c,c+d),a);return a},_pthread_getspecific:function(a){return ta[a]||0},_pthread_key_create:function(a,c){if(0==a)return 22;w[a>>2]=Ga;ta[Ga]=0;Ga++;return 0},_pthread_once:na,_pthread_setspecific:function(a,c){if(!(a in ta))return 22;ta[a]=c;return 0},DYNAMICTOP_PTR:W,tempDoublePtr:ub,ABORT:ja,STACKTOP:P,STACK_MAX:sa};var $a=a.asm(a.asmGlobalArg,a.asmLibraryArg,
|
typeof FS&&l instanceof FS.ErrnoError||S(l),-l.errno}},_abort:function(){a.abort()},_emscripten_memcpy_big:function(a,b,d){O.set(O.subarray(b,b+d),a);return a},_pthread_getspecific:function(a){return ta[a]||0},_pthread_key_create:function(a,b){if(0==a)return 22;w[a>>2]=Ga;ta[Ga]=0;Ga++;return 0},_pthread_once:na,_pthread_setspecific:function(a,b){if(!(a in ta))return 22;ta[a]=b;return 0},DYNAMICTOP_PTR:X,tempDoublePtr:ub,ABORT:ja,STACKTOP:P,STACK_MAX:sa};var $a=a.asm(a.asmGlobalArg,a.asmLibraryArg,
|
||||||
E);a.asm=$a;a.___cxa_can_catch=function(){return a.asm.___cxa_can_catch.apply(null,arguments)};a.___cxa_is_pointer_type=function(){return a.asm.___cxa_is_pointer_type.apply(null,arguments)};var hb=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},vb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,
|
E);a.asm=$a;a.___cxa_can_catch=function(){return a.asm.___cxa_can_catch.apply(null,arguments)};a.___cxa_is_pointer_type=function(){return a.asm.___cxa_is_pointer_type.apply(null,arguments)};var hb=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},vb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,
|
||||||
arguments)},wb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},xb=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},kb=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,
|
arguments)},wb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},xb=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},kb=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,
|
||||||
arguments)},yb=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},zb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},Ab=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,
|
arguments)},yb=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},zb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},Ab=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm._emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,
|
||||||
@ -66,48 +66,50 @@ Wb=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.as
|
|||||||
arguments)},Zb=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},$b=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},ac=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm._emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},rb=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm._emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,
|
arguments)},Zb=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},$b=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},ac=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm._emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},rb=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm._emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,
|
||||||
arguments)},bc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},cc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm._emscripten_bind_DracoInt32Array_size_0.apply(null,arguments)},nb=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm._emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
|
arguments)},bc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm._emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},cc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm._emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm._emscripten_bind_DracoInt32Array_size_0.apply(null,arguments)},nb=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm._emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
|
||||||
arguments)},ec=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm._emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},qb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm._emscripten_bind_Mesh_Mesh_0.apply(null,arguments)},fc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm._emscripten_bind_Mesh___destroy___0.apply(null,arguments)},gc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm._emscripten_bind_Mesh_num_attributes_0.apply(null,
|
arguments)},ec=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm._emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},qb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm._emscripten_bind_Mesh_Mesh_0.apply(null,arguments)},fc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm._emscripten_bind_Mesh___destroy___0.apply(null,arguments)},gc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm._emscripten_bind_Mesh_num_attributes_0.apply(null,
|
||||||
arguments)},hc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm._emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},ic=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm._emscripten_bind_Mesh_num_points_0.apply(null,arguments)},jc=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},kc=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,
|
arguments)},hc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm._emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},ic=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm._emscripten_bind_Mesh_num_points_0.apply(null,arguments)},jc=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},kc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,
|
||||||
arguments)},lc=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},mc=a._emscripten_bind_MetadataQuerier_HasDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasDoubleEntry_2.apply(null,arguments)},nc=a._emscripten_bind_MetadataQuerier_HasIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasIntEntry_2.apply(null,arguments)},oc=a._emscripten_bind_MetadataQuerier_HasStringEntry_2=
|
arguments)},lc=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},mc=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},nc=a._emscripten_bind_MetadataQuerier_HasDoubleEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasDoubleEntry_2.apply(null,arguments)},oc=a._emscripten_bind_MetadataQuerier_HasEntry_2=
|
||||||
function(){return a.asm._emscripten_bind_MetadataQuerier_HasStringEntry_2.apply(null,arguments)},lb=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm._emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},pc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm._emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},sb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm._emscripten_bind_Metadata_Metadata_0.apply(null,
|
function(){return a.asm._emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},pc=a._emscripten_bind_MetadataQuerier_HasIntEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasIntEntry_2.apply(null,arguments)},qc=a._emscripten_bind_MetadataQuerier_HasStringEntry_2=function(){return a.asm._emscripten_bind_MetadataQuerier_HasStringEntry_2.apply(null,arguments)},lb=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm._emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,
|
||||||
arguments)},qc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm._emscripten_bind_Metadata___destroy___0.apply(null,arguments)},rc=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm._emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},ib=a._emscripten_bind_PointAttribute_PointAttribute_0=function(){return a.asm._emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},sc=a._emscripten_bind_PointAttribute___destroy___0=
|
arguments)},rc=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm._emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,arguments)},sc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm._emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},sb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm._emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},tc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm._emscripten_bind_Metadata___destroy___0.apply(null,
|
||||||
function(){return a.asm._emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},tc=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm._emscripten_bind_PointAttribute_attribute_type_0.apply(null,arguments)},uc=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},vc=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_stride_0.apply(null,
|
arguments)},uc=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm._emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},ib=a._emscripten_bind_PointAttribute_PointAttribute_0=function(){return a.asm._emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},vc=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm._emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},wc=a._emscripten_bind_PointAttribute_attribute_type_0=
|
||||||
arguments)},wc=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm._emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},xc=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm._emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},yc=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm._emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},zc=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm._emscripten_bind_PointAttribute_size_0.apply(null,
|
function(){return a.asm._emscripten_bind_PointAttribute_attribute_type_0.apply(null,arguments)},xc=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},yc=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm._emscripten_bind_PointAttribute_byte_stride_0.apply(null,arguments)},zc=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm._emscripten_bind_PointAttribute_data_type_0.apply(null,
|
||||||
arguments)},Ac=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm._emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},gb=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm._emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},Bc=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm._emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Cc=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm._emscripten_bind_PointCloud_num_attributes_0.apply(null,
|
arguments)},Ac=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm._emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Bc=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm._emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Cc=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm._emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Dc=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm._emscripten_bind_PointAttribute_unique_id_0.apply(null,
|
||||||
arguments)},Dc=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm._emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},Ec=a._emscripten_bind_Status___destroy___0=function(){return a.asm._emscripten_bind_Status___destroy___0.apply(null,arguments)},Fc=a._emscripten_bind_Status_code_0=function(){return a.asm._emscripten_bind_Status_code_0.apply(null,arguments)},Gc=a._emscripten_bind_Status_error_msg_0=function(){return a.asm._emscripten_bind_Status_error_msg_0.apply(null,arguments)},
|
arguments)},gb=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm._emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},Ec=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm._emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Fc=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm._emscripten_bind_PointCloud_num_attributes_0.apply(null,arguments)},Gc=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm._emscripten_bind_PointCloud_num_points_0.apply(null,
|
||||||
Hc=a._emscripten_bind_Status_ok_0=function(){return a.asm._emscripten_bind_Status_ok_0.apply(null,arguments)},Ic=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm._emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},Jc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,arguments)},Kc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=
|
arguments)},Hc=a._emscripten_bind_Status___destroy___0=function(){return a.asm._emscripten_bind_Status___destroy___0.apply(null,arguments)},Ic=a._emscripten_bind_Status_code_0=function(){return a.asm._emscripten_bind_Status_code_0.apply(null,arguments)},Jc=a._emscripten_bind_Status_error_msg_0=function(){return a.asm._emscripten_bind_Status_error_msg_0.apply(null,arguments)},Kc=a._emscripten_bind_Status_ok_0=function(){return a.asm._emscripten_bind_Status_ok_0.apply(null,arguments)},Lc=a._emscripten_bind_VoidPtr___destroy___0=
|
||||||
function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},Lc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,arguments)},Mc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,
|
function(){return a.asm._emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},Mc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,arguments)},Nc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},Oc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=
|
||||||
arguments)},Nc=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,arguments)},Oc=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},Pc=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,
|
function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,arguments)},Pc=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},Qc=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,
|
||||||
arguments)},Qc=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},Rc=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)},Sc=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},Tc=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=
|
arguments)},Rc=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},Sc=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},Tc=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},Uc=
|
||||||
function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},Uc=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},Vc=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},Wc=a._emscripten_enum_draco_StatusCode_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_ERROR.apply(null,
|
a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)},Vc=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},Wc=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},Xc=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=
|
||||||
arguments)},Xc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm._emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm._emscripten_enum_draco_StatusCode_OK.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,
|
function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},Yc=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_ERROR.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm._emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,
|
||||||
arguments)},ad=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)};a._emscripten_get_global_libc=function(){return a.asm._emscripten_get_global_libc.apply(null,arguments)};var tb=a._emscripten_replace_memory=function(){return a.asm._emscripten_replace_memory.apply(null,arguments)};a._free=function(){return a.asm._free.apply(null,arguments)};a._llvm_bswap_i32=function(){return a.asm._llvm_bswap_i32.apply(null,
|
arguments)},ad=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm._emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},bd=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm._emscripten_enum_draco_StatusCode_OK.apply(null,arguments)},cd=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},dd=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return a.asm._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,
|
||||||
arguments)};var Oa=a._malloc=function(){return a.asm._malloc.apply(null,arguments)};a._memcpy=function(){return a.asm._memcpy.apply(null,arguments)};a._memmove=function(){return a.asm._memmove.apply(null,arguments)};a._memset=function(){return a.asm._memset.apply(null,arguments)};a._sbrk=function(){return a.asm._sbrk.apply(null,arguments)};a.establishStackSpace=function(){return a.asm.establishStackSpace.apply(null,arguments)};a.getTempRet0=function(){return a.asm.getTempRet0.apply(null,arguments)};
|
arguments)};a._emscripten_get_global_libc=function(){return a.asm._emscripten_get_global_libc.apply(null,arguments)};var tb=a._emscripten_replace_memory=function(){return a.asm._emscripten_replace_memory.apply(null,arguments)};a._free=function(){return a.asm._free.apply(null,arguments)};a._llvm_bswap_i32=function(){return a.asm._llvm_bswap_i32.apply(null,arguments)};var Oa=a._malloc=function(){return a.asm._malloc.apply(null,arguments)};a._memcpy=function(){return a.asm._memcpy.apply(null,arguments)};
|
||||||
a.runPostSets=function(){return a.asm.runPostSets.apply(null,arguments)};a.setTempRet0=function(){return a.asm.setTempRet0.apply(null,arguments)};a.setThrew=function(){return a.asm.setThrew.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_iii=
|
a._memmove=function(){return a.asm._memmove.apply(null,arguments)};a._memset=function(){return a.asm._memset.apply(null,arguments)};a._sbrk=function(){return a.asm._sbrk.apply(null,arguments)};a.establishStackSpace=function(){return a.asm.establishStackSpace.apply(null,arguments)};a.getTempRet0=function(){return a.asm.getTempRet0.apply(null,arguments)};a.runPostSets=function(){return a.asm.runPostSets.apply(null,arguments)};a.setTempRet0=function(){return a.asm.setTempRet0.apply(null,arguments)};
|
||||||
function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};
|
a.setThrew=function(){return a.asm.setThrew.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};
|
||||||
a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};m.stackAlloc=a.stackAlloc;m.stackSave=a.stackSave;m.stackRestore=a.stackRestore;m.establishStackSpace=a.establishStackSpace;m.setTempRet0=a.setTempRet0;m.getTempRet0=a.getTempRet0;a.asm=$a;if(Q)if("function"===typeof a.locateFile?Q=a.locateFile(Q):a.memoryInitializerPrefixURL&&
|
a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,
|
||||||
(Q=a.memoryInitializerPrefixURL+Q),la||ra){var bd=a.readBinary(Q);O.set(bd,m.GLOBAL_BASE)}else{var bb=function(){a.readAsync(Q,ab,function(){throw"could not load memory initializer "+Q;})};v("memory initializer");var ab=function(b){b.byteLength&&(b=new Uint8Array(b));O.set(b,m.GLOBAL_BASE);a.memoryInitializerRequest&&delete a.memoryInitializerRequest.response;Ia("memory initializer")};if(a.memoryInitializerRequest){var cb=function(){var b=a.memoryInitializerRequest,c=b.response;200!==b.status&&0!==
|
arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};m.stackAlloc=a.stackAlloc;m.stackSave=a.stackSave;m.stackRestore=a.stackRestore;m.establishStackSpace=a.establishStackSpace;m.setTempRet0=a.setTempRet0;m.getTempRet0=a.getTempRet0;a.asm=$a;if(Q)if("function"===typeof a.locateFile?Q=a.locateFile(Q):a.memoryInitializerPrefixURL&&(Q=a.memoryInitializerPrefixURL+Q),la||ra){var ed=a.readBinary(Q);O.set(ed,m.GLOBAL_BASE)}else{var bb=function(){a.readAsync(Q,ab,
|
||||||
b.status?(console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+b.status+", retrying "+Q),bb()):ab(c)};a.memoryInitializerRequest.response?setTimeout(cb,0):a.memoryInitializerRequest.addEventListener("load",cb)}else bb()}a.then=function(b){if(a.calledRun)b(a);else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();b(a)}}return a};aa.prototype=Error();aa.prototype.constructor=aa;var Ua=null;oa=function c(){a.calledRun||ya();a.calledRun||(oa=
|
function(){throw"could not load memory initializer "+Q;})};v("memory initializer");var ab=function(c){c.byteLength&&(c=new Uint8Array(c));O.set(c,m.GLOBAL_BASE);a.memoryInitializerRequest&&delete a.memoryInitializerRequest.response;Ia("memory initializer")};if(a.memoryInitializerRequest){var cb=function(){var c=a.memoryInitializerRequest,b=c.response;200!==c.status&&0!==c.status?(console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+c.status+", retrying "+
|
||||||
c)};a.run=ya;a.exit=function(c,d){if(!d||!a.noExitRuntime){if(!a.noExitRuntime&&(ja=!0,P=void 0,u(Za),a.onExit))a.onExit(c);la&&process.exit(c);a.quit(c,new aa(c))}};var Wa=[];a.abort=S;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ya();q.prototype=Object.create(q.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.WrapperObject=q;a.getCache=B;a.wrapPointer=T;a.castObject=function(a,d){return T(a.ptr,d)};a.NULL=
|
Q),bb()):ab(b)};a.memoryInitializerRequest.response?setTimeout(cb,0):a.memoryInitializerRequest.addEventListener("load",cb)}else bb()}a.then=function(c){if(a.calledRun)c(a);else{var b=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){b&&b();c(a)}}return a};aa.prototype=Error();aa.prototype.constructor=aa;var Ua=null;oa=function b(){a.calledRun||ya();a.calledRun||(oa=b)};a.run=ya;a.exit=function(b,d){if(!d||!a.noExitRuntime){if(!a.noExitRuntime&&(ja=!0,P=void 0,u(Za),a.onExit))a.onExit(b);la&&
|
||||||
T(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";a.__destroy__();delete B(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 k={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(k.needed){for(var c=0;c<k.temps.length;c++)a._free(k.temps[c]);k.temps.length=0;a._free(k.buffer);k.buffer=0;k.size+=k.needed;k.needed=0}k.buffer||
|
process.exit(b);a.quit(b,new aa(b))}};var Wa=[];a.abort=S;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ya();r.prototype=Object.create(r.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.WrapperObject=r;a.getCache=B;a.wrapPointer=T;a.castObject=function(a,d){return T(a.ptr,d)};a.NULL=T(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";a.__destroy__();
|
||||||
(k.size+=128,k.buffer=a._malloc(k.size),f(k.buffer));k.pos=0},alloc:function(c,d){f(k.buffer);c=c.length*d.BYTES_PER_ELEMENT;c=c+7&-8;k.pos+c>=k.size?(f(0<c),k.needed+=c,d=a._malloc(c),k.temps.push(d)):(d=k.buffer+k.pos,k.pos+=c);return d},copy:function(a,d,b){switch(d.BYTES_PER_ELEMENT){case 2:b>>=1;break;case 4:b>>=2;break;case 8:b>>=3}for(var c=0;c<a.length;c++)d[b+c]=a[c]}};A.prototype=Object.create(q.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.Status=A;A.prototype.code=
|
delete B(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 k={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(k.needed){for(var b=0;b<k.temps.length;b++)a._free(k.temps[b]);k.temps.length=0;a._free(k.buffer);k.buffer=0;k.size+=k.needed;k.needed=0}k.buffer||(k.size+=128,k.buffer=a._malloc(k.size),f(k.buffer));k.pos=0},alloc:function(b,d){f(k.buffer);b=b.length*d.BYTES_PER_ELEMENT;b=
|
||||||
A.prototype.code=function(){return Fc(this.ptr)};A.prototype.ok=A.prototype.ok=function(){return!!Hc(this.ptr)};A.prototype.error_msg=A.prototype.error_msg=function(){return n(Gc(this.ptr))};A.prototype.__destroy__=A.prototype.__destroy__=function(){Ec(this.ptr)};G.prototype=Object.create(q.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.PointCloud=G;G.prototype.num_attributes=G.prototype.num_attributes=function(){return Cc(this.ptr)};G.prototype.num_points=G.prototype.num_points=
|
b+7&-8;k.pos+b>=k.size?(f(0<b),k.needed+=b,d=a._malloc(b),k.temps.push(d)):(d=k.buffer+k.pos,k.pos+=b);return d},copy:function(a,d,c){switch(d.BYTES_PER_ELEMENT){case 2:c>>=1;break;case 4:c>>=2;break;case 8:c>>=3}for(var b=0;b<a.length;b++)d[c+b]=a[b]}};A.prototype=Object.create(r.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.Status=A;A.prototype.code=A.prototype.code=function(){return Ic(this.ptr)};A.prototype.ok=A.prototype.ok=function(){return!!Kc(this.ptr)};A.prototype.error_msg=
|
||||||
function(){return Dc(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){Bc(this.ptr)};H.prototype=Object.create(q.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.AttributeOctahedronTransform=H;H.prototype.InitFromAttribute=H.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!vb(c,a)};H.prototype.quantization_bits=H.prototype.quantization_bits=function(){return xb(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=
|
A.prototype.error_msg=function(){return n(Jc(this.ptr))};A.prototype.__destroy__=A.prototype.__destroy__=function(){Hc(this.ptr)};G.prototype=Object.create(r.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.PointCloud=G;G.prototype.num_attributes=G.prototype.num_attributes=function(){return Fc(this.ptr)};G.prototype.num_points=G.prototype.num_points=function(){return Gc(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){Ec(this.ptr)};H.prototype=Object.create(r.prototype);
|
||||||
function(){wb(this.ptr)};p.prototype=Object.create(q.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.PointAttribute=p;p.prototype.size=p.prototype.size=function(){return zc(this.ptr)};p.prototype.GetAttributeTransformData=p.prototype.GetAttributeTransformData=function(){return T(rc(this.ptr),K)};p.prototype.attribute_type=p.prototype.attribute_type=function(){return tc(this.ptr)};p.prototype.data_type=p.prototype.data_type=function(){return wc(this.ptr)};p.prototype.num_components=
|
H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.AttributeOctahedronTransform=H;H.prototype.InitFromAttribute=H.prototype.InitFromAttribute=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!vb(b,a)};H.prototype.quantization_bits=H.prototype.quantization_bits=function(){return xb(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){wb(this.ptr)};p.prototype=Object.create(r.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__=
|
||||||
p.prototype.num_components=function(){return yc(this.ptr)};p.prototype.normalized=p.prototype.normalized=function(){return!!xc(this.ptr)};p.prototype.byte_stride=p.prototype.byte_stride=function(){return vc(this.ptr)};p.prototype.byte_offset=p.prototype.byte_offset=function(){return uc(this.ptr)};p.prototype.unique_id=p.prototype.unique_id=function(){return Ac(this.ptr)};p.prototype.__destroy__=p.prototype.__destroy__=function(){sc(this.ptr)};K.prototype=Object.create(q.prototype);K.prototype.constructor=
|
{};a.PointAttribute=p;p.prototype.size=p.prototype.size=function(){return Cc(this.ptr)};p.prototype.GetAttributeTransformData=p.prototype.GetAttributeTransformData=function(){return T(uc(this.ptr),K)};p.prototype.attribute_type=p.prototype.attribute_type=function(){return wc(this.ptr)};p.prototype.data_type=p.prototype.data_type=function(){return zc(this.ptr)};p.prototype.num_components=p.prototype.num_components=function(){return Bc(this.ptr)};p.prototype.normalized=p.prototype.normalized=function(){return!!Ac(this.ptr)};
|
||||||
K;K.prototype.__class__=K;K.__cache__={};a.AttributeTransformData=K;K.prototype.transform_type=K.prototype.transform_type=function(){return Eb(this.ptr)};K.prototype.__destroy__=K.prototype.__destroy__=function(){Db(this.ptr)};y.prototype=Object.create(q.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.AttributeQuantizationTransform=y;y.prototype.InitFromAttribute=y.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!yb(c,a)};
|
p.prototype.byte_stride=p.prototype.byte_stride=function(){return yc(this.ptr)};p.prototype.byte_offset=p.prototype.byte_offset=function(){return xc(this.ptr)};p.prototype.unique_id=p.prototype.unique_id=function(){return Dc(this.ptr)};p.prototype.__destroy__=p.prototype.__destroy__=function(){vc(this.ptr)};K.prototype=Object.create(r.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.AttributeTransformData=K;K.prototype.transform_type=K.prototype.transform_type=function(){return Eb(this.ptr)};
|
||||||
y.prototype.quantization_bits=y.prototype.quantization_bits=function(){return Bb(this.ptr)};y.prototype.min_value=y.prototype.min_value=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Ab(c,a)};y.prototype.range=y.prototype.range=function(){return Cb(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){zb(this.ptr)};r.prototype=Object.create(q.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.MetadataQuerier=r;r.prototype.HasIntEntry=
|
K.prototype.__destroy__=K.prototype.__destroy__=function(){Db(this.ptr)};y.prototype=Object.create(r.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.AttributeQuantizationTransform=y;y.prototype.InitFromAttribute=y.prototype.InitFromAttribute=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!yb(b,a)};y.prototype.quantization_bits=y.prototype.quantization_bits=function(){return Bb(this.ptr)};y.prototype.min_value=y.prototype.min_value=function(a){var b=
|
||||||
r.prototype.HasIntEntry=function(a,d){var c=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return!!nc(c,a,d)};r.prototype.GetIntEntry=r.prototype.GetIntEntry=function(a,d){var c=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return kc(c,a,d)};r.prototype.HasDoubleEntry=r.prototype.HasDoubleEntry=function(a,d){var c=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return!!mc(c,
|
this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Ab(b,a)};y.prototype.range=y.prototype.range=function(){return Cb(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){zb(this.ptr)};q.prototype=Object.create(r.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.MetadataQuerier=q;q.prototype.HasEntry=q.prototype.HasEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!oc(b,a,d)};q.prototype.HasIntEntry=
|
||||||
a,d)};r.prototype.GetDoubleEntry=r.prototype.GetDoubleEntry=function(a,d){var c=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return jc(c,a,d)};r.prototype.HasStringEntry=r.prototype.HasStringEntry=function(a,d){var c=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return!!oc(c,a,d)};r.prototype.GetStringEntry=r.prototype.GetStringEntry=function(a,d){var c=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);
|
q.prototype.HasIntEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!pc(b,a,d)};q.prototype.GetIntEntry=q.prototype.GetIntEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return lc(b,a,d)};q.prototype.HasDoubleEntry=q.prototype.HasDoubleEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!nc(b,
|
||||||
d=d&&"object"===typeof d?d.ptr:X(d);return n(lc(c,a,d))};r.prototype.__destroy__=r.prototype.__destroy__=function(){pc(this.ptr)};I.prototype=Object.create(q.prototype);I.prototype.constructor=I;I.prototype.__class__=I;I.__cache__={};a.DracoFloat32Array=I;I.prototype.GetValue=I.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Zb(c,a)};I.prototype.size=I.prototype.size=function(){return ac(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){$b(this.ptr)};
|
a,d)};q.prototype.GetDoubleEntry=q.prototype.GetDoubleEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return jc(b,a,d)};q.prototype.HasStringEntry=q.prototype.HasStringEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return!!qc(b,a,d)};q.prototype.GetStringEntry=q.prototype.GetStringEntry=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);
|
||||||
U.prototype=Object.create(q.prototype);U.prototype.constructor=U;U.prototype.__class__=U;U.__cache__={};a.GeometryAttribute=U;U.prototype.__destroy__=U.prototype.__destroy__=function(){ec(this.ptr)};M.prototype=Object.create(q.prototype);M.prototype.constructor=M;M.prototype.__class__=M;M.__cache__={};a.DecoderBuffer=M;M.prototype.Init=M.prototype.Init=function(a,d){var c=this.ptr;k.prepare();if("object"==typeof a&&"object"===typeof a){var b=k.alloc(a,ba);k.copy(a,ba,b);a=b}d&&"object"===typeof d&&
|
d=d&&"object"===typeof d?d.ptr:U(d);return n(mc(b,a,d))};q.prototype.NumEntries=q.prototype.NumEntries=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return rc(b,a)};q.prototype.GetEntryName=q.prototype.GetEntryName=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return n(kc(b,a,d))};q.prototype.__destroy__=q.prototype.__destroy__=function(){sc(this.ptr)};I.prototype=Object.create(r.prototype);I.prototype.constructor=I;I.prototype.__class__=
|
||||||
(d=d.ptr);Fb(c,a,d)};M.prototype.__destroy__=M.prototype.__destroy__=function(){Gb(this.ptr)};h.prototype=Object.create(q.prototype);h.prototype.constructor=h;h.prototype.__class__=h;h.__cache__={};a.Decoder=h;h.prototype.GetEncodedGeometryType=h.prototype.GetEncodedGeometryType=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(c,a)};h.prototype.DecodeBufferToPointCloud=h.prototype.DecodeBufferToPointCloud=function(a,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===
|
I;I.__cache__={};a.DracoFloat32Array=I;I.prototype.GetValue=I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Zb(b,a)};I.prototype.size=I.prototype.size=function(){return ac(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){$b(this.ptr)};V.prototype=Object.create(r.prototype);V.prototype.constructor=V;V.prototype.__class__=V;V.__cache__={};a.GeometryAttribute=V;V.prototype.__destroy__=V.prototype.__destroy__=function(){ec(this.ptr)};M.prototype=
|
||||||
typeof d&&(d=d.ptr);return T(Ib(c,a,d),A)};h.prototype.DecodeBufferToMesh=h.prototype.DecodeBufferToMesh=function(a,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Hb(c,a,d),A)};h.prototype.GetAttributeId=h.prototype.GetAttributeId=function(a,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return Ob(c,a,d)};h.prototype.GetAttributeIdByName=h.prototype.GetAttributeIdByName=function(a,d){var c=this.ptr;k.prepare();
|
Object.create(r.prototype);M.prototype.constructor=M;M.prototype.__class__=M;M.__cache__={};a.DecoderBuffer=M;M.prototype.Init=M.prototype.Init=function(a,d){var b=this.ptr;k.prepare();if("object"==typeof a&&"object"===typeof a){var c=k.alloc(a,ba);k.copy(a,ba,c);a=c}d&&"object"===typeof d&&(d=d.ptr);Fb(b,a,d)};M.prototype.__destroy__=M.prototype.__destroy__=function(){Gb(this.ptr)};h.prototype=Object.create(r.prototype);h.prototype.constructor=h;h.prototype.__class__=h;h.__cache__={};a.Decoder=h;
|
||||||
a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);return Nb(c,a,d)};h.prototype.GetAttributeIdByMetadataEntry=h.prototype.GetAttributeIdByMetadataEntry=function(a,d,b){var c=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:X(d);b=b&&"object"===typeof b?b.ptr:X(b);return Mb(c,a,d,b)};h.prototype.GetAttribute=h.prototype.GetAttribute=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return T(Sb(c,
|
h.prototype.GetEncodedGeometryType=h.prototype.GetEncodedGeometryType=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(b,a)};h.prototype.DecodeBufferToPointCloud=h.prototype.DecodeBufferToPointCloud=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Ib(b,a,d),A)};h.prototype.DecodeBufferToMesh=h.prototype.DecodeBufferToMesh=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Hb(b,
|
||||||
a,b),p)};h.prototype.GetAttributeByUniqueId=h.prototype.GetAttributeByUniqueId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return T(Jb(c,a,b),p)};h.prototype.GetMetadata=h.prototype.GetMetadata=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return T(Vb(c,a),N)};h.prototype.GetAttributeMetadata=h.prototype.GetAttributeMetadata=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return T(Rb(c,
|
a,d),A)};h.prototype.GetAttributeId=h.prototype.GetAttributeId=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return Ob(b,a,d)};h.prototype.GetAttributeIdByName=h.prototype.GetAttributeIdByName=function(a,d){var b=this.ptr;k.prepare();a&&"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);return Nb(b,a,d)};h.prototype.GetAttributeIdByMetadataEntry=h.prototype.GetAttributeIdByMetadataEntry=function(a,d,c){var b=this.ptr;k.prepare();a&&
|
||||||
a,b),N)};h.prototype.GetFaceFromMesh=h.prototype.GetFaceFromMesh=function(a,b,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Ub(c,a,b,f)};h.prototype.GetTriangleStripsFromMesh=h.prototype.GetTriangleStripsFromMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return Wb(c,a,b)};h.prototype.GetAttributeFloat=h.prototype.GetAttributeFloat=function(a,b,f){var c=this.ptr;
|
"object"===typeof a&&(a=a.ptr);d=d&&"object"===typeof d?d.ptr:U(d);c=c&&"object"===typeof c?c.ptr:U(c);return Mb(b,a,d,c)};h.prototype.GetAttribute=h.prototype.GetAttribute=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Sb(b,a,d),p)};h.prototype.GetAttributeByUniqueId=h.prototype.GetAttributeByUniqueId=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Jb(b,a,d),p)};h.prototype.GetMetadata=
|
||||||
a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Lb(c,a,b,f)};h.prototype.GetAttributeFloatForAllPoints=h.prototype.GetAttributeFloatForAllPoints=function(a,b,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Kb(c,a,b,f)};h.prototype.GetAttributeIntForAllPoints=h.prototype.GetAttributeIntForAllPoints=function(a,b,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);
|
h.prototype.GetMetadata=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return T(Vb(b,a),N)};h.prototype.GetAttributeMetadata=h.prototype.GetAttributeMetadata=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return T(Rb(b,a,d),N)};h.prototype.GetFaceFromMesh=h.prototype.GetFaceFromMesh=function(a,d,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);c&&"object"===typeof c&&(c=c.ptr);return!!Ub(b,a,d,c)};
|
||||||
b&&"object"===typeof b&&(b=b.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Qb(c,a,b,f)};h.prototype.GetAttributeInt32ForAllPoints=h.prototype.GetAttributeInt32ForAllPoints=function(a,b,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Pb(c,a,b,f)};h.prototype.SkipAttributeTransform=h.prototype.SkipAttributeTransform=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Xb(c,a)};h.prototype.__destroy__=h.prototype.__destroy__=
|
h.prototype.GetTriangleStripsFromMesh=h.prototype.GetTriangleStripsFromMesh=function(a,d){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);return Wb(b,a,d)};h.prototype.GetAttributeFloat=h.prototype.GetAttributeFloat=function(a,d,c){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);d&&"object"===typeof d&&(d=d.ptr);c&&"object"===typeof c&&(c=c.ptr);return!!Lb(b,a,d,c)};h.prototype.GetAttributeFloatForAllPoints=h.prototype.GetAttributeFloatForAllPoints=function(a,c,
|
||||||
function(){Yb(this.ptr)};C.prototype=Object.create(q.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.Mesh=C;C.prototype.num_faces=C.prototype.num_faces=function(){return hc(this.ptr)};C.prototype.num_attributes=C.prototype.num_attributes=function(){return gc(this.ptr)};C.prototype.num_points=C.prototype.num_points=function(){return ic(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){fc(this.ptr)};Y.prototype=Object.create(q.prototype);Y.prototype.constructor=
|
f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Kb(b,a,c,f)};h.prototype.GetAttributeIntForAllPoints=h.prototype.GetAttributeIntForAllPoints=function(a,c,f){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Qb(b,a,c,f)};h.prototype.GetAttributeInt32ForAllPoints=h.prototype.GetAttributeInt32ForAllPoints=function(a,c,f){var b=this.ptr;a&&"object"===
|
||||||
Y;Y.prototype.__class__=Y;Y.__cache__={};a.VoidPtr=Y;Y.prototype.__destroy__=Y.prototype.__destroy__=function(){Ic(this.ptr)};J.prototype=Object.create(q.prototype);J.prototype.constructor=J;J.prototype.__class__=J;J.__cache__={};a.DracoInt32Array=J;J.prototype.GetValue=J.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return bc(b,a)};J.prototype.size=J.prototype.size=function(){return dc(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){cc(this.ptr)};
|
typeof a&&(a=a.ptr);c&&"object"===typeof c&&(c=c.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Pb(b,a,c,f)};h.prototype.SkipAttributeTransform=h.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Xb(b,a)};h.prototype.__destroy__=h.prototype.__destroy__=function(){Yb(this.ptr)};C.prototype=Object.create(r.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.Mesh=C;C.prototype.num_faces=C.prototype.num_faces=function(){return hc(this.ptr)};
|
||||||
N.prototype=Object.create(q.prototype);N.prototype.constructor=N;N.prototype.__class__=N;N.__cache__={};a.Metadata=N;N.prototype.__destroy__=N.prototype.__destroy__=function(){qc(this.ptr)};(function(){function b(){a.OK=Zc();a.ERROR=Wc();a.IO_ERROR=Yc();a.INVALID_PARAMETER=Xc();a.UNSUPPORTED_VERSION=ad();a.UNKNOWN_VERSION=$c();a.INVALID_GEOMETRY_TYPE=Nc();a.POINT_CLOUD=Oc();a.TRIANGULAR_MESH=Pc();a.ATTRIBUTE_INVALID_TRANSFORM=Jc();a.ATTRIBUTE_NO_TRANSFORM=Kc();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=Mc();
|
C.prototype.num_attributes=C.prototype.num_attributes=function(){return gc(this.ptr)};C.prototype.num_points=C.prototype.num_points=function(){return ic(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){fc(this.ptr)};Y.prototype=Object.create(r.prototype);Y.prototype.constructor=Y;Y.prototype.__class__=Y;Y.__cache__={};a.VoidPtr=Y;Y.prototype.__destroy__=Y.prototype.__destroy__=function(){Lc(this.ptr)};J.prototype=Object.create(r.prototype);J.prototype.constructor=J;J.prototype.__class__=
|
||||||
a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Lc();a.INVALID=Sc();a.POSITION=Uc();a.NORMAL=Tc();a.COLOR=Qc();a.TEX_COORD=Vc();a.GENERIC=Rc()}a.calledRun?b():Sa.unshift(b)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return b};"object"===typeof module&&module.exports&&(module.exports=DracoDecoderModule);
|
J;J.__cache__={};a.DracoInt32Array=J;J.prototype.GetValue=J.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return bc(b,a)};J.prototype.size=J.prototype.size=function(){return dc(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){cc(this.ptr)};N.prototype=Object.create(r.prototype);N.prototype.constructor=N;N.prototype.__class__=N;N.__cache__={};a.Metadata=N;N.prototype.__destroy__=N.prototype.__destroy__=function(){tc(this.ptr)};(function(){function b(){a.OK=
|
||||||
|
bd();a.ERROR=Zc();a.IO_ERROR=ad();a.INVALID_PARAMETER=$c();a.UNSUPPORTED_VERSION=dd();a.UNKNOWN_VERSION=cd();a.INVALID_GEOMETRY_TYPE=Qc();a.POINT_CLOUD=Rc();a.TRIANGULAR_MESH=Sc();a.ATTRIBUTE_INVALID_TRANSFORM=Mc();a.ATTRIBUTE_NO_TRANSFORM=Nc();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=Pc();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=Oc();a.INVALID=Vc();a.POSITION=Xc();a.NORMAL=Wc();a.COLOR=Tc();a.TEX_COORD=Yc();a.GENERIC=Uc()}a.calledRun?b():Sa.unshift(b)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();
|
||||||
|
return c};"object"===typeof module&&module.exports&&(module.exports=DracoDecoderModule);
|
||||||
|
@ -24,27 +24,27 @@
|
|||||||
namespace draco {
|
namespace draco {
|
||||||
|
|
||||||
// Index of an attribute value entry stored in a GeometryAttribute.
|
// Index of an attribute value entry stored in a GeometryAttribute.
|
||||||
DEFINE_NEW_DRACO_INDEX_TYPE(int32_t, AttributeValueIndex)
|
DEFINE_NEW_DRACO_INDEX_TYPE(uint32_t, AttributeValueIndex)
|
||||||
// Index of a point in a PointCloud.
|
// Index of a point in a PointCloud.
|
||||||
DEFINE_NEW_DRACO_INDEX_TYPE(int32_t, PointIndex)
|
DEFINE_NEW_DRACO_INDEX_TYPE(uint32_t, PointIndex)
|
||||||
// Vertex index in a Mesh or CornerTable.
|
// Vertex index in a Mesh or CornerTable.
|
||||||
DEFINE_NEW_DRACO_INDEX_TYPE(int32_t, VertexIndex);
|
DEFINE_NEW_DRACO_INDEX_TYPE(uint32_t, VertexIndex);
|
||||||
// Corner index that identifies a corner in a Mesh or CornerTable.
|
// Corner index that identifies a corner in a Mesh or CornerTable.
|
||||||
DEFINE_NEW_DRACO_INDEX_TYPE(int32_t, CornerIndex);
|
DEFINE_NEW_DRACO_INDEX_TYPE(uint32_t, CornerIndex);
|
||||||
// Face index for Mesh and CornerTable.
|
// Face index for Mesh and CornerTable.
|
||||||
DEFINE_NEW_DRACO_INDEX_TYPE(int32_t, FaceIndex);
|
DEFINE_NEW_DRACO_INDEX_TYPE(uint32_t, FaceIndex);
|
||||||
|
|
||||||
// Constants denoting invalid indices.
|
// Constants denoting invalid indices.
|
||||||
static constexpr AttributeValueIndex kInvalidAttributeValueIndex(
|
static constexpr AttributeValueIndex kInvalidAttributeValueIndex(
|
||||||
std::numeric_limits<int32_t>::min() / 2);
|
std::numeric_limits<uint32_t>::max());
|
||||||
static constexpr PointIndex kInvalidPointIndex(
|
static constexpr PointIndex kInvalidPointIndex(
|
||||||
std::numeric_limits<int32_t>::min() / 2);
|
std::numeric_limits<uint32_t>::max());
|
||||||
static constexpr VertexIndex kInvalidVertexIndex(
|
static constexpr VertexIndex kInvalidVertexIndex(
|
||||||
std::numeric_limits<int32_t>::min() / 2);
|
std::numeric_limits<uint32_t>::max());
|
||||||
static constexpr CornerIndex kInvalidCornerIndex(
|
static constexpr CornerIndex kInvalidCornerIndex(
|
||||||
std::numeric_limits<int32_t>::min() / 2);
|
std::numeric_limits<uint32_t>::max());
|
||||||
static constexpr FaceIndex kInvalidFaceIndex(
|
static constexpr FaceIndex kInvalidFaceIndex(
|
||||||
std::numeric_limits<int32_t>::min() / 2);
|
std::numeric_limits<uint32_t>::max());
|
||||||
|
|
||||||
} // namespace draco
|
} // namespace draco
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class MeshAttributeIndicesEncodingObserver {
|
|||||||
|
|
||||||
void OnNewFaceVisited(FaceIndex /* face */) {}
|
void OnNewFaceVisited(FaceIndex /* face */) {}
|
||||||
|
|
||||||
void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
|
inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
|
||||||
const PointIndex point_id =
|
const PointIndex point_id =
|
||||||
mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
|
mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
|
||||||
// Append the visited attribute to the encoding order.
|
// Append the visited attribute to the encoding order.
|
||||||
|
@ -111,7 +111,7 @@ bool MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
|
|||||||
CornerIndex corner_id(start_corner_id);
|
CornerIndex corner_id(start_corner_id);
|
||||||
int num_parallelograms = 0;
|
int num_parallelograms = 0;
|
||||||
bool first_pass = true;
|
bool first_pass = true;
|
||||||
while (corner_id >= 0) {
|
while (corner_id != kInvalidCornerIndex) {
|
||||||
if (ComputeParallelogramPrediction(
|
if (ComputeParallelogramPrediction(
|
||||||
p, corner_id, table, *vertex_to_data_map, out_data,
|
p, corner_id, table, *vertex_to_data_map, out_data,
|
||||||
num_components, &(pred_vals[num_parallelograms][0]))) {
|
num_components, &(pred_vals[num_parallelograms][0]))) {
|
||||||
@ -134,7 +134,7 @@ bool MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
|
|||||||
if (corner_id == start_corner_id) {
|
if (corner_id == start_corner_id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (corner_id < 0 && first_pass) {
|
if (corner_id == kInvalidCornerIndex && first_pass) {
|
||||||
first_pass = false;
|
first_pass = false;
|
||||||
corner_id = table->SwingRight(start_corner_id);
|
corner_id = table->SwingRight(start_corner_id);
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,9 @@ namespace draco {
|
|||||||
// our current implementation limits the maximum number of used parallelograms
|
// our current implementation limits the maximum number of used parallelograms
|
||||||
// to four, which covers >95% of the cases (on average, there are only two
|
// to four, which covers >95% of the cases (on average, there are only two
|
||||||
// parallelograms available for any given vertex).
|
// parallelograms available for any given vertex).
|
||||||
|
// All bits of the explicitly chosen configuration are stored together in a
|
||||||
|
// single context chosen by the total number of parallelograms available to
|
||||||
|
// choose from.
|
||||||
template <typename DataTypeT, class TransformT, class MeshDataT>
|
template <typename DataTypeT, class TransformT, class MeshDataT>
|
||||||
class MeshPredictionSchemeConstrainedMultiParallelogramEncoder
|
class MeshPredictionSchemeConstrainedMultiParallelogramEncoder
|
||||||
: public MeshPredictionSchemeEncoder<DataTypeT, TransformT, MeshDataT> {
|
: public MeshPredictionSchemeEncoder<DataTypeT, TransformT, MeshDataT> {
|
||||||
@ -132,7 +135,7 @@ bool MeshPredictionSchemeConstrainedMultiParallelogramEncoder<
|
|||||||
CornerIndex corner_id(start_corner_id);
|
CornerIndex corner_id(start_corner_id);
|
||||||
int num_parallelograms = 0;
|
int num_parallelograms = 0;
|
||||||
bool first_pass = true;
|
bool first_pass = true;
|
||||||
while (corner_id >= 0) {
|
while (corner_id != kInvalidCornerIndex) {
|
||||||
if (ComputeParallelogramPrediction(
|
if (ComputeParallelogramPrediction(
|
||||||
p, corner_id, table, *vertex_to_data_map, in_data, num_components,
|
p, corner_id, table, *vertex_to_data_map, in_data, num_components,
|
||||||
&(pred_vals[num_parallelograms][0]))) {
|
&(pred_vals[num_parallelograms][0]))) {
|
||||||
@ -155,7 +158,7 @@ bool MeshPredictionSchemeConstrainedMultiParallelogramEncoder<
|
|||||||
if (corner_id == start_corner_id) {
|
if (corner_id == start_corner_id) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (corner_id < 0 && first_pass) {
|
if (corner_id == kInvalidCornerIndex && first_pass) {
|
||||||
first_pass = false;
|
first_pass = false;
|
||||||
corner_id = table->SwingRight(start_corner_id);
|
corner_id = table->SwingRight(start_corner_id);
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ bool MeshPredictionSchemeMultiParallelogramDecoder<DataTypeT, TransformT,
|
|||||||
for (int i = 0; i < num_components; ++i) {
|
for (int i = 0; i < num_components; ++i) {
|
||||||
pred_vals[i] = static_cast<DataTypeT>(0);
|
pred_vals[i] = static_cast<DataTypeT>(0);
|
||||||
}
|
}
|
||||||
while (corner_id >= 0) {
|
while (corner_id != kInvalidCornerIndex) {
|
||||||
if (ComputeParallelogramPrediction(
|
if (ComputeParallelogramPrediction(
|
||||||
p, corner_id, table, *vertex_to_data_map, out_data,
|
p, corner_id, table, *vertex_to_data_map, out_data,
|
||||||
num_components, parallelogram_pred_vals.get())) {
|
num_components, parallelogram_pred_vals.get())) {
|
||||||
|
@ -85,7 +85,7 @@ bool MeshPredictionSchemeMultiParallelogramEncoder<DataTypeT, TransformT,
|
|||||||
for (int i = 0; i < num_components; ++i) {
|
for (int i = 0; i < num_components; ++i) {
|
||||||
pred_vals[i] = static_cast<DataTypeT>(0);
|
pred_vals[i] = static_cast<DataTypeT>(0);
|
||||||
}
|
}
|
||||||
while (corner_id >= 0) {
|
while (corner_id != kInvalidCornerIndex) {
|
||||||
if (ComputeParallelogramPrediction(
|
if (ComputeParallelogramPrediction(
|
||||||
p, corner_id, table, *vertex_to_data_map, in_data, num_components,
|
p, corner_id, table, *vertex_to_data_map, in_data, num_components,
|
||||||
parallelogram_pred_vals.get())) {
|
parallelogram_pred_vals.get())) {
|
||||||
|
@ -47,7 +47,7 @@ inline bool ComputeParallelogramPrediction(
|
|||||||
const std::vector<int32_t> &vertex_to_data_map, const DataTypeT *in_data,
|
const std::vector<int32_t> &vertex_to_data_map, const DataTypeT *in_data,
|
||||||
int num_components, DataTypeT *out_prediction) {
|
int num_components, DataTypeT *out_prediction) {
|
||||||
const CornerIndex oci = table->Opposite(ci);
|
const CornerIndex oci = table->Opposite(ci);
|
||||||
if (oci < 0)
|
if (oci == kInvalidCornerIndex)
|
||||||
return false;
|
return false;
|
||||||
int vert_opp, vert_next, vert_prev;
|
int vert_opp, vert_next, vert_prev;
|
||||||
GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
|
GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
|
||||||
|
@ -53,7 +53,7 @@ class MeshPredictionSchemeTexCoordsDecoder
|
|||||||
bool DecodePredictionData(DecoderBuffer *buffer) override;
|
bool DecodePredictionData(DecoderBuffer *buffer) override;
|
||||||
|
|
||||||
PredictionSchemeMethod GetPredictionMethod() const override {
|
PredictionSchemeMethod GetPredictionMethod() const override {
|
||||||
return MESH_PREDICTION_TEX_COORDS;
|
return MESH_PREDICTION_TEX_COORDS_DEPRECATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsInitialized() const override {
|
bool IsInitialized() const override {
|
||||||
|
@ -51,7 +51,7 @@ class MeshPredictionSchemeTexCoordsEncoder
|
|||||||
bool EncodePredictionData(EncoderBuffer *buffer) override;
|
bool EncodePredictionData(EncoderBuffer *buffer) override;
|
||||||
|
|
||||||
PredictionSchemeMethod GetPredictionMethod() const override {
|
PredictionSchemeMethod GetPredictionMethod() const override {
|
||||||
return MESH_PREDICTION_TEX_COORDS;
|
return MESH_PREDICTION_TEX_COORDS_DEPRECATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsInitialized() const override {
|
bool IsInitialized() const override {
|
||||||
|
@ -134,7 +134,7 @@ void MeshPredictionSchemeTexCoordsPortablePredictor<
|
|||||||
// position of predicted coordinate (C).
|
// position of predicted coordinate (C).
|
||||||
//
|
//
|
||||||
const VectorD<int64_t, 3> pn = prev_pos - next_pos;
|
const VectorD<int64_t, 3> pn = prev_pos - next_pos;
|
||||||
const int64_t pn_norm2_squared = pn.SquaredNorm();
|
const uint64_t pn_norm2_squared = pn.SquaredNorm();
|
||||||
if (pn_norm2_squared != 0) {
|
if (pn_norm2_squared != 0) {
|
||||||
// Compute the projection of C onto PN by computing dot product of CN with
|
// Compute the projection of C onto PN by computing dot product of CN with
|
||||||
// PN and normalizing it by length of PN. This gives us a factor |s| where
|
// PN and normalizing it by length of PN. This gives us a factor |s| where
|
||||||
@ -157,7 +157,7 @@ void MeshPredictionSchemeTexCoordsPortablePredictor<
|
|||||||
// Compute squared length of vector CX in position coordinate system:
|
// Compute squared length of vector CX in position coordinate system:
|
||||||
const VectorD<int64_t, 3> x_pos =
|
const VectorD<int64_t, 3> x_pos =
|
||||||
next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
|
next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
|
||||||
const int64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
|
const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
|
||||||
|
|
||||||
// Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
|
// Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
|
||||||
// degrees and scaling it with factor CX.Norm2() / PN.Norm2():
|
// degrees and scaling it with factor CX.Norm2() / PN.Norm2():
|
||||||
@ -175,9 +175,10 @@ void MeshPredictionSchemeTexCoordsPortablePredictor<
|
|||||||
//
|
//
|
||||||
VectorD<int64_t, 2> cx_uv(pn_uv[1], -pn_uv[0]); // Rotated PN_UV.
|
VectorD<int64_t, 2> cx_uv(pn_uv[1], -pn_uv[0]); // Rotated PN_UV.
|
||||||
// Compute CX.Norm2() * PN.Norm2()
|
// Compute CX.Norm2() * PN.Norm2()
|
||||||
const int64_t norm_squared = IntSqrt(cx_norm2_squared * pn_norm2_squared);
|
const uint64_t norm_squared =
|
||||||
|
IntSqrt(cx_norm2_squared * pn_norm2_squared);
|
||||||
// Final cx_uv in the scaled coordinate space.
|
// Final cx_uv in the scaled coordinate space.
|
||||||
cx_uv = norm_squared * cx_uv;
|
cx_uv = cx_uv * norm_squared;
|
||||||
|
|
||||||
// Predicted uv coordinate is then computed by either adding or
|
// Predicted uv coordinate is then computed by either adding or
|
||||||
// subtracting CX_UV to/from X_UV.
|
// subtracting CX_UV to/from X_UV.
|
||||||
|
@ -68,7 +68,7 @@ struct MeshPredictionSchemeDecoderFactory {
|
|||||||
mesh_data));
|
mesh_data));
|
||||||
}
|
}
|
||||||
#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
|
#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
|
||||||
else if (method == MESH_PREDICTION_TEX_COORDS) {
|
else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
|
||||||
return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
|
return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
|
||||||
new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
|
new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
|
||||||
MeshDataT>(
|
MeshDataT>(
|
||||||
|
@ -59,7 +59,7 @@ struct MeshPredictionSchemeEncoderFactory {
|
|||||||
new MeshPredictionSchemeConstrainedMultiParallelogramEncoder<
|
new MeshPredictionSchemeConstrainedMultiParallelogramEncoder<
|
||||||
DataTypeT, TransformT, MeshDataT>(attribute, transform,
|
DataTypeT, TransformT, MeshDataT>(attribute, transform,
|
||||||
mesh_data));
|
mesh_data));
|
||||||
} else if (method == MESH_PREDICTION_TEX_COORDS) {
|
} else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
|
||||||
return std::unique_ptr<PredictionSchemeEncoder<DataTypeT, TransformT>>(
|
return std::unique_ptr<PredictionSchemeEncoder<DataTypeT, TransformT>>(
|
||||||
new MeshPredictionSchemeTexCoordsEncoder<DataTypeT, TransformT,
|
new MeshPredictionSchemeTexCoordsEncoder<DataTypeT, TransformT,
|
||||||
MeshDataT>(
|
MeshDataT>(
|
||||||
|
@ -42,7 +42,7 @@ std::unique_ptr<PredictionSchemeT> CreateMeshPredictionScheme(
|
|||||||
method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
|
method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
|
||||||
method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
|
method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
|
||||||
method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
|
method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
|
||||||
method == MESH_PREDICTION_TEX_COORDS)) {
|
method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
|
||||||
const CornerTable *const ct = source->GetCornerTable();
|
const CornerTable *const ct = source->GetCornerTable();
|
||||||
const MeshAttributeIndicesEncodingData *const encoding_data =
|
const MeshAttributeIndicesEncodingData *const encoding_data =
|
||||||
source->GetAttributeEncodingData(att_id);
|
source->GetAttributeEncodingData(att_id);
|
||||||
|
@ -56,7 +56,8 @@ class PredictionSchemeWrapDecodingTransform
|
|||||||
return false;
|
return false;
|
||||||
this->set_min_value(min_value);
|
this->set_min_value(min_value);
|
||||||
this->set_max_value(max_value);
|
this->set_max_value(max_value);
|
||||||
this->InitCorrectionBounds();
|
if (!this->InitCorrectionBounds())
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -78,12 +78,17 @@ class PredictionSchemeWrapTransformBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InitCorrectionBounds() {
|
bool InitCorrectionBounds() {
|
||||||
max_dif_ = 1 + max_value_ - min_value_;
|
const int64_t dif =
|
||||||
|
static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
|
||||||
|
if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max())
|
||||||
|
return false;
|
||||||
|
max_dif_ = 1 + static_cast<DataTypeT>(dif);
|
||||||
max_correction_ = max_dif_ / 2;
|
max_correction_ = max_dif_ / 2;
|
||||||
min_correction_ = -max_correction_;
|
min_correction_ = -max_correction_;
|
||||||
if ((max_dif_ & 1) == 0)
|
if ((max_dif_ & 1) == 0)
|
||||||
max_correction_ -= 1;
|
max_correction_ -= 1;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int num_components() const { return num_components_; }
|
inline int num_components() const { return num_components_; }
|
||||||
|
@ -146,9 +146,14 @@ bool SequentialIntegerAttributeEncoder::EncodeValues(
|
|||||||
if (encoder() == nullptr || encoder()->options()->GetGlobalBool(
|
if (encoder() == nullptr || encoder()->options()->GetGlobalBool(
|
||||||
"use_built_in_attribute_compression", true)) {
|
"use_built_in_attribute_compression", true)) {
|
||||||
out_buffer->Encode(static_cast<uint8_t>(1));
|
out_buffer->Encode(static_cast<uint8_t>(1));
|
||||||
|
Options symbol_encoding_options;
|
||||||
|
if (encoder() != nullptr) {
|
||||||
|
SetSymbolEncodingCompressionLevel(&symbol_encoding_options,
|
||||||
|
10 - encoder()->options()->GetSpeed());
|
||||||
|
}
|
||||||
if (!EncodeSymbols(reinterpret_cast<uint32_t *>(encoded_data.data()),
|
if (!EncodeSymbols(reinterpret_cast<uint32_t *>(encoded_data.data()),
|
||||||
point_ids.size() * num_components, num_components,
|
point_ids.size() * num_components, num_components,
|
||||||
out_buffer)) {
|
&symbol_encoding_options, out_buffer)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,7 +80,7 @@ enum PredictionSchemeMethod {
|
|||||||
PREDICTION_DIFFERENCE = 0,
|
PREDICTION_DIFFERENCE = 0,
|
||||||
MESH_PREDICTION_PARALLELOGRAM = 1,
|
MESH_PREDICTION_PARALLELOGRAM = 1,
|
||||||
MESH_PREDICTION_MULTI_PARALLELOGRAM = 2,
|
MESH_PREDICTION_MULTI_PARALLELOGRAM = 2,
|
||||||
MESH_PREDICTION_TEX_COORDS = 3,
|
MESH_PREDICTION_TEX_COORDS_DEPRECATED = 3,
|
||||||
MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM = 4,
|
MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM = 4,
|
||||||
MESH_PREDICTION_TEX_COORDS_PORTABLE = 5,
|
MESH_PREDICTION_TEX_COORDS_PORTABLE = 5,
|
||||||
MESH_PREDICTION_GEOMETRIC_NORMAL = 6,
|
MESH_PREDICTION_GEOMETRIC_NORMAL = 6,
|
||||||
@ -134,6 +134,13 @@ enum NormalPredictionMode {
|
|||||||
TRIANGLE_AREA = 1,
|
TRIANGLE_AREA = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Different methods used for symbol entropy encoding.
|
||||||
|
enum SymbolCodingMethod {
|
||||||
|
SYMBOL_CODING_TAGGED = 0,
|
||||||
|
SYMBOL_CODING_RAW = 1,
|
||||||
|
NUM_SYMBOL_CODING_METHODS,
|
||||||
|
};
|
||||||
|
|
||||||
// Mask for setting and getting the bit for metadata in |flags| of header.
|
// Mask for setting and getting the bit for metadata in |flags| of header.
|
||||||
#define METADATA_FLAG_MASK 0x8000
|
#define METADATA_FLAG_MASK 0x8000
|
||||||
|
|
||||||
|
@ -79,10 +79,14 @@ void Encoder::SetEncodingMethod(int encoding_method) {
|
|||||||
Base::SetEncodingMethod(encoding_method);
|
Base::SetEncodingMethod(encoding_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Encoder::SetAttributePredictionScheme(GeometryAttribute::Type type,
|
Status Encoder::SetAttributePredictionScheme(GeometryAttribute::Type type,
|
||||||
int prediction_scheme_method) {
|
int prediction_scheme_method) {
|
||||||
|
Status status = CheckPredictionScheme(type, prediction_scheme_method);
|
||||||
|
if (!status.ok())
|
||||||
|
return status;
|
||||||
options().SetAttributeInt(type, "prediction_scheme",
|
options().SetAttributeInt(type, "prediction_scheme",
|
||||||
prediction_scheme_method);
|
prediction_scheme_method);
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace draco
|
} // namespace draco
|
||||||
|
@ -105,8 +105,8 @@ class Encoder
|
|||||||
//
|
//
|
||||||
// Note that in case the desired prediction cannot be used, the default
|
// Note that in case the desired prediction cannot be used, the default
|
||||||
// prediction will be automatically used instead.
|
// prediction will be automatically used instead.
|
||||||
void SetAttributePredictionScheme(GeometryAttribute::Type type,
|
Status SetAttributePredictionScheme(GeometryAttribute::Type type,
|
||||||
int prediction_scheme_method);
|
int prediction_scheme_method);
|
||||||
|
|
||||||
// Sets the desired encoding method for a given geometry. By default, encoding
|
// Sets the desired encoding method for a given geometry. By default, encoding
|
||||||
// method is selected based on the properties of the input geometry and based
|
// method is selected based on the properties of the input geometry and based
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
#ifndef DRACO_SRC_DRACO_COMPRESSION_ENCODE_BASE_H_
|
#ifndef DRACO_SRC_DRACO_COMPRESSION_ENCODE_BASE_H_
|
||||||
#define DRACO_SRC_DRACO_COMPRESSION_ENCODE_BASE_H_
|
#define DRACO_SRC_DRACO_COMPRESSION_ENCODE_BASE_H_
|
||||||
|
|
||||||
|
#include "draco/attributes/geometry_attribute.h"
|
||||||
|
#include "draco/compression/config/compression_shared.h"
|
||||||
|
#include "draco/core/status.h"
|
||||||
|
|
||||||
namespace draco {
|
namespace draco {
|
||||||
|
|
||||||
// Base class for our geometry encoder classes. |EncoderOptionsT| specifies
|
// Base class for our geometry encoder classes. |EncoderOptionsT| specifies
|
||||||
@ -43,6 +47,28 @@ class EncoderBase {
|
|||||||
options_.SetGlobalInt("encoding_method", encoding_method);
|
options_.SetGlobalInt("encoding_method", encoding_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status CheckPredictionScheme(GeometryAttribute::Type att_type,
|
||||||
|
int prediction_scheme) {
|
||||||
|
if (prediction_scheme < 0)
|
||||||
|
return Status(Status::ERROR, "Invalid prediction scheme requested.");
|
||||||
|
if (prediction_scheme >= NUM_PREDICTION_SCHEMES)
|
||||||
|
return Status(Status::ERROR, "Invalid prediction scheme requested.");
|
||||||
|
if (prediction_scheme == MESH_PREDICTION_TEX_COORDS_DEPRECATED)
|
||||||
|
return Status(Status::ERROR,
|
||||||
|
"MESH_PREDICTION_TEX_COORDS_DEPRECATED is deprecated.");
|
||||||
|
if (prediction_scheme == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
|
||||||
|
if (att_type != GeometryAttribute::TEX_COORD)
|
||||||
|
return Status(Status::ERROR,
|
||||||
|
"Invalid prediction scheme for attribute type.");
|
||||||
|
}
|
||||||
|
if (prediction_scheme == MESH_PREDICTION_GEOMETRIC_NORMAL) {
|
||||||
|
if (att_type != GeometryAttribute::NORMAL)
|
||||||
|
return Status(Status::ERROR,
|
||||||
|
"Invalid prediction scheme for attribute type.");
|
||||||
|
}
|
||||||
|
return Status();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EncoderOptionsT options_;
|
EncoderOptionsT options_;
|
||||||
};
|
};
|
||||||
|
@ -147,10 +147,16 @@ void ExpertEncoder::SetEncodingMethod(int encoding_method) {
|
|||||||
Base::SetEncodingMethod(encoding_method);
|
Base::SetEncodingMethod(encoding_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExpertEncoder::SetAttributePredictionScheme(int32_t attribute_id,
|
Status ExpertEncoder::SetAttributePredictionScheme(
|
||||||
int prediction_scheme_method) {
|
int32_t attribute_id, int prediction_scheme_method) {
|
||||||
|
auto att = point_cloud_->GetAttributeByUniqueId(attribute_id);
|
||||||
|
auto att_type = att->attribute_type();
|
||||||
|
Status status = CheckPredictionScheme(att_type, prediction_scheme_method);
|
||||||
|
if (!status.ok())
|
||||||
|
return status;
|
||||||
options().SetAttributeInt(attribute_id, "prediction_scheme",
|
options().SetAttributeInt(attribute_id, "prediction_scheme",
|
||||||
prediction_scheme_method);
|
prediction_scheme_method);
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace draco
|
} // namespace draco
|
||||||
|
@ -122,8 +122,8 @@ class ExpertEncoder : public EncoderBase<EncoderOptions> {
|
|||||||
//
|
//
|
||||||
// Note that in case the desired prediction cannot be used, the default
|
// Note that in case the desired prediction cannot be used, the default
|
||||||
// prediction will be automatically used instead.
|
// prediction will be automatically used instead.
|
||||||
void SetAttributePredictionScheme(int32_t attribute_id,
|
Status SetAttributePredictionScheme(int32_t attribute_id,
|
||||||
int prediction_scheme_method);
|
int prediction_scheme_method);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Status EncodePointCloudToBuffer(const PointCloud &pc,
|
Status EncodePointCloudToBuffer(const PointCloud &pc,
|
||||||
|
@ -621,7 +621,7 @@ int MeshEdgeBreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity(
|
|||||||
|
|
||||||
// Also update the vertex id at corner "n" and all corners that are
|
// Also update the vertex id at corner "n" and all corners that are
|
||||||
// connected to it in the CCW direction.
|
// connected to it in the CCW direction.
|
||||||
while (corner_n >= 0) {
|
while (corner_n != kInvalidCornerIndex) {
|
||||||
corner_table_->MapCornerToVertex(corner_n, vertex_p);
|
corner_table_->MapCornerToVertex(corner_n, vertex_p);
|
||||||
corner_n = corner_table_->SwingLeft(corner_n);
|
corner_n = corner_table_->SwingLeft(corner_n);
|
||||||
}
|
}
|
||||||
@ -781,7 +781,7 @@ int MeshEdgeBreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity(
|
|||||||
for (const VertexIndex invalid_vert : invalid_vertices) {
|
for (const VertexIndex invalid_vert : invalid_vertices) {
|
||||||
// Find the last valid vertex and swap it with the isolated vertex.
|
// Find the last valid vertex and swap it with the isolated vertex.
|
||||||
VertexIndex src_vert(num_vertices - 1);
|
VertexIndex src_vert(num_vertices - 1);
|
||||||
while (corner_table_->LeftMostCorner(src_vert) < 0) {
|
while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
|
||||||
// The last vertex is invalid, proceed to the previous one.
|
// The last vertex is invalid, proceed to the previous one.
|
||||||
src_vert = VertexIndex(--num_vertices - 1);
|
src_vert = VertexIndex(--num_vertices - 1);
|
||||||
}
|
}
|
||||||
@ -922,7 +922,7 @@ bool MeshEdgeBreakerDecoderImpl<TraversalDecoder>::
|
|||||||
|
|
||||||
for (int c = 0; c < 3; ++c) {
|
for (int c = 0; c < 3; ++c) {
|
||||||
const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
|
const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
|
||||||
if (opp_corner < 0) {
|
if (opp_corner == kInvalidCornerIndex) {
|
||||||
// Don't decode attribute seams on boundary edges (every boundary edge
|
// Don't decode attribute seams on boundary edges (every boundary edge
|
||||||
// is automatically an attribute seam).
|
// is automatically an attribute seam).
|
||||||
for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
|
for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
|
||||||
@ -951,7 +951,7 @@ bool MeshEdgeBreakerDecoderImpl<
|
|||||||
const FaceIndex src_face_id = corner_table_->Face(corner);
|
const FaceIndex src_face_id = corner_table_->Face(corner);
|
||||||
for (int c = 0; c < 3; ++c) {
|
for (int c = 0; c < 3; ++c) {
|
||||||
const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
|
const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
|
||||||
if (opp_corner < 0) {
|
if (opp_corner == kInvalidCornerIndex) {
|
||||||
// Don't decode attribute seams on boundary edges (every boundary edge
|
// Don't decode attribute seams on boundary edges (every boundary edge
|
||||||
// is automatically an attribute seam).
|
// is automatically an attribute seam).
|
||||||
for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
|
for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
|
||||||
@ -1007,7 +1007,7 @@ bool MeshEdgeBreakerDecoderImpl<TraversalDecoder>::AssignPointsToCorners(
|
|||||||
std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
|
std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
|
||||||
for (int v = 0; v < corner_table_->num_vertices(); ++v) {
|
for (int v = 0; v < corner_table_->num_vertices(); ++v) {
|
||||||
CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
|
CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
|
||||||
if (c < 0)
|
if (c == kInvalidCornerIndex)
|
||||||
continue; // Isolated vertex.
|
continue; // Isolated vertex.
|
||||||
CornerIndex deduplication_first_corner = c;
|
CornerIndex deduplication_first_corner = c;
|
||||||
if (is_vert_hole_[v]) {
|
if (is_vert_hole_[v]) {
|
||||||
@ -1053,7 +1053,7 @@ bool MeshEdgeBreakerDecoderImpl<TraversalDecoder>::AssignPointsToCorners(
|
|||||||
// Traverse in CW direction.
|
// Traverse in CW direction.
|
||||||
CornerIndex prev_c = c;
|
CornerIndex prev_c = c;
|
||||||
c = corner_table_->SwingRight(c);
|
c = corner_table_->SwingRight(c);
|
||||||
while (c >= 0 && c != deduplication_first_corner) {
|
while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
|
||||||
bool attribute_seam = false;
|
bool attribute_seam = false;
|
||||||
for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
|
for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
|
||||||
if (attribute_data_[i].connectivity_data.Vertex(c) !=
|
if (attribute_data_[i].connectivity_data.Vertex(c) !=
|
||||||
|
@ -463,7 +463,7 @@ bool MeshEdgeBreakerEncoderImpl<TraversalEncoder>::FindInitFaceConfiguration(
|
|||||||
// Boundary vertex found. Find the first boundary edge attached to the
|
// Boundary vertex found. Find the first boundary edge attached to the
|
||||||
// point and return the corner opposite to it.
|
// point and return the corner opposite to it.
|
||||||
CornerIndex right_corner = corner_index;
|
CornerIndex right_corner = corner_index;
|
||||||
while (right_corner >= 0) {
|
while (right_corner != kInvalidCornerIndex) {
|
||||||
corner_index = right_corner;
|
corner_index = right_corner;
|
||||||
right_corner = corner_table_->SwingRight(right_corner);
|
right_corner = corner_table_->SwingRight(right_corner);
|
||||||
}
|
}
|
||||||
@ -489,7 +489,7 @@ bool MeshEdgeBreakerEncoderImpl<TraversalEncoder>::EncodeConnectivityFromCorner(
|
|||||||
// Currently processed corner.
|
// Currently processed corner.
|
||||||
corner_id = corner_traversal_stack_.back();
|
corner_id = corner_traversal_stack_.back();
|
||||||
// Make sure the face hasn't been visited yet.
|
// Make sure the face hasn't been visited yet.
|
||||||
if (corner_id < 0 ||
|
if (corner_id == kInvalidCornerIndex ||
|
||||||
visited_faces_[corner_table_->Face(corner_id).value()]) {
|
visited_faces_[corner_table_->Face(corner_id).value()]) {
|
||||||
// This face has been already traversed.
|
// This face has been already traversed.
|
||||||
corner_traversal_stack_.pop_back();
|
corner_traversal_stack_.pop_back();
|
||||||
@ -793,7 +793,7 @@ bool MeshEdgeBreakerEncoderImpl<
|
|||||||
visited_faces_[src_face_id.value()] = true;
|
visited_faces_[src_face_id.value()] = true;
|
||||||
for (int c = 0; c < 3; ++c) {
|
for (int c = 0; c < 3; ++c) {
|
||||||
const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
|
const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
|
||||||
if (opp_corner < 0)
|
if (opp_corner == kInvalidCornerIndex)
|
||||||
continue; // Don't encode attribute seams on boundary edges.
|
continue; // Don't encode attribute seams on boundary edges.
|
||||||
const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
|
const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
|
||||||
// Don't encode edges when the opposite face has been already processed.
|
// Don't encode edges when the opposite face has been already processed.
|
||||||
|
@ -115,7 +115,7 @@ class MeshEdgeBreakerTraversalValenceEncoder
|
|||||||
// update the valence on the "left vertex".
|
// update the valence on the "left vertex".
|
||||||
int num_left_faces = 0;
|
int num_left_faces = 0;
|
||||||
CornerIndex act_c = corner_table_->Opposite(prev);
|
CornerIndex act_c = corner_table_->Opposite(prev);
|
||||||
while (act_c >= 0) {
|
while (act_c != kInvalidCornerIndex) {
|
||||||
if (encoder_impl()->IsFaceEncoded(corner_table_->Face(act_c)))
|
if (encoder_impl()->IsFaceEncoded(corner_table_->Face(act_c)))
|
||||||
break; // Stop when we reach the first visited face.
|
break; // Stop when we reach the first visited face.
|
||||||
++num_left_faces;
|
++num_left_faces;
|
||||||
@ -130,7 +130,7 @@ class MeshEdgeBreakerTraversalValenceEncoder
|
|||||||
int num_right_faces = 0;
|
int num_right_faces = 0;
|
||||||
|
|
||||||
act_c = corner_table_->Opposite(next);
|
act_c = corner_table_->Opposite(next);
|
||||||
while (act_c >= 0) {
|
while (act_c != kInvalidCornerIndex) {
|
||||||
if (encoder_impl()->IsFaceEncoded(corner_table_->Face(act_c)))
|
if (encoder_impl()->IsFaceEncoded(corner_table_->Face(act_c)))
|
||||||
break; // Stop when we reach the first visited face.
|
break; // Stop when we reach the first visited face.
|
||||||
++num_right_faces;
|
++num_right_faces;
|
||||||
@ -190,7 +190,7 @@ class MeshEdgeBreakerTraversalValenceEncoder
|
|||||||
EncodeVarint<uint32_t>(context_symbols_[i].size(), GetOutputBuffer());
|
EncodeVarint<uint32_t>(context_symbols_[i].size(), GetOutputBuffer());
|
||||||
if (context_symbols_[i].size() > 0) {
|
if (context_symbols_[i].size() > 0) {
|
||||||
EncodeSymbols(context_symbols_[i].data(), context_symbols_[i].size(), 1,
|
EncodeSymbols(context_symbols_[i].data(), context_symbols_[i].size(), 1,
|
||||||
GetOutputBuffer());
|
nullptr, GetOutputBuffer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,8 @@ bool MeshSequentialEncoder::CompressAndEncodeIndices() {
|
|||||||
last_index_value = index_value;
|
last_index_value = index_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EncodeSymbols(indices_buffer.data(), indices_buffer.size(), 1, buffer());
|
EncodeSymbols(indices_buffer.data(), indices_buffer.size(), 1, nullptr,
|
||||||
|
buffer());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ void SymbolBitEncoder::EncodeLeastSignificantBits32(int nbits, uint32_t value) {
|
|||||||
|
|
||||||
void SymbolBitEncoder::EndEncoding(EncoderBuffer *target_buffer) {
|
void SymbolBitEncoder::EndEncoding(EncoderBuffer *target_buffer) {
|
||||||
target_buffer->Encode(static_cast<uint32_t>(symbols_.size()));
|
target_buffer->Encode(static_cast<uint32_t>(symbols_.size()));
|
||||||
EncodeSymbols(symbols_.data(), symbols_.size(), 1, target_buffer);
|
EncodeSymbols(symbols_.data(), symbols_.size(), 1, nullptr, target_buffer);
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ namespace draco {
|
|||||||
// draco_index_type.h .
|
// draco_index_type.h .
|
||||||
// TODO(ostava): Make the interface more complete. It's currently missing
|
// TODO(ostava): Make the interface more complete. It's currently missing
|
||||||
// features such as iterators.
|
// features such as iterators.
|
||||||
|
// TODO(scottgodfrey): Make unit tests for this class.
|
||||||
template <class IndexTypeT, class ValueTypeT>
|
template <class IndexTypeT, class ValueTypeT>
|
||||||
class IndexTypeVector {
|
class IndexTypeVector {
|
||||||
public:
|
public:
|
||||||
@ -43,6 +44,10 @@ class IndexTypeVector {
|
|||||||
void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
|
void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
|
||||||
void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
|
void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
|
||||||
|
|
||||||
|
void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
|
||||||
|
vector_.swap(arg.vector_);
|
||||||
|
}
|
||||||
|
|
||||||
size_t size() const { return vector_.size(); }
|
size_t size() const { return vector_.size(); }
|
||||||
|
|
||||||
void push_back(const ValueTypeT &val) { vector_.push_back(val); }
|
void push_back(const ValueTypeT &val) { vector_.push_back(val); }
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
namespace draco {
|
namespace draco {
|
||||||
|
|
||||||
// Draco version is comprised of <major>.<minor>.<revision>.
|
// Draco version is comprised of <major>.<minor>.<revision>.
|
||||||
static const char kDracoVersion[] = "1.2.4";
|
static const char kDracoVersion[] = "1.2.5";
|
||||||
|
|
||||||
const char *Version() { return kDracoVersion; }
|
const char *Version() { return kDracoVersion; }
|
||||||
|
|
||||||
|
@ -79,7 +79,8 @@ void Options::SetVector(const std::string &name, const DataTypeT *vec,
|
|||||||
if (i > 0)
|
if (i > 0)
|
||||||
out += " ";
|
out += " ";
|
||||||
|
|
||||||
// GNU STL on android doesn't include a proper std::to_string, but the libc++ version does
|
// GNU STL on android doesn't include a proper std::to_string, but the libc++
|
||||||
|
// version does
|
||||||
#if defined(ANDROID) && !defined(_LIBCPP_VERSION)
|
#if defined(ANDROID) && !defined(_LIBCPP_VERSION)
|
||||||
out += to_string(vec[i]);
|
out += to_string(vec[i]);
|
||||||
#else
|
#else
|
||||||
|
@ -21,20 +21,21 @@
|
|||||||
|
|
||||||
namespace draco {
|
namespace draco {
|
||||||
|
|
||||||
// Computes the desired precision of the rANS method for the specified maximal
|
// Computes the desired precision of the rANS method for the specified number of
|
||||||
// symbol bit length of the input data.
|
// unique symbols the input data (defined by their bit_length).
|
||||||
constexpr int ComputeRAnsUnclampedPrecision(int max_bit_length) {
|
constexpr int ComputeRAnsUnclampedPrecision(int symbols_bit_length) {
|
||||||
return (3 * max_bit_length) / 2;
|
return (3 * symbols_bit_length) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Computes the desired precision clamped to guarantee a valid functionality of
|
// Computes the desired precision clamped to guarantee a valid functionality of
|
||||||
// our rANS library (which is between 12 to 20 bits).
|
// our rANS library (which is between 12 to 20 bits).
|
||||||
constexpr int ComputeRAnsPrecisionFromMaxSymbolBitLength(int max_bit_length) {
|
constexpr int ComputeRAnsPrecisionFromUniqueSymbolsBitLength(
|
||||||
return ComputeRAnsUnclampedPrecision(max_bit_length) < 12
|
int symbols_bit_length) {
|
||||||
|
return ComputeRAnsUnclampedPrecision(symbols_bit_length) < 12
|
||||||
? 12
|
? 12
|
||||||
: ComputeRAnsUnclampedPrecision(max_bit_length) > 20
|
: ComputeRAnsUnclampedPrecision(symbols_bit_length) > 20
|
||||||
? 20
|
? 20
|
||||||
: ComputeRAnsUnclampedPrecision(max_bit_length);
|
: ComputeRAnsUnclampedPrecision(symbols_bit_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute approximate frequency table size needed for storing the provided
|
// Compute approximate frequency table size needed for storing the provided
|
||||||
|
@ -24,9 +24,9 @@ namespace draco {
|
|||||||
|
|
||||||
// A helper class for decoding symbols using the rANS algorithm (see ans.h).
|
// A helper class for decoding symbols using the rANS algorithm (see ans.h).
|
||||||
// The class can be used to decode the probability table and the data encoded
|
// The class can be used to decode the probability table and the data encoded
|
||||||
// by the RAnsSymbolEncoder. |max_symbol_bit_length_t| must be the same as the
|
// by the RAnsSymbolEncoder. |unique_symbols_bit_length_t| must be the same as
|
||||||
// one used for the corresponding RAnsSymbolEncoder.
|
// the one used for the corresponding RAnsSymbolEncoder.
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
class RAnsSymbolDecoder {
|
class RAnsSymbolDecoder {
|
||||||
public:
|
public:
|
||||||
RAnsSymbolDecoder() : num_symbols_(0) {}
|
RAnsSymbolDecoder() : num_symbols_(0) {}
|
||||||
@ -43,9 +43,9 @@ class RAnsSymbolDecoder {
|
|||||||
void EndDecoding();
|
void EndDecoding();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr int max_symbols_ = 1 << max_symbol_bit_length_t;
|
|
||||||
static constexpr int rans_precision_bits_ =
|
static constexpr int rans_precision_bits_ =
|
||||||
ComputeRAnsPrecisionFromMaxSymbolBitLength(max_symbol_bit_length_t);
|
ComputeRAnsPrecisionFromUniqueSymbolsBitLength(
|
||||||
|
unique_symbols_bit_length_t);
|
||||||
static constexpr int rans_precision_ = 1 << rans_precision_bits_;
|
static constexpr int rans_precision_ = 1 << rans_precision_bits_;
|
||||||
|
|
||||||
std::vector<uint32_t> probability_table_;
|
std::vector<uint32_t> probability_table_;
|
||||||
@ -53,8 +53,9 @@ class RAnsSymbolDecoder {
|
|||||||
RAnsDecoder<rans_precision_bits_> ans_;
|
RAnsDecoder<rans_precision_bits_> ans_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
bool RAnsSymbolDecoder<max_symbol_bit_length_t>::Create(DecoderBuffer *buffer) {
|
bool RAnsSymbolDecoder<unique_symbols_bit_length_t>::Create(
|
||||||
|
DecoderBuffer *buffer) {
|
||||||
// Check that the DecoderBuffer version is set.
|
// Check that the DecoderBuffer version is set.
|
||||||
if (buffer->bitstream_version() == 0)
|
if (buffer->bitstream_version() == 0)
|
||||||
return false;
|
return false;
|
||||||
@ -112,8 +113,8 @@ bool RAnsSymbolDecoder<max_symbol_bit_length_t>::Create(DecoderBuffer *buffer) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
bool RAnsSymbolDecoder<max_symbol_bit_length_t>::StartDecoding(
|
bool RAnsSymbolDecoder<unique_symbols_bit_length_t>::StartDecoding(
|
||||||
DecoderBuffer *buffer) {
|
DecoderBuffer *buffer) {
|
||||||
uint64_t bytes_encoded;
|
uint64_t bytes_encoded;
|
||||||
// Decode the number of bytes encoded by the encoder.
|
// Decode the number of bytes encoded by the encoder.
|
||||||
@ -138,8 +139,8 @@ bool RAnsSymbolDecoder<max_symbol_bit_length_t>::StartDecoding(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
void RAnsSymbolDecoder<max_symbol_bit_length_t>::EndDecoding() {
|
void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
|
||||||
ans_.read_end();
|
ans_.read_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace draco {
|
|||||||
// A helper class for encoding symbols using the rANS algorithm (see ans.h).
|
// A helper class for encoding symbols using the rANS algorithm (see ans.h).
|
||||||
// The class can be used to initialize and encode probability table needed by
|
// The class can be used to initialize and encode probability table needed by
|
||||||
// rANS, and to perform encoding of symbols into the provided EncoderBuffer.
|
// rANS, and to perform encoding of symbols into the provided EncoderBuffer.
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
class RAnsSymbolEncoder {
|
class RAnsSymbolEncoder {
|
||||||
public:
|
public:
|
||||||
RAnsSymbolEncoder()
|
RAnsSymbolEncoder()
|
||||||
@ -67,9 +67,9 @@ class RAnsSymbolEncoder {
|
|||||||
// Encodes the probability table into the output buffer.
|
// Encodes the probability table into the output buffer.
|
||||||
bool EncodeTable(EncoderBuffer *buffer);
|
bool EncodeTable(EncoderBuffer *buffer);
|
||||||
|
|
||||||
static constexpr int max_symbols_ = 1 << max_symbol_bit_length_t;
|
|
||||||
static constexpr int rans_precision_bits_ =
|
static constexpr int rans_precision_bits_ =
|
||||||
ComputeRAnsPrecisionFromMaxSymbolBitLength(max_symbol_bit_length_t);
|
ComputeRAnsPrecisionFromUniqueSymbolsBitLength(
|
||||||
|
unique_symbols_bit_length_t);
|
||||||
static constexpr int rans_precision_ = 1 << rans_precision_bits_;
|
static constexpr int rans_precision_ = 1 << rans_precision_bits_;
|
||||||
|
|
||||||
std::vector<rans_sym> probability_table_;
|
std::vector<rans_sym> probability_table_;
|
||||||
@ -83,11 +83,9 @@ class RAnsSymbolEncoder {
|
|||||||
uint64_t buffer_offset_;
|
uint64_t buffer_offset_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
bool RAnsSymbolEncoder<max_symbol_bit_length_t>::Create(
|
bool RAnsSymbolEncoder<unique_symbols_bit_length_t>::Create(
|
||||||
const uint64_t *frequencies, int num_symbols, EncoderBuffer *buffer) {
|
const uint64_t *frequencies, int num_symbols, EncoderBuffer *buffer) {
|
||||||
if (num_symbols > max_symbols_)
|
|
||||||
return false;
|
|
||||||
// Compute the total of the input frequencies.
|
// Compute the total of the input frequencies.
|
||||||
uint64_t total_freq = 0;
|
uint64_t total_freq = 0;
|
||||||
int max_valid_symbol = 0;
|
int max_valid_symbol = 0;
|
||||||
@ -194,8 +192,8 @@ bool RAnsSymbolEncoder<max_symbol_bit_length_t>::Create(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
bool RAnsSymbolEncoder<max_symbol_bit_length_t>::EncodeTable(
|
bool RAnsSymbolEncoder<unique_symbols_bit_length_t>::EncodeTable(
|
||||||
EncoderBuffer *buffer) {
|
EncoderBuffer *buffer) {
|
||||||
EncodeVarint(num_symbols_, buffer);
|
EncodeVarint(num_symbols_, buffer);
|
||||||
// Use varint encoding for the probabilities (first two bits represent the
|
// Use varint encoding for the probabilities (first two bits represent the
|
||||||
@ -242,8 +240,8 @@ bool RAnsSymbolEncoder<max_symbol_bit_length_t>::EncodeTable(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
void RAnsSymbolEncoder<max_symbol_bit_length_t>::StartEncoding(
|
void RAnsSymbolEncoder<unique_symbols_bit_length_t>::StartEncoding(
|
||||||
EncoderBuffer *buffer) {
|
EncoderBuffer *buffer) {
|
||||||
// Allocate extra storage just in case.
|
// Allocate extra storage just in case.
|
||||||
const uint64_t required_bits = 2 * num_expected_bits_ + 32;
|
const uint64_t required_bits = 2 * num_expected_bits_ + 32;
|
||||||
@ -256,8 +254,8 @@ void RAnsSymbolEncoder<max_symbol_bit_length_t>::StartEncoding(
|
|||||||
ans_.write_init(data + buffer_offset_);
|
ans_.write_init(data + buffer_offset_);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int max_symbol_bit_length_t>
|
template <int unique_symbols_bit_length_t>
|
||||||
void RAnsSymbolEncoder<max_symbol_bit_length_t>::EndEncoding(
|
void RAnsSymbolEncoder<unique_symbols_bit_length_t>::EndEncoding(
|
||||||
EncoderBuffer *buffer) {
|
EncoderBuffer *buffer) {
|
||||||
char *const src = const_cast<char *>(buffer->data()) + buffer_offset_;
|
char *const src = const_cast<char *>(buffer->data()) + buffer_offset_;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ TEST_F(SymbolCodingTest, TestLargeNumbers) {
|
|||||||
const uint32_t in[] = {12345678, 1223333, 111, 5};
|
const uint32_t in[] = {12345678, 1223333, 111, 5};
|
||||||
const int num_values = sizeof(in) / sizeof(uint32_t);
|
const int num_values = sizeof(in) / sizeof(uint32_t);
|
||||||
EncoderBuffer eb;
|
EncoderBuffer eb;
|
||||||
ASSERT_TRUE(EncodeSymbols(in, num_values, 1, &eb));
|
ASSERT_TRUE(EncodeSymbols(in, num_values, 1, nullptr, &eb));
|
||||||
|
|
||||||
std::vector<uint32_t> out;
|
std::vector<uint32_t> out;
|
||||||
out.resize(num_values);
|
out.resize(num_values);
|
||||||
@ -70,23 +70,30 @@ TEST_F(SymbolCodingTest, TestManyNumbers) {
|
|||||||
for (int i = 0; i < num_pairs; ++i) {
|
for (int i = 0; i < num_pairs; ++i) {
|
||||||
in_values.insert(in_values.end(), in[i].second, in[i].first);
|
in_values.insert(in_values.end(), in[i].second, in[i].first);
|
||||||
}
|
}
|
||||||
EncoderBuffer eb;
|
for (int method = 0; method < NUM_SYMBOL_CODING_METHODS; ++method) {
|
||||||
ASSERT_TRUE(EncodeSymbols(in_values.data(), in_values.size(), 1, &eb));
|
// Test the encoding using all available symbol coding methods.
|
||||||
std::vector<uint32_t> out_values;
|
Options options;
|
||||||
out_values.resize(in_values.size());
|
SetSymbolEncodingMethod(&options, static_cast<SymbolCodingMethod>(method));
|
||||||
DecoderBuffer db;
|
|
||||||
db.Init(eb.data(), eb.size());
|
EncoderBuffer eb;
|
||||||
db.set_bitstream_version(bitstream_version_);
|
ASSERT_TRUE(
|
||||||
ASSERT_TRUE(DecodeSymbols(in_values.size(), 1, &db, &out_values[0]));
|
EncodeSymbols(in_values.data(), in_values.size(), 1, &options, &eb));
|
||||||
for (uint32_t i = 0; i < in_values.size(); ++i) {
|
std::vector<uint32_t> out_values;
|
||||||
ASSERT_EQ(in_values[i], out_values[i]);
|
out_values.resize(in_values.size());
|
||||||
|
DecoderBuffer db;
|
||||||
|
db.Init(eb.data(), eb.size());
|
||||||
|
db.set_bitstream_version(bitstream_version_);
|
||||||
|
ASSERT_TRUE(DecodeSymbols(in_values.size(), 1, &db, &out_values[0]));
|
||||||
|
for (uint32_t i = 0; i < in_values.size(); ++i) {
|
||||||
|
ASSERT_EQ(in_values[i], out_values[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(SymbolCodingTest, TestEmpty) {
|
TEST_F(SymbolCodingTest, TestEmpty) {
|
||||||
// This test verifies that SymbolCoding successfully encodes an empty array.
|
// This test verifies that SymbolCoding successfully encodes an empty array.
|
||||||
EncoderBuffer eb;
|
EncoderBuffer eb;
|
||||||
ASSERT_TRUE(EncodeSymbols(nullptr, 0, 1, &eb));
|
ASSERT_TRUE(EncodeSymbols(nullptr, 0, 1, nullptr, &eb));
|
||||||
DecoderBuffer db;
|
DecoderBuffer db;
|
||||||
db.Init(eb.data(), eb.size());
|
db.Init(eb.data(), eb.size());
|
||||||
db.set_bitstream_version(bitstream_version_);
|
db.set_bitstream_version(bitstream_version_);
|
||||||
@ -98,7 +105,7 @@ TEST_F(SymbolCodingTest, TestOneSymbol) {
|
|||||||
// symbol.
|
// symbol.
|
||||||
EncoderBuffer eb;
|
EncoderBuffer eb;
|
||||||
const std::vector<uint32_t> in(1200, 0);
|
const std::vector<uint32_t> in(1200, 0);
|
||||||
ASSERT_TRUE(EncodeSymbols(in.data(), in.size(), 1, &eb));
|
ASSERT_TRUE(EncodeSymbols(in.data(), in.size(), 1, nullptr, &eb));
|
||||||
|
|
||||||
std::vector<uint32_t> out(in.size());
|
std::vector<uint32_t> out(in.size());
|
||||||
DecoderBuffer db;
|
DecoderBuffer db;
|
||||||
@ -122,7 +129,7 @@ TEST_F(SymbolCodingTest, TestBitLengths) {
|
|||||||
std::vector<uint32_t> out(in.size());
|
std::vector<uint32_t> out(in.size());
|
||||||
for (int i = 0; i < bit_lengths; ++i) {
|
for (int i = 0; i < bit_lengths; ++i) {
|
||||||
eb.Clear();
|
eb.Clear();
|
||||||
ASSERT_TRUE(EncodeSymbols(in.data(), i + 1, 1, &eb));
|
ASSERT_TRUE(EncodeSymbols(in.data(), i + 1, 1, nullptr, &eb));
|
||||||
DecoderBuffer db;
|
DecoderBuffer db;
|
||||||
db.Init(eb.data(), eb.size());
|
db.Init(eb.data(), eb.size());
|
||||||
db.set_bitstream_version(bitstream_version_);
|
db.set_bitstream_version(bitstream_version_);
|
||||||
@ -139,7 +146,7 @@ TEST_F(SymbolCodingTest, TestLargeNumberCondition) {
|
|||||||
EncoderBuffer eb;
|
EncoderBuffer eb;
|
||||||
constexpr int num_symbols = 1000000;
|
constexpr int num_symbols = 1000000;
|
||||||
const std::vector<uint32_t> in(num_symbols, 1 << 18);
|
const std::vector<uint32_t> in(num_symbols, 1 << 18);
|
||||||
ASSERT_TRUE(EncodeSymbols(in.data(), in.size(), 1, &eb));
|
ASSERT_TRUE(EncodeSymbols(in.data(), in.size(), 1, nullptr, &eb));
|
||||||
|
|
||||||
std::vector<uint32_t> out(in.size());
|
std::vector<uint32_t> out(in.size());
|
||||||
DecoderBuffer db;
|
DecoderBuffer db;
|
||||||
|
@ -37,10 +37,10 @@ bool DecodeSymbols(uint32_t num_values, int num_components,
|
|||||||
uint8_t scheme;
|
uint8_t scheme;
|
||||||
if (!src_buffer->Decode(&scheme))
|
if (!src_buffer->Decode(&scheme))
|
||||||
return false;
|
return false;
|
||||||
if (scheme == 0) {
|
if (scheme == SYMBOL_CODING_TAGGED) {
|
||||||
return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
|
return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
|
||||||
src_buffer, out_values);
|
src_buffer, out_values);
|
||||||
} else if (scheme == 1) {
|
} else if (scheme == SYMBOL_CODING_RAW) {
|
||||||
return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
|
return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
|
||||||
out_values);
|
out_values);
|
||||||
}
|
}
|
||||||
|
@ -26,9 +26,22 @@ namespace draco {
|
|||||||
|
|
||||||
constexpr int32_t kMaxTagSymbolBitLength = 32;
|
constexpr int32_t kMaxTagSymbolBitLength = 32;
|
||||||
constexpr int kMaxRawEncodingBitLength = 18;
|
constexpr int kMaxRawEncodingBitLength = 18;
|
||||||
|
constexpr int kDefaultSymbolCodingCompressionLevel = 7;
|
||||||
|
|
||||||
typedef uint64_t TaggedBitLengthFrequencies[kMaxTagSymbolBitLength];
|
typedef uint64_t TaggedBitLengthFrequencies[kMaxTagSymbolBitLength];
|
||||||
|
|
||||||
|
void SetSymbolEncodingMethod(Options *options, SymbolCodingMethod method) {
|
||||||
|
options->SetInt("symbol_encoding_method", method);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SetSymbolEncodingCompressionLevel(Options *options,
|
||||||
|
int compression_level) {
|
||||||
|
if (compression_level < 0 || compression_level > 10)
|
||||||
|
return false;
|
||||||
|
options->SetInt("symbol_encoding_compression_level", compression_level);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Computes bit lengths of the input values. If num_components > 1, the values
|
// Computes bit lengths of the input values. If num_components > 1, the values
|
||||||
// are processed in "num_components" sized chunks and the bit length is always
|
// are processed in "num_components" sized chunks and the bit length is always
|
||||||
// computed for the largest value from the chunk.
|
// computed for the largest value from the chunk.
|
||||||
@ -75,12 +88,14 @@ static int64_t ApproximateTaggedSchemeBits(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int64_t ApproximateRawSchemeBits(const uint32_t *symbols,
|
static int64_t ApproximateRawSchemeBits(const uint32_t *symbols,
|
||||||
int num_symbols, uint32_t max_value) {
|
int num_symbols, uint32_t max_value,
|
||||||
|
int *out_num_unique_symbols) {
|
||||||
int num_unique_symbols;
|
int num_unique_symbols;
|
||||||
const int64_t data_bits = ComputeShannonEntropy(
|
const int64_t data_bits = ComputeShannonEntropy(
|
||||||
symbols, num_symbols, max_value, &num_unique_symbols);
|
symbols, num_symbols, max_value, &num_unique_symbols);
|
||||||
const int64_t table_bits =
|
const int64_t table_bits =
|
||||||
ApproximateRAnsFrequencyTableBits(max_value, num_unique_symbols);
|
ApproximateRAnsFrequencyTableBits(max_value, num_unique_symbols);
|
||||||
|
*out_num_unique_symbols = num_unique_symbols;
|
||||||
return table_bits + data_bits;
|
return table_bits + data_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,10 +107,11 @@ bool EncodeTaggedSymbols(const uint32_t *symbols, int num_values,
|
|||||||
|
|
||||||
template <template <int> class SymbolEncoderT>
|
template <template <int> class SymbolEncoderT>
|
||||||
bool EncodeRawSymbols(const uint32_t *symbols, int num_values,
|
bool EncodeRawSymbols(const uint32_t *symbols, int num_values,
|
||||||
const uint32_t *max_value, EncoderBuffer *target_buffer);
|
uint32_t max_entry_value, int32_t num_unique_symbols,
|
||||||
|
const Options *options, EncoderBuffer *target_buffer);
|
||||||
|
|
||||||
bool EncodeSymbols(const uint32_t *symbols, int num_values, int num_components,
|
bool EncodeSymbols(const uint32_t *symbols, int num_values, int num_components,
|
||||||
EncoderBuffer *target_buffer) {
|
const Options *options, EncoderBuffer *target_buffer) {
|
||||||
if (num_values < 0)
|
if (num_values < 0)
|
||||||
return false;
|
return false;
|
||||||
if (num_values == 0)
|
if (num_values == 0)
|
||||||
@ -114,25 +130,39 @@ bool EncodeSymbols(const uint32_t *symbols, int num_values, int num_components,
|
|||||||
|
|
||||||
// Approximate number of bits needed for storing the symbols using the raw
|
// Approximate number of bits needed for storing the symbols using the raw
|
||||||
// scheme.
|
// scheme.
|
||||||
const int64_t raw_scheme_total_bits =
|
int num_unique_symbols = 0;
|
||||||
ApproximateRawSchemeBits(symbols, num_values, max_value);
|
const int64_t raw_scheme_total_bits = ApproximateRawSchemeBits(
|
||||||
|
symbols, num_values, max_value, &num_unique_symbols);
|
||||||
|
|
||||||
// The maximum bit length of a single entry value that we can encode using
|
// The maximum bit length of a single entry value that we can encode using
|
||||||
// the raw scheme.
|
// the raw scheme.
|
||||||
const int max_value_bit_length =
|
const int max_value_bit_length =
|
||||||
bits::MostSignificantBit(std::max(1u, max_value)) + 1;
|
bits::MostSignificantBit(std::max(1u, max_value)) + 1;
|
||||||
|
|
||||||
if (tagged_scheme_total_bits < raw_scheme_total_bits ||
|
int method = -1;
|
||||||
max_value_bit_length > kMaxRawEncodingBitLength) {
|
if (options != nullptr && options->IsOptionSet("symbol_encoding_method")) {
|
||||||
// Use the tagged scheme.
|
method = options->GetInt("symbol_encoding_method");
|
||||||
target_buffer->Encode(static_cast<uint8_t>(0));
|
} else {
|
||||||
|
if (tagged_scheme_total_bits < raw_scheme_total_bits ||
|
||||||
|
max_value_bit_length > kMaxRawEncodingBitLength) {
|
||||||
|
method = SYMBOL_CODING_TAGGED;
|
||||||
|
} else {
|
||||||
|
method = SYMBOL_CODING_RAW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use the tagged scheme.
|
||||||
|
target_buffer->Encode(static_cast<uint8_t>(method));
|
||||||
|
if (method == SYMBOL_CODING_TAGGED) {
|
||||||
return EncodeTaggedSymbols<RAnsSymbolEncoder>(
|
return EncodeTaggedSymbols<RAnsSymbolEncoder>(
|
||||||
symbols, num_values, num_components, bit_lengths, target_buffer);
|
symbols, num_values, num_components, bit_lengths, target_buffer);
|
||||||
}
|
}
|
||||||
// Else use the raw scheme.
|
if (method == SYMBOL_CODING_RAW) {
|
||||||
target_buffer->Encode(static_cast<uint8_t>(1));
|
return EncodeRawSymbols<RAnsSymbolEncoder>(symbols, num_values, max_value,
|
||||||
return EncodeRawSymbols<RAnsSymbolEncoder>(symbols, num_values, &max_value,
|
num_unique_symbols, options,
|
||||||
target_buffer);
|
target_buffer);
|
||||||
|
}
|
||||||
|
// Unknown method selected.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <template <int> class SymbolEncoderT>
|
template <template <int> class SymbolEncoderT>
|
||||||
@ -160,7 +190,8 @@ bool EncodeTaggedSymbols(const uint32_t *symbols, int num_values,
|
|||||||
EncoderBuffer value_buffer;
|
EncoderBuffer value_buffer;
|
||||||
// Number of expected bits we need to store the values (can be optimized if
|
// Number of expected bits we need to store the values (can be optimized if
|
||||||
// needed).
|
// needed).
|
||||||
const uint64_t value_bits = kMaxTagSymbolBitLength * num_values;
|
const uint64_t value_bits =
|
||||||
|
kMaxTagSymbolBitLength * static_cast<uint64_t>(num_values);
|
||||||
|
|
||||||
// Create encoder for encoding the bit tags.
|
// Create encoder for encoding the bit tags.
|
||||||
SymbolEncoderT<5> tag_encoder;
|
SymbolEncoderT<5> tag_encoder;
|
||||||
@ -207,7 +238,7 @@ bool EncodeTaggedSymbols(const uint32_t *symbols, int num_values,
|
|||||||
|
|
||||||
template <class SymbolEncoderT>
|
template <class SymbolEncoderT>
|
||||||
bool EncodeRawSymbolsInternal(const uint32_t *symbols, int num_values,
|
bool EncodeRawSymbolsInternal(const uint32_t *symbols, int num_values,
|
||||||
const uint32_t &max_entry_value,
|
uint32_t max_entry_value,
|
||||||
EncoderBuffer *target_buffer) {
|
EncoderBuffer *target_buffer) {
|
||||||
// Count the frequency of each entry value.
|
// Count the frequency of each entry value.
|
||||||
std::vector<uint64_t> frequencies(max_entry_value + 1, 0);
|
std::vector<uint64_t> frequencies(max_entry_value + 1, 0);
|
||||||
@ -217,7 +248,6 @@ bool EncodeRawSymbolsInternal(const uint32_t *symbols, int num_values,
|
|||||||
|
|
||||||
SymbolEncoderT encoder;
|
SymbolEncoderT encoder;
|
||||||
encoder.Create(frequencies.data(), frequencies.size(), target_buffer);
|
encoder.Create(frequencies.data(), frequencies.size(), target_buffer);
|
||||||
|
|
||||||
encoder.StartEncoding(target_buffer);
|
encoder.StartEncoding(target_buffer);
|
||||||
// Encode all values.
|
// Encode all values.
|
||||||
if (SymbolEncoderT::needs_reverse_encoding()) {
|
if (SymbolEncoderT::needs_reverse_encoding()) {
|
||||||
@ -235,29 +265,45 @@ bool EncodeRawSymbolsInternal(const uint32_t *symbols, int num_values,
|
|||||||
|
|
||||||
template <template <int> class SymbolEncoderT>
|
template <template <int> class SymbolEncoderT>
|
||||||
bool EncodeRawSymbols(const uint32_t *symbols, int num_values,
|
bool EncodeRawSymbols(const uint32_t *symbols, int num_values,
|
||||||
const uint32_t *max_value, EncoderBuffer *target_buffer) {
|
uint32_t max_entry_value, int32_t num_unique_symbols,
|
||||||
uint32_t max_entry_value = 0;
|
const Options *options, EncoderBuffer *target_buffer) {
|
||||||
// If the max_value is not provided, find it.
|
int symbol_bits = 0;
|
||||||
if (max_value != nullptr) {
|
if (num_unique_symbols > 0) {
|
||||||
max_entry_value = *max_value;
|
symbol_bits = bits::MostSignificantBit(num_unique_symbols);
|
||||||
} else {
|
|
||||||
for (int i = 0; i < num_values; ++i) {
|
|
||||||
if (symbols[i] > max_entry_value) {
|
|
||||||
max_entry_value = symbols[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
int max_value_bits = 0;
|
int unique_symbols_bit_length = symbol_bits + 1;
|
||||||
if (max_entry_value > 0) {
|
// Currently, we don't support encoding of more than 2^18 unique symbols.
|
||||||
max_value_bits = bits::MostSignificantBit(max_entry_value);
|
if (unique_symbols_bit_length > kMaxRawEncodingBitLength)
|
||||||
}
|
|
||||||
const int max_value_bit_length = max_value_bits + 1;
|
|
||||||
// Currently, we don't support encoding of values larger than 2^18.
|
|
||||||
if (max_value_bit_length > kMaxRawEncodingBitLength)
|
|
||||||
return false;
|
return false;
|
||||||
target_buffer->Encode(static_cast<uint8_t>(max_value_bit_length));
|
int compression_level = kDefaultSymbolCodingCompressionLevel;
|
||||||
|
if (options != nullptr &&
|
||||||
|
options->IsOptionSet("symbol_encoding_compression_level")) {
|
||||||
|
compression_level = options->GetInt("symbol_encoding_compression_level");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adjust the bit_length based on compression level. Lower compression levels
|
||||||
|
// will use fewer bits while higher compression levels use more bits. Note
|
||||||
|
// that this is going to work for all valid bit_lengths because the actual
|
||||||
|
// number of bits allocated for rANS encoding is hard coded as:
|
||||||
|
// std::max(12, 3 * bit_length / 2) , therefore there will be always a
|
||||||
|
// sufficient number of bits available for all symbols.
|
||||||
|
// See ComputeRAnsPrecisionFromUniqueSymbolsBitLength() for the formula.
|
||||||
|
// This hardcoded equation cannot be changed without changing the bitstream.
|
||||||
|
if (compression_level < 4) {
|
||||||
|
unique_symbols_bit_length -= 2;
|
||||||
|
} else if (compression_level < 6) {
|
||||||
|
unique_symbols_bit_length -= 1;
|
||||||
|
} else if (compression_level > 9) {
|
||||||
|
unique_symbols_bit_length += 2;
|
||||||
|
} else if (compression_level > 7) {
|
||||||
|
unique_symbols_bit_length += 1;
|
||||||
|
}
|
||||||
|
// Clamp the bit_length to a valid range.
|
||||||
|
unique_symbols_bit_length = std::min(std::max(1, unique_symbols_bit_length),
|
||||||
|
kMaxRawEncodingBitLength);
|
||||||
|
target_buffer->Encode(static_cast<uint8_t>(unique_symbols_bit_length));
|
||||||
// Use appropriate symbol encoder based on the maximum symbol bit length.
|
// Use appropriate symbol encoder based on the maximum symbol bit length.
|
||||||
switch (max_value_bit_length) {
|
switch (unique_symbols_bit_length) {
|
||||||
case 0:
|
case 0:
|
||||||
FALLTHROUGH_INTENDED;
|
FALLTHROUGH_INTENDED;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
#ifndef DRACO_CORE_SYMBOL_ENCODING_H_
|
#ifndef DRACO_CORE_SYMBOL_ENCODING_H_
|
||||||
#define DRACO_CORE_SYMBOL_ENCODING_H_
|
#define DRACO_CORE_SYMBOL_ENCODING_H_
|
||||||
|
|
||||||
|
#include "draco/compression/config/compression_shared.h"
|
||||||
#include "draco/core/encoder_buffer.h"
|
#include "draco/core/encoder_buffer.h"
|
||||||
|
#include "draco/core/options.h"
|
||||||
|
|
||||||
namespace draco {
|
namespace draco {
|
||||||
|
|
||||||
@ -23,10 +25,22 @@ namespace draco {
|
|||||||
// automatically decides whether to encode the symbol values using using bit
|
// automatically decides whether to encode the symbol values using using bit
|
||||||
// length tags (see EncodeTaggedSymbols), or whether to encode them directly
|
// length tags (see EncodeTaggedSymbols), or whether to encode them directly
|
||||||
// (see EncodeRawSymbols). The symbols can be grouped into separate components
|
// (see EncodeRawSymbols). The symbols can be grouped into separate components
|
||||||
// that can be used for better compression.
|
// that can be used for better compression. |options| is an optional parameter
|
||||||
|
// that allows more direct control over various stages of the symbol encoding
|
||||||
|
// (see below for functions that are used to set valid options).
|
||||||
// Returns false on error.
|
// Returns false on error.
|
||||||
bool EncodeSymbols(const uint32_t *symbols, int num_values, int num_components,
|
bool EncodeSymbols(const uint32_t *symbols, int num_values, int num_components,
|
||||||
EncoderBuffer *target_buffer);
|
const Options *options, EncoderBuffer *target_buffer);
|
||||||
|
|
||||||
|
// Sets an option that forces symbol encoder to use the specified encoding
|
||||||
|
// method.
|
||||||
|
void SetSymbolEncodingMethod(Options *options, SymbolCodingMethod method);
|
||||||
|
|
||||||
|
// Sets the desired compression level for symbol encoding in range <0, 10> where
|
||||||
|
// 0 is the worst but fastest compression and 10 is the best but slowest
|
||||||
|
// compression. If the option is not set, default value of 7 is used.
|
||||||
|
// Returns false if an invalid level has been set.
|
||||||
|
bool SetSymbolEncodingCompressionLevel(Options *options, int compression_level);
|
||||||
|
|
||||||
} // namespace draco
|
} // namespace draco
|
||||||
|
|
||||||
|
@ -25,7 +25,12 @@ using draco::PointAttribute;
|
|||||||
using draco::PointCloud;
|
using draco::PointCloud;
|
||||||
using draco::Status;
|
using draco::Status;
|
||||||
|
|
||||||
MetadataQuerier::MetadataQuerier() {}
|
MetadataQuerier::MetadataQuerier() : entry_names_metadata_(nullptr) {}
|
||||||
|
|
||||||
|
bool MetadataQuerier::HasEntry(const Metadata &metadata,
|
||||||
|
const char *entry_name) const {
|
||||||
|
return metadata.entries().count(entry_name) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool MetadataQuerier::HasIntEntry(const Metadata &metadata,
|
bool MetadataQuerier::HasIntEntry(const Metadata &metadata,
|
||||||
const char *entry_name) const {
|
const char *entry_name) const {
|
||||||
@ -79,6 +84,25 @@ const char *MetadataQuerier::GetStringEntry(const Metadata &metadata,
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long MetadataQuerier::NumEntries(const Metadata &metadata) const {
|
||||||
|
return metadata.num_entries();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *MetadataQuerier::GetEntryName(const Metadata &metadata,
|
||||||
|
int entry_id) {
|
||||||
|
if (entry_names_metadata_ != &metadata) {
|
||||||
|
entry_names_.clear();
|
||||||
|
entry_names_metadata_ = &metadata;
|
||||||
|
// Initialize the list of entry names.
|
||||||
|
for (auto &&entry : metadata.entries()) {
|
||||||
|
entry_names_.push_back(entry.first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entry_id < 0 || entry_id >= entry_names_.size())
|
||||||
|
return nullptr;
|
||||||
|
return entry_names_[entry_id].c_str();
|
||||||
|
}
|
||||||
|
|
||||||
DracoFloat32Array::DracoFloat32Array() {}
|
DracoFloat32Array::DracoFloat32Array() {}
|
||||||
|
|
||||||
float DracoFloat32Array::GetValue(int index) const { return values_[index]; }
|
float DracoFloat32Array::GetValue(int index) const { return values_[index]; }
|
||||||
|
@ -38,6 +38,7 @@ class MetadataQuerier {
|
|||||||
public:
|
public:
|
||||||
MetadataQuerier();
|
MetadataQuerier();
|
||||||
|
|
||||||
|
bool HasEntry(const draco::Metadata &metadata, const char *entry_name) const;
|
||||||
bool HasIntEntry(const draco::Metadata &metadata,
|
bool HasIntEntry(const draco::Metadata &metadata,
|
||||||
const char *entry_name) const;
|
const char *entry_name) const;
|
||||||
long GetIntEntry(const draco::Metadata &metadata,
|
long GetIntEntry(const draco::Metadata &metadata,
|
||||||
@ -50,6 +51,14 @@ class MetadataQuerier {
|
|||||||
const char *entry_name) const;
|
const char *entry_name) const;
|
||||||
const char *GetStringEntry(const draco::Metadata &metadata,
|
const char *GetStringEntry(const draco::Metadata &metadata,
|
||||||
const char *entry_name) const;
|
const char *entry_name) const;
|
||||||
|
|
||||||
|
long NumEntries(const draco::Metadata &metadata) const;
|
||||||
|
const char *GetEntryName(const draco::Metadata &metadata, int entry_id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Cached values for metadata entries.
|
||||||
|
std::vector<std::string> entry_names_;
|
||||||
|
const draco::Metadata *entry_names_metadata_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DracoFloat32Array {
|
class DracoFloat32Array {
|
||||||
|
@ -114,6 +114,8 @@ interface Status {
|
|||||||
interface MetadataQuerier {
|
interface MetadataQuerier {
|
||||||
void MetadataQuerier();
|
void MetadataQuerier();
|
||||||
|
|
||||||
|
boolean HasEntry([Ref, Const] Metadata metadata,
|
||||||
|
[Const] DOMString entry_name);
|
||||||
boolean HasIntEntry([Ref, Const] Metadata metadata,
|
boolean HasIntEntry([Ref, Const] Metadata metadata,
|
||||||
[Const] DOMString entry_name);
|
[Const] DOMString entry_name);
|
||||||
long GetIntEntry([Ref, Const] Metadata metadata,
|
long GetIntEntry([Ref, Const] Metadata metadata,
|
||||||
@ -123,9 +125,12 @@ interface MetadataQuerier {
|
|||||||
double GetDoubleEntry([Ref, Const] Metadata metadata,
|
double GetDoubleEntry([Ref, Const] Metadata metadata,
|
||||||
[Const] DOMString entry_name);
|
[Const] DOMString entry_name);
|
||||||
boolean HasStringEntry([Ref, Const] Metadata metadata,
|
boolean HasStringEntry([Ref, Const] Metadata metadata,
|
||||||
[Const] DOMString entry_name);
|
[Const] DOMString entry_name);
|
||||||
[Const] DOMString GetStringEntry([Ref, Const] Metadata metadata,
|
[Const] DOMString GetStringEntry([Ref, Const] Metadata metadata,
|
||||||
[Const] DOMString entry_name);
|
[Const] DOMString entry_name);
|
||||||
|
|
||||||
|
long NumEntries([Ref, Const] Metadata metadata);
|
||||||
|
[Const] DOMString GetEntryName([Ref, Const] Metadata metadata, long entry_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Draco version of typed arrays. The memory of these arrays is allocated on the
|
// Draco version of typed arrays. The memory of these arrays is allocated on the
|
||||||
@ -151,7 +156,7 @@ interface Decoder {
|
|||||||
[Const] Status DecodeBufferToMesh(DecoderBuffer in_buffer, Mesh out_mesh);
|
[Const] Status DecodeBufferToMesh(DecoderBuffer in_buffer, Mesh out_mesh);
|
||||||
|
|
||||||
long GetAttributeId([Ref, Const] PointCloud pc,
|
long GetAttributeId([Ref, Const] PointCloud pc,
|
||||||
draco_GeometryAttribute_Type type);
|
draco_GeometryAttribute_Type type);
|
||||||
long GetAttributeIdByName([Ref, Const] PointCloud pc, [Const] DOMString name);
|
long GetAttributeIdByName([Ref, Const] PointCloud pc, [Const] DOMString name);
|
||||||
long GetAttributeIdByMetadataEntry([Ref, Const] PointCloud pc,
|
long GetAttributeIdByMetadataEntry([Ref, Const] PointCloud pc,
|
||||||
[Const] DOMString name,
|
[Const] DOMString name,
|
||||||
|
@ -35,6 +35,8 @@ std::unique_ptr<CornerTable> CornerTable::Create(
|
|||||||
|
|
||||||
bool CornerTable::Initialize(
|
bool CornerTable::Initialize(
|
||||||
const IndexTypeVector<FaceIndex, FaceType> &faces) {
|
const IndexTypeVector<FaceIndex, FaceType> &faces) {
|
||||||
|
ClearValenceCache();
|
||||||
|
ClearValenceCacheInaccurate();
|
||||||
corner_to_vertex_map_.resize(faces.size() * 3);
|
corner_to_vertex_map_.resize(faces.size() * 3);
|
||||||
for (FaceIndex fi(0); fi < faces.size(); ++fi) {
|
for (FaceIndex fi(0); fi < faces.size(); ++fi) {
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
@ -61,10 +63,14 @@ bool CornerTable::Reset(int num_faces, int num_vertices) {
|
|||||||
corner_to_vertex_map_.assign(num_faces * 3, kInvalidVertexIndex);
|
corner_to_vertex_map_.assign(num_faces * 3, kInvalidVertexIndex);
|
||||||
opposite_corners_.assign(num_faces * 3, kInvalidCornerIndex);
|
opposite_corners_.assign(num_faces * 3, kInvalidCornerIndex);
|
||||||
vertex_corners_.reserve(num_vertices);
|
vertex_corners_.reserve(num_vertices);
|
||||||
|
ClearValenceCache();
|
||||||
|
ClearValenceCacheInaccurate();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CornerTable::ComputeOppositeCorners(int *num_vertices) {
|
bool CornerTable::ComputeOppositeCorners(int *num_vertices) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
if (num_vertices == nullptr)
|
if (num_vertices == nullptr)
|
||||||
return false;
|
return false;
|
||||||
opposite_corners_.resize(num_corners(), kInvalidCornerIndex);
|
opposite_corners_.resize(num_corners(), kInvalidCornerIndex);
|
||||||
@ -95,9 +101,10 @@ bool CornerTable::ComputeOppositeCorners(int *num_vertices) {
|
|||||||
// and the associated half-edge corner id (corner opposite to the half-edge).
|
// and the associated half-edge corner id (corner opposite to the half-edge).
|
||||||
// Each vertex will be assigned storage for up to
|
// Each vertex will be assigned storage for up to
|
||||||
// |num_corners_on_vertices[vert_id]| half-edges. Unused half-edges are marked
|
// |num_corners_on_vertices[vert_id]| half-edges. Unused half-edges are marked
|
||||||
// with |sink_vert| == -1.
|
// with |sink_vert| == kInvalidVertexIndex.
|
||||||
struct VertexEdgePair {
|
struct VertexEdgePair {
|
||||||
VertexEdgePair() : sink_vert(-1), edge_corner(-1) {}
|
VertexEdgePair()
|
||||||
|
: sink_vert(kInvalidVertexIndex), edge_corner(kInvalidCornerIndex) {}
|
||||||
VertexIndex sink_vert;
|
VertexIndex sink_vert;
|
||||||
CornerIndex edge_corner;
|
CornerIndex edge_corner;
|
||||||
};
|
};
|
||||||
@ -132,14 +139,14 @@ bool CornerTable::ComputeOppositeCorners(int *num_vertices) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CornerIndex opposite_c(-1);
|
CornerIndex opposite_c(kInvalidCornerIndex);
|
||||||
// The maximum number of half-edges attached to the sink vertex.
|
// The maximum number of half-edges attached to the sink vertex.
|
||||||
const int num_corners_on_vert = num_corners_on_vertices[sink_v.value()];
|
const int num_corners_on_vert = num_corners_on_vertices[sink_v.value()];
|
||||||
// Where to look for the first half-edge on the sink vertex.
|
// Where to look for the first half-edge on the sink vertex.
|
||||||
offset = vertex_offset[sink_v.value()];
|
offset = vertex_offset[sink_v.value()];
|
||||||
for (int i = 0; i < num_corners_on_vert; ++i, ++offset) {
|
for (int i = 0; i < num_corners_on_vert; ++i, ++offset) {
|
||||||
const VertexIndex other_v = vertex_edges[offset].sink_vert;
|
const VertexIndex other_v = vertex_edges[offset].sink_vert;
|
||||||
if (other_v < 0)
|
if (other_v == kInvalidVertexIndex)
|
||||||
break; // No matching half-edge found on the sink vertex.
|
break; // No matching half-edge found on the sink vertex.
|
||||||
if (other_v == source_v) {
|
if (other_v == source_v) {
|
||||||
// A matching half-edge was found on the sink vertex. Mark the
|
// A matching half-edge was found on the sink vertex. Mark the
|
||||||
@ -152,22 +159,22 @@ bool CornerTable::ComputeOppositeCorners(int *num_vertices) {
|
|||||||
// slot.
|
// slot.
|
||||||
for (int j = i + 1; j < num_corners_on_vert; ++j, ++offset) {
|
for (int j = i + 1; j < num_corners_on_vert; ++j, ++offset) {
|
||||||
vertex_edges[offset] = vertex_edges[offset + 1];
|
vertex_edges[offset] = vertex_edges[offset + 1];
|
||||||
if (vertex_edges[offset].sink_vert < 0)
|
if (vertex_edges[offset].sink_vert == kInvalidVertexIndex)
|
||||||
break; // Unused half-edge reached.
|
break; // Unused half-edge reached.
|
||||||
}
|
}
|
||||||
// Mark the last entry as unused.
|
// Mark the last entry as unused.
|
||||||
vertex_edges[offset].sink_vert = VertexIndex(-1);
|
vertex_edges[offset].sink_vert = kInvalidVertexIndex;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (opposite_c < 0) {
|
if (opposite_c == kInvalidCornerIndex) {
|
||||||
// No opposite corner found. Insert the new edge
|
// No opposite corner found. Insert the new edge
|
||||||
const int num_corners_on_source_vert =
|
const int num_corners_on_source_vert =
|
||||||
num_corners_on_vertices[source_v.value()];
|
num_corners_on_vertices[source_v.value()];
|
||||||
offset = vertex_offset[source_v.value()];
|
offset = vertex_offset[source_v.value()];
|
||||||
for (int i = 0; i < num_corners_on_source_vert; ++i, ++offset) {
|
for (int i = 0; i < num_corners_on_source_vert; ++i, ++offset) {
|
||||||
// Find the first unused half-edge slot on the source vertex.
|
// Find the first unused half-edge slot on the source vertex.
|
||||||
if (vertex_edges[offset].sink_vert < 0) {
|
if (vertex_edges[offset].sink_vert == kInvalidVertexIndex) {
|
||||||
vertex_edges[offset].sink_vert = sink_v;
|
vertex_edges[offset].sink_vert = sink_v;
|
||||||
vertex_edges[offset].edge_corner = c;
|
vertex_edges[offset].edge_corner = c;
|
||||||
break;
|
break;
|
||||||
@ -184,6 +191,8 @@ bool CornerTable::ComputeOppositeCorners(int *num_vertices) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CornerTable::ComputeVertexCorners(int num_vertices) {
|
bool CornerTable::ComputeVertexCorners(int num_vertices) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
num_original_vertices_ = num_vertices;
|
num_original_vertices_ = num_vertices;
|
||||||
vertex_corners_.resize(num_vertices, kInvalidCornerIndex);
|
vertex_corners_.resize(num_vertices, kInvalidCornerIndex);
|
||||||
// Arrays for marking visited vertices and corners that allow us to detect
|
// Arrays for marking visited vertices and corners that allow us to detect
|
||||||
@ -275,6 +284,12 @@ bool CornerTable::IsDegenerated(FaceIndex face) const {
|
|||||||
int CornerTable::Valence(VertexIndex v) const {
|
int CornerTable::Valence(VertexIndex v) const {
|
||||||
if (v == kInvalidVertexIndex)
|
if (v == kInvalidVertexIndex)
|
||||||
return -1;
|
return -1;
|
||||||
|
return ConfidentValence(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CornerTable::ConfidentValence(VertexIndex v) const {
|
||||||
|
DCHECK_GE(v.value(), 0);
|
||||||
|
DCHECK_LT(v.value(), num_vertices());
|
||||||
VertexRingIterator vi(this, v);
|
VertexRingIterator vi(this, v);
|
||||||
int valence = 0;
|
int valence = 0;
|
||||||
for (; !vi.End(); vi.Next()) {
|
for (; !vi.End(); vi.Next()) {
|
||||||
@ -284,6 +299,8 @@ int CornerTable::Valence(VertexIndex v) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CornerTable::UpdateFaceToVertexMap(const VertexIndex vertex) {
|
void CornerTable::UpdateFaceToVertexMap(const VertexIndex vertex) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
VertexCornersIterator<CornerTable> it(this, vertex);
|
VertexCornersIterator<CornerTable> it(this, vertex);
|
||||||
for (; !it.End(); ++it) {
|
for (; !it.End(); ++it) {
|
||||||
const CornerIndex corner = *it;
|
const CornerIndex corner = *it;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "draco/attributes/geometry_indices.h"
|
#include "draco/attributes/geometry_indices.h"
|
||||||
#include "draco/core/draco_index_type_vector.h"
|
#include "draco/core/draco_index_type_vector.h"
|
||||||
|
#include "draco/core/macros.h"
|
||||||
|
|
||||||
namespace draco {
|
namespace draco {
|
||||||
|
|
||||||
@ -73,32 +74,37 @@ class CornerTable {
|
|||||||
inline int num_faces() const { return corner_to_vertex_map_.size() / 3; }
|
inline int num_faces() const { return corner_to_vertex_map_.size() / 3; }
|
||||||
|
|
||||||
inline CornerIndex Opposite(CornerIndex corner) const {
|
inline CornerIndex Opposite(CornerIndex corner) const {
|
||||||
if (corner < 0)
|
if (corner == kInvalidCornerIndex)
|
||||||
return corner;
|
return corner;
|
||||||
return opposite_corners_[corner];
|
return opposite_corners_[corner];
|
||||||
}
|
}
|
||||||
inline CornerIndex Next(CornerIndex corner) const {
|
inline CornerIndex Next(CornerIndex corner) const {
|
||||||
if (corner < 0)
|
if (corner == kInvalidCornerIndex)
|
||||||
return corner;
|
return corner;
|
||||||
return LocalIndex(++corner) ? corner : corner - 3;
|
return LocalIndex(++corner) ? corner : corner - 3;
|
||||||
}
|
}
|
||||||
inline CornerIndex Previous(CornerIndex corner) const {
|
inline CornerIndex Previous(CornerIndex corner) const {
|
||||||
if (corner < 0)
|
if (corner == kInvalidCornerIndex)
|
||||||
return corner;
|
return corner;
|
||||||
return LocalIndex(corner) ? corner - 1 : corner + 2;
|
return LocalIndex(corner) ? corner - 1 : corner + 2;
|
||||||
}
|
}
|
||||||
inline VertexIndex Vertex(CornerIndex corner) const {
|
inline VertexIndex Vertex(CornerIndex corner) const {
|
||||||
if (corner < 0)
|
if (corner == kInvalidCornerIndex)
|
||||||
return kInvalidVertexIndex;
|
return kInvalidVertexIndex;
|
||||||
|
return ConfidentVertex(corner);
|
||||||
|
}
|
||||||
|
inline VertexIndex ConfidentVertex(CornerIndex corner) const {
|
||||||
|
DCHECK_GE(corner.value(), 0);
|
||||||
|
DCHECK_LT(corner.value(), num_corners());
|
||||||
return corner_to_vertex_map_[corner];
|
return corner_to_vertex_map_[corner];
|
||||||
}
|
}
|
||||||
inline FaceIndex Face(CornerIndex corner) const {
|
inline FaceIndex Face(CornerIndex corner) const {
|
||||||
if (corner < 0)
|
if (corner == kInvalidCornerIndex)
|
||||||
return kInvalidFaceIndex;
|
return kInvalidFaceIndex;
|
||||||
return FaceIndex(corner.value() / 3);
|
return FaceIndex(corner.value() / 3);
|
||||||
}
|
}
|
||||||
inline CornerIndex FirstCorner(FaceIndex face) const {
|
inline CornerIndex FirstCorner(FaceIndex face) const {
|
||||||
if (face < 0)
|
if (face == kInvalidFaceIndex)
|
||||||
return kInvalidCornerIndex;
|
return kInvalidCornerIndex;
|
||||||
return CornerIndex(face.value() * 3);
|
return CornerIndex(face.value() * 3);
|
||||||
}
|
}
|
||||||
@ -118,6 +124,8 @@ class CornerTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetFaceData(FaceIndex face, FaceType data) {
|
void SetFaceData(FaceIndex face, FaceType data) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
const CornerIndex first_corner = FirstCorner(face);
|
const CornerIndex first_corner = FirstCorner(face);
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
corner_to_vertex_map_[first_corner + i] = data[i];
|
corner_to_vertex_map_[first_corner + i] = data[i];
|
||||||
@ -146,18 +154,70 @@ class CornerTable {
|
|||||||
// Returns the valence (or degree) of a vertex.
|
// Returns the valence (or degree) of a vertex.
|
||||||
// Returns -1 if the given vertex index is not valid.
|
// Returns -1 if the given vertex index is not valid.
|
||||||
int Valence(VertexIndex v) const;
|
int Valence(VertexIndex v) const;
|
||||||
|
// Same as above but does not check for validity and does not return -1
|
||||||
|
int ConfidentValence(VertexIndex v) const;
|
||||||
|
// Same as above, do not call before CacheValences() /
|
||||||
|
// CacheValencesInaccurate().
|
||||||
|
inline int8_t ValenceFromCacheInaccurate(VertexIndex v) const {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), num_vertices());
|
||||||
|
if (v == kInvalidVertexIndex || v.value() >= num_vertices())
|
||||||
|
return -1;
|
||||||
|
return ConfidentValenceFromCacheInaccurate(v);
|
||||||
|
}
|
||||||
|
inline int8_t ConfidentValenceFromCacheInaccurate(VertexIndex v) const {
|
||||||
|
DCHECK_LT(v.value(), num_vertices());
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), num_vertices());
|
||||||
|
return vertex_valence_cache_8_bit_[v];
|
||||||
|
}
|
||||||
|
// TODO(scottgodfrey) Add unit tests for ValenceCache functions.
|
||||||
|
inline int32_t ValenceFromCache(VertexIndex v) const {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), num_vertices());
|
||||||
|
if (v == kInvalidVertexIndex || v.value() >= num_vertices())
|
||||||
|
return -1;
|
||||||
|
return ConfidentValenceFromCache(v);
|
||||||
|
}
|
||||||
|
inline int32_t ConfidentValenceFromCache(VertexIndex v) const {
|
||||||
|
DCHECK_LT(v.value(), num_vertices());
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), num_vertices());
|
||||||
|
return vertex_valence_cache_32_bit_[v];
|
||||||
|
}
|
||||||
// Returns the valence of the vertex at the given corner.
|
// Returns the valence of the vertex at the given corner.
|
||||||
inline int Valence(CornerIndex c) const {
|
inline int Valence(CornerIndex c) const {
|
||||||
if (c == kInvalidCornerIndex)
|
if (c == kInvalidCornerIndex)
|
||||||
return -1;
|
return -1;
|
||||||
return Valence(Vertex(c));
|
return ConfidentValence(c);
|
||||||
|
}
|
||||||
|
inline int ConfidentValence(CornerIndex c) const {
|
||||||
|
DCHECK_LT(c.value(), num_corners());
|
||||||
|
return ConfidentValence(ConfidentVertex(c));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not call before CacheValences() / CacheValencesInaccurate().
|
||||||
|
inline int8_t ValenceFromCacheInaccurate(CornerIndex c) const {
|
||||||
|
if (c == kInvalidCornerIndex)
|
||||||
|
return -1;
|
||||||
|
return ValenceFromCacheInaccurate(Vertex(c));
|
||||||
|
}
|
||||||
|
inline int32_t ValenceFromCache(CornerIndex c) const {
|
||||||
|
if (c == kInvalidCornerIndex)
|
||||||
|
return -1;
|
||||||
|
return ValenceFromCache(Vertex(c));
|
||||||
|
}
|
||||||
|
inline int8_t ConfidentValenceFromCacheInaccurate(CornerIndex c) const {
|
||||||
|
DCHECK_GE(c.value(), 0);
|
||||||
|
DCHECK_LT(c.value(), num_corners());
|
||||||
|
return ConfidentValenceFromCacheInaccurate(ConfidentVertex(c));
|
||||||
|
}
|
||||||
|
inline int32_t ConfidentValenceFromCache(CornerIndex c) const {
|
||||||
|
DCHECK_GE(c.value(), 0);
|
||||||
|
DCHECK_LT(c.value(), num_corners());
|
||||||
|
return ConfidentValenceFromCache(ConfidentVertex(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the specified vertex is on a boundary.
|
// Returns true if the specified vertex is on a boundary.
|
||||||
inline bool IsOnBoundary(VertexIndex vert) const {
|
inline bool IsOnBoundary(VertexIndex vert) const {
|
||||||
const CornerIndex corner = LeftMostCorner(vert);
|
const CornerIndex corner = LeftMostCorner(vert);
|
||||||
if (SwingLeft(corner) < 0)
|
if (SwingLeft(corner) == kInvalidCornerIndex)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -186,13 +246,13 @@ class CornerTable {
|
|||||||
// \ / \ /
|
// \ / \ /
|
||||||
// \ / \ /
|
// \ / \ /
|
||||||
// *-------*
|
// *-------*
|
||||||
CornerIndex GetLeftCorner(CornerIndex corner_id) const {
|
inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
|
||||||
if (corner_id < 0)
|
if (corner_id == kInvalidCornerIndex)
|
||||||
return kInvalidCornerIndex;
|
return kInvalidCornerIndex;
|
||||||
return Opposite(Previous(corner_id));
|
return Opposite(Previous(corner_id));
|
||||||
}
|
}
|
||||||
CornerIndex GetRightCorner(CornerIndex corner_id) const {
|
inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
|
||||||
if (corner_id < 0)
|
if (corner_id == kInvalidCornerIndex)
|
||||||
return kInvalidCornerIndex;
|
return kInvalidCornerIndex;
|
||||||
return Opposite(Next(corner_id));
|
return Opposite(Next(corner_id));
|
||||||
}
|
}
|
||||||
@ -216,11 +276,15 @@ class CornerTable {
|
|||||||
// that the indices are valid.
|
// that the indices are valid.
|
||||||
inline void SetOppositeCorner(CornerIndex corner_id,
|
inline void SetOppositeCorner(CornerIndex corner_id,
|
||||||
CornerIndex opp_corner_id) {
|
CornerIndex opp_corner_id) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
opposite_corners_[corner_id] = opp_corner_id;
|
opposite_corners_[corner_id] = opp_corner_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets opposite corners for both input corners.
|
// Sets opposite corners for both input corners.
|
||||||
inline void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
|
inline void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
if (corner_0 != kInvalidCornerIndex)
|
if (corner_0 != kInvalidCornerIndex)
|
||||||
SetOppositeCorner(corner_0, corner_1);
|
SetOppositeCorner(corner_0, corner_1);
|
||||||
if (corner_1 != kInvalidCornerIndex)
|
if (corner_1 != kInvalidCornerIndex)
|
||||||
@ -229,10 +293,14 @@ class CornerTable {
|
|||||||
|
|
||||||
// Updates mapping between a corner and a vertex.
|
// Updates mapping between a corner and a vertex.
|
||||||
inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
|
inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
corner_to_vertex_map_[corner_id] = vert_id;
|
corner_to_vertex_map_[corner_id] = vert_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
VertexIndex AddNewVertex() {
|
VertexIndex AddNewVertex() {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
// Add a new invalid vertex.
|
// Add a new invalid vertex.
|
||||||
vertex_corners_.push_back(kInvalidCornerIndex);
|
vertex_corners_.push_back(kInvalidCornerIndex);
|
||||||
return VertexIndex(vertex_corners_.size() - 1);
|
return VertexIndex(vertex_corners_.size() - 1);
|
||||||
@ -240,6 +308,8 @@ class CornerTable {
|
|||||||
|
|
||||||
// Sets a new left most corner for a given vertex.
|
// Sets a new left most corner for a given vertex.
|
||||||
void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
|
void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
if (vert != kInvalidVertexIndex)
|
if (vert != kInvalidVertexIndex)
|
||||||
vertex_corners_[vert] = corner;
|
vertex_corners_[vert] = corner;
|
||||||
}
|
}
|
||||||
@ -248,12 +318,14 @@ class CornerTable {
|
|||||||
// called in cases where the mapping may be invalid (e.g. when the corner
|
// called in cases where the mapping may be invalid (e.g. when the corner
|
||||||
// table was constructed manually).
|
// table was constructed manually).
|
||||||
void UpdateVertexToCornerMap(VertexIndex vert) {
|
void UpdateVertexToCornerMap(VertexIndex vert) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
const CornerIndex first_c = vertex_corners_[vert];
|
const CornerIndex first_c = vertex_corners_[vert];
|
||||||
if (first_c < 0)
|
if (first_c == kInvalidCornerIndex)
|
||||||
return; // Isolated vertex.
|
return; // Isolated vertex.
|
||||||
CornerIndex act_c = SwingLeft(first_c);
|
CornerIndex act_c = SwingLeft(first_c);
|
||||||
CornerIndex c = first_c;
|
CornerIndex c = first_c;
|
||||||
while (act_c >= 0 && act_c != first_c) {
|
while (act_c != kInvalidCornerIndex && act_c != first_c) {
|
||||||
c = act_c;
|
c = act_c;
|
||||||
act_c = SwingLeft(act_c);
|
act_c = SwingLeft(act_c);
|
||||||
}
|
}
|
||||||
@ -266,21 +338,27 @@ class CornerTable {
|
|||||||
// ensure that no corner is mapped beyond the range of the new number of
|
// ensure that no corner is mapped beyond the range of the new number of
|
||||||
// vertices.
|
// vertices.
|
||||||
inline void SetNumVertices(int num_vertices) {
|
inline void SetNumVertices(int num_vertices) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
vertex_corners_.resize(num_vertices, kInvalidCornerIndex);
|
vertex_corners_.resize(num_vertices, kInvalidCornerIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Makes a vertex isolated (not attached to any corner).
|
// Makes a vertex isolated (not attached to any corner).
|
||||||
void MakeVertexIsolated(VertexIndex vert) {
|
void MakeVertexIsolated(VertexIndex vert) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
vertex_corners_[vert] = kInvalidCornerIndex;
|
vertex_corners_[vert] = kInvalidCornerIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if a vertex is not attached to any face.
|
// Returns true if a vertex is not attached to any face.
|
||||||
inline bool IsVertexIsolated(VertexIndex v) const {
|
inline bool IsVertexIsolated(VertexIndex v) const {
|
||||||
return LeftMostCorner(v) < 0;
|
return LeftMostCorner(v) == kInvalidCornerIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Makes a given face invalid (all corners are marked as invalid).
|
// Makes a given face invalid (all corners are marked as invalid).
|
||||||
void MakeFaceInvalid(FaceIndex face) {
|
void MakeFaceInvalid(FaceIndex face) {
|
||||||
|
DCHECK_EQ(vertex_valence_cache_8_bit_.size(), 0);
|
||||||
|
DCHECK_EQ(vertex_valence_cache_32_bit_.size(), 0);
|
||||||
if (face != kInvalidFaceIndex) {
|
if (face != kInvalidFaceIndex) {
|
||||||
const CornerIndex first_corner = FirstCorner(face);
|
const CornerIndex first_corner = FirstCorner(face);
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
@ -293,6 +371,46 @@ class CornerTable {
|
|||||||
// the provided vertex.
|
// the provided vertex.
|
||||||
void UpdateFaceToVertexMap(const VertexIndex vertex);
|
void UpdateFaceToVertexMap(const VertexIndex vertex);
|
||||||
|
|
||||||
|
// Collect the valence for all vertices so they can be reused later. The
|
||||||
|
// 'inaccurate' versions of this family of functions clips the true valence
|
||||||
|
// of the vertices to 8 signed bits as a space optimization. This clipping
|
||||||
|
// will lead to occasionally wrong results. If accurate results are required
|
||||||
|
// under all circumstances, do not use the 'inaccurate' version or else
|
||||||
|
// use it and fetch the correct result in the event the value appears clipped.
|
||||||
|
// The topology of the mesh should be a constant when Valence Cache functions
|
||||||
|
// are being used. Modification of the mesh while cache(s) are filled will
|
||||||
|
// not guarantee proper results on subsequent calls unless they are rebuilt.
|
||||||
|
void CacheValencesInaccurate() const {
|
||||||
|
if (vertex_valence_cache_8_bit_.size() == 0) {
|
||||||
|
const VertexIndex vertex_count = VertexIndex(num_vertices());
|
||||||
|
vertex_valence_cache_8_bit_.resize(vertex_count.value());
|
||||||
|
for (VertexIndex v = VertexIndex(0); v < vertex_count; v += 1)
|
||||||
|
vertex_valence_cache_8_bit_[v] = static_cast<int8_t>(
|
||||||
|
(std::min)(static_cast<int32_t>(std::numeric_limits<int8_t>::max()),
|
||||||
|
Valence(v)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void CacheValences() const {
|
||||||
|
if (vertex_valence_cache_32_bit_.size() == 0) {
|
||||||
|
const VertexIndex vertex_count = VertexIndex(num_vertices());
|
||||||
|
vertex_valence_cache_32_bit_.resize(vertex_count.value());
|
||||||
|
for (VertexIndex v = VertexIndex(0); v < vertex_count; v += 1)
|
||||||
|
vertex_valence_cache_32_bit_[v] = Valence(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear the cache of valences and deallocate the memory.
|
||||||
|
void ClearValenceCacheInaccurate() const {
|
||||||
|
vertex_valence_cache_8_bit_.clear();
|
||||||
|
// Force erasure.
|
||||||
|
IndexTypeVector<VertexIndex, int8_t>().swap(vertex_valence_cache_8_bit_);
|
||||||
|
}
|
||||||
|
void ClearValenceCache() const {
|
||||||
|
vertex_valence_cache_32_bit_.clear();
|
||||||
|
// Force erasure.
|
||||||
|
IndexTypeVector<VertexIndex, int32_t>().swap(vertex_valence_cache_32_bit_);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Computes opposite corners mapping from the data stored in
|
// Computes opposite corners mapping from the data stored in
|
||||||
// |corner_to_vertex_map_|. Any non-manifold edge will be split so the result
|
// |corner_to_vertex_map_|. Any non-manifold edge will be split so the result
|
||||||
@ -313,6 +431,10 @@ class CornerTable {
|
|||||||
int num_degenerated_faces_;
|
int num_degenerated_faces_;
|
||||||
int num_isolated_vertices_;
|
int num_isolated_vertices_;
|
||||||
IndexTypeVector<VertexIndex, VertexIndex> non_manifold_vertex_parents_;
|
IndexTypeVector<VertexIndex, VertexIndex> non_manifold_vertex_parents_;
|
||||||
|
|
||||||
|
// Retain valences and clip them to char size.
|
||||||
|
mutable IndexTypeVector<VertexIndex, int8_t> vertex_valence_cache_8_bit_;
|
||||||
|
mutable IndexTypeVector<VertexIndex, int32_t> vertex_valence_cache_32_bit_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(ostava): All these iterators will be moved into a new file in a separate
|
// TODO(ostava): All these iterators will be moved into a new file in a separate
|
||||||
@ -344,13 +466,13 @@ class VertexRingIterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when all ring vertices have been visited.
|
// Returns true when all ring vertices have been visited.
|
||||||
bool End() const { return corner_ < 0; }
|
bool End() const { return corner_ == kInvalidCornerIndex; }
|
||||||
|
|
||||||
// Proceeds to the next ring vertex if possible.
|
// Proceeds to the next ring vertex if possible.
|
||||||
void Next() {
|
void Next() {
|
||||||
if (left_traversal_) {
|
if (left_traversal_) {
|
||||||
corner_ = corner_table_->SwingLeft(corner_);
|
corner_ = corner_table_->SwingLeft(corner_);
|
||||||
if (corner_ < 0) {
|
if (corner_ == kInvalidCornerIndex) {
|
||||||
// Open boundary reached.
|
// Open boundary reached.
|
||||||
corner_ = start_corner_;
|
corner_ = start_corner_;
|
||||||
left_traversal_ = false;
|
left_traversal_ = false;
|
||||||
@ -417,7 +539,7 @@ class FaceAdjacencyIterator
|
|||||||
corner_(start_corner_) {
|
corner_(start_corner_) {
|
||||||
// We need to start with a corner that has a valid opposite face (if
|
// We need to start with a corner that has a valid opposite face (if
|
||||||
// there is any such corner).
|
// there is any such corner).
|
||||||
if (corner_table_->Opposite(corner_) < 0)
|
if (corner_table_->Opposite(corner_) == kInvalidCornerIndex)
|
||||||
FindNextFaceNeighbor();
|
FindNextFaceNeighbor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +549,7 @@ class FaceAdjacencyIterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns true when all adjacent faces have been visited.
|
// Returns true when all adjacent faces have been visited.
|
||||||
bool End() const { return corner_ < 0; }
|
bool End() const { return corner_ == kInvalidCornerIndex; }
|
||||||
|
|
||||||
// Proceeds to the next adjacent face if possible.
|
// Proceeds to the next adjacent face if possible.
|
||||||
void Next() { FindNextFaceNeighbor(); }
|
void Next() { FindNextFaceNeighbor(); }
|
||||||
@ -460,13 +582,13 @@ class FaceAdjacencyIterator
|
|||||||
private:
|
private:
|
||||||
// Finds the next corner with a valid opposite face.
|
// Finds the next corner with a valid opposite face.
|
||||||
void FindNextFaceNeighbor() {
|
void FindNextFaceNeighbor() {
|
||||||
while (corner_ >= 0) {
|
while (corner_ != kInvalidCornerIndex) {
|
||||||
corner_ = corner_table_->Next(corner_);
|
corner_ = corner_table_->Next(corner_);
|
||||||
if (corner_ == start_corner_) {
|
if (corner_ == start_corner_) {
|
||||||
corner_ = kInvalidCornerIndex;
|
corner_ = kInvalidCornerIndex;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (corner_table_->Opposite(corner_) >= 0) {
|
if (corner_table_->Opposite(corner_) != kInvalidCornerIndex) {
|
||||||
// Valid opposite face.
|
// Valid opposite face.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -51,13 +51,13 @@ class VertexCornersIterator
|
|||||||
CornerIndex Corner() const { return corner_; }
|
CornerIndex Corner() const { return corner_; }
|
||||||
|
|
||||||
// Returns true when all ring vertices have been visited.
|
// Returns true when all ring vertices have been visited.
|
||||||
bool End() const { return corner_ < 0; }
|
bool End() const { return corner_ == kInvalidCornerIndex; }
|
||||||
|
|
||||||
// Proceeds to the next corner if possible.
|
// Proceeds to the next corner if possible.
|
||||||
void Next() {
|
void Next() {
|
||||||
if (left_traversal_) {
|
if (left_traversal_) {
|
||||||
corner_ = corner_table_->SwingLeft(corner_);
|
corner_ = corner_table_->SwingLeft(corner_);
|
||||||
if (corner_ < 0) {
|
if (corner_ == kInvalidCornerIndex) {
|
||||||
// Open boundary reached.
|
// Open boundary reached.
|
||||||
corner_ = corner_table_->SwingRight(start_corner_);
|
corner_ = corner_table_->SwingRight(start_corner_);
|
||||||
left_traversal_ = false;
|
left_traversal_ = false;
|
||||||
|
@ -40,14 +40,14 @@ class CornerTableTraversalProcessor {
|
|||||||
const CornerTable &GetCornerTable() const { return *corner_table_; }
|
const CornerTable &GetCornerTable() const { return *corner_table_; }
|
||||||
|
|
||||||
inline bool IsFaceVisited(FaceIndex face_id) const {
|
inline bool IsFaceVisited(FaceIndex face_id) const {
|
||||||
if (face_id < 0)
|
if (face_id == kInvalidFaceIndex)
|
||||||
return true; // Invalid faces are always considered as visited.
|
return true; // Invalid faces are always considered as visited.
|
||||||
return is_face_visited_[face_id.value()];
|
return is_face_visited_[face_id.value()];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the face containing the given corner was visited.
|
// Returns true if the face containing the given corner was visited.
|
||||||
inline bool IsFaceVisited(CornerIndex corner_id) const {
|
inline bool IsFaceVisited(CornerIndex corner_id) const {
|
||||||
if (corner_id < 0)
|
if (corner_id == kInvalidCornerIndex)
|
||||||
return true; // Invalid faces are always considered as visited.
|
return true; // Invalid faces are always considered as visited.
|
||||||
return is_face_visited_[corner_id.value() / 3];
|
return is_face_visited_[corner_id.value() / 3];
|
||||||
}
|
}
|
||||||
|
@ -136,13 +136,13 @@ class EdgeBreakerTraverser {
|
|||||||
corner_id = corner_traversal_stack_.back();
|
corner_id = corner_traversal_stack_.back();
|
||||||
FaceIndex face_id(corner_id.value() / 3);
|
FaceIndex face_id(corner_id.value() / 3);
|
||||||
// Make sure the face hasn't been visited yet.
|
// Make sure the face hasn't been visited yet.
|
||||||
if (corner_id < 0 || processor_.IsFaceVisited(face_id)) {
|
if (corner_id == kInvalidCornerIndex ||
|
||||||
|
processor_.IsFaceVisited(face_id)) {
|
||||||
// This face has been already traversed.
|
// This face has been already traversed.
|
||||||
corner_traversal_stack_.pop_back();
|
corner_traversal_stack_.pop_back();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
while (true) {
|
while (true) {
|
||||||
face_id = FaceIndex(corner_id.value() / 3);
|
|
||||||
processor_.MarkFaceVisited(face_id);
|
processor_.MarkFaceVisited(face_id);
|
||||||
traversal_observer_.OnNewFaceVisited(face_id);
|
traversal_observer_.OnNewFaceVisited(face_id);
|
||||||
const VertexIndex vert_id = corner_table_->Vertex(corner_id);
|
const VertexIndex vert_id = corner_table_->Vertex(corner_id);
|
||||||
@ -153,6 +153,7 @@ class EdgeBreakerTraverser {
|
|||||||
if (!on_boundary) {
|
if (!on_boundary) {
|
||||||
edgebreaker_observer_.OnSymbolC();
|
edgebreaker_observer_.OnSymbolC();
|
||||||
corner_id = corner_table_->GetRightCorner(corner_id);
|
corner_id = corner_table_->GetRightCorner(corner_id);
|
||||||
|
face_id = FaceIndex(corner_id.value() / 3);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,9 +165,13 @@ class EdgeBreakerTraverser {
|
|||||||
const CornerIndex left_corner_id =
|
const CornerIndex left_corner_id =
|
||||||
corner_table_->GetLeftCorner(corner_id);
|
corner_table_->GetLeftCorner(corner_id);
|
||||||
const FaceIndex right_face_id(
|
const FaceIndex right_face_id(
|
||||||
(right_corner_id < 0 ? -1 : right_corner_id.value() / 3));
|
(right_corner_id == kInvalidCornerIndex
|
||||||
|
? kInvalidFaceIndex
|
||||||
|
: FaceIndex(right_corner_id.value() / 3)));
|
||||||
const FaceIndex left_face_id(
|
const FaceIndex left_face_id(
|
||||||
(left_corner_id < 0 ? -1 : left_corner_id.value() / 3));
|
(left_corner_id == kInvalidCornerIndex
|
||||||
|
? kInvalidFaceIndex
|
||||||
|
: FaceIndex(left_corner_id.value() / 3)));
|
||||||
if (processor_.IsFaceVisited(right_face_id)) {
|
if (processor_.IsFaceVisited(right_face_id)) {
|
||||||
// Right face has been already visited.
|
// Right face has been already visited.
|
||||||
if (processor_.IsFaceVisited(left_face_id)) {
|
if (processor_.IsFaceVisited(left_face_id)) {
|
||||||
@ -178,6 +183,7 @@ class EdgeBreakerTraverser {
|
|||||||
edgebreaker_observer_.OnSymbolR();
|
edgebreaker_observer_.OnSymbolR();
|
||||||
// Go to the left face.
|
// Go to the left face.
|
||||||
corner_id = left_corner_id;
|
corner_id = left_corner_id;
|
||||||
|
face_id = left_face_id;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Right face was not visited.
|
// Right face was not visited.
|
||||||
@ -185,6 +191,7 @@ class EdgeBreakerTraverser {
|
|||||||
edgebreaker_observer_.OnSymbolL();
|
edgebreaker_observer_.OnSymbolL();
|
||||||
// Left face visited, go to the right one.
|
// Left face visited, go to the right one.
|
||||||
corner_id = right_corner_id;
|
corner_id = right_corner_id;
|
||||||
|
face_id = right_face_id;
|
||||||
} else {
|
} else {
|
||||||
edgebreaker_observer_.OnSymbolS();
|
edgebreaker_observer_.OnSymbolS();
|
||||||
// Both neighboring faces are unvisited, we need to visit both of
|
// Both neighboring faces are unvisited, we need to visit both of
|
||||||
|
@ -43,19 +43,19 @@ bool MeshAttributeCornerTable::InitFromAttribute(const Mesh *mesh,
|
|||||||
// Find all necessary data for encoding attributes. For now we check which of
|
// Find all necessary data for encoding attributes. For now we check which of
|
||||||
// the mesh vertices is part of an attribute seam, because seams require
|
// the mesh vertices is part of an attribute seam, because seams require
|
||||||
// special handling.
|
// special handling.
|
||||||
for (int c = 0; c < corner_table_->num_corners(); ++c) {
|
for (CornerIndex c(0); c < corner_table_->num_corners(); ++c) {
|
||||||
const FaceIndex f = corner_table_->Face(CornerIndex(c));
|
const FaceIndex f = corner_table_->Face(c);
|
||||||
if (corner_table_->IsDegenerated(f))
|
if (corner_table_->IsDegenerated(f))
|
||||||
continue; // Ignore corners on degenerated faces.
|
continue; // Ignore corners on degenerated faces.
|
||||||
const CornerIndex opp_corner = corner_table_->Opposite(CornerIndex(c));
|
const CornerIndex opp_corner = corner_table_->Opposite(c);
|
||||||
if (opp_corner < 0) {
|
if (opp_corner == kInvalidCornerIndex) {
|
||||||
// Boundary. Mark it as seam edge.
|
// Boundary. Mark it as seam edge.
|
||||||
is_edge_on_seam_[c] = true;
|
is_edge_on_seam_[c.value()] = true;
|
||||||
// Mark seam vertices.
|
// Mark seam vertices.
|
||||||
VertexIndex v;
|
VertexIndex v;
|
||||||
v = corner_table_->Vertex(corner_table_->Next(CornerIndex(c)));
|
v = corner_table_->Vertex(corner_table_->Next(c));
|
||||||
is_vertex_on_seam_[v.value()] = true;
|
is_vertex_on_seam_[v.value()] = true;
|
||||||
v = corner_table_->Vertex(corner_table_->Previous(CornerIndex(c)));
|
v = corner_table_->Vertex(corner_table_->Previous(c));
|
||||||
is_vertex_on_seam_[v.value()] = true;
|
is_vertex_on_seam_[v.value()] = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ bool MeshAttributeCornerTable::InitFromAttribute(const Mesh *mesh,
|
|||||||
mesh->CornerToPointId(act_sibling_c.value());
|
mesh->CornerToPointId(act_sibling_c.value());
|
||||||
if (att->mapped_index(point_id) != att->mapped_index(sibling_point_id)) {
|
if (att->mapped_index(point_id) != att->mapped_index(sibling_point_id)) {
|
||||||
no_interior_seams_ = false;
|
no_interior_seams_ = false;
|
||||||
is_edge_on_seam_[c] = true;
|
is_edge_on_seam_[c.value()] = true;
|
||||||
is_edge_on_seam_[opp_corner.value()] = true;
|
is_edge_on_seam_[opp_corner.value()] = true;
|
||||||
// Mark seam vertices.
|
// Mark seam vertices.
|
||||||
is_vertex_on_seam_[corner_table_
|
is_vertex_on_seam_[corner_table_
|
||||||
@ -105,7 +105,7 @@ void MeshAttributeCornerTable::AddSeamEdge(CornerIndex c) {
|
|||||||
.value()] = true;
|
.value()] = true;
|
||||||
|
|
||||||
const CornerIndex opp_corner = corner_table_->Opposite(c);
|
const CornerIndex opp_corner = corner_table_->Opposite(c);
|
||||||
if (opp_corner >= 0) {
|
if (opp_corner != kInvalidCornerIndex) {
|
||||||
no_interior_seams_ = false;
|
no_interior_seams_ = false;
|
||||||
is_edge_on_seam_[opp_corner.value()] = true;
|
is_edge_on_seam_[opp_corner.value()] = true;
|
||||||
is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(opp_corner))
|
is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(opp_corner))
|
||||||
@ -131,7 +131,7 @@ void MeshAttributeCornerTable::RecomputeVerticesInternal(
|
|||||||
int num_new_vertices = 0;
|
int num_new_vertices = 0;
|
||||||
for (VertexIndex v(0); v < corner_table_->num_vertices(); ++v) {
|
for (VertexIndex v(0); v < corner_table_->num_vertices(); ++v) {
|
||||||
const CornerIndex c = corner_table_->LeftMostCorner(v);
|
const CornerIndex c = corner_table_->LeftMostCorner(v);
|
||||||
if (c < 0)
|
if (c == kInvalidCornerIndex)
|
||||||
continue; // Isolated vertex?
|
continue; // Isolated vertex?
|
||||||
AttributeValueIndex first_vert_id(num_new_vertices++);
|
AttributeValueIndex first_vert_id(num_new_vertices++);
|
||||||
if (init_vertex_to_attribute_entry_map) {
|
if (init_vertex_to_attribute_entry_map) {
|
||||||
@ -149,7 +149,7 @@ void MeshAttributeCornerTable::RecomputeVerticesInternal(
|
|||||||
// Try to swing left on the modified corner table. We need to get the
|
// Try to swing left on the modified corner table. We need to get the
|
||||||
// first corner that defines an attribute seam.
|
// first corner that defines an attribute seam.
|
||||||
act_c = SwingLeft(first_c);
|
act_c = SwingLeft(first_c);
|
||||||
while (act_c >= 0) {
|
while (act_c != kInvalidCornerIndex) {
|
||||||
first_c = act_c;
|
first_c = act_c;
|
||||||
act_c = SwingLeft(act_c);
|
act_c = SwingLeft(act_c);
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ void MeshAttributeCornerTable::RecomputeVerticesInternal(
|
|||||||
corner_to_vertex_map_[first_c.value()] = VertexIndex(first_vert_id.value());
|
corner_to_vertex_map_[first_c.value()] = VertexIndex(first_vert_id.value());
|
||||||
vertex_to_left_most_corner_map_.push_back(first_c);
|
vertex_to_left_most_corner_map_.push_back(first_c);
|
||||||
act_c = corner_table_->SwingRight(first_c);
|
act_c = corner_table_->SwingRight(first_c);
|
||||||
while (act_c >= 0 && act_c != first_c) {
|
while (act_c != kInvalidCornerIndex && act_c != first_c) {
|
||||||
if (IsCornerOppositeToSeamEdge(corner_table_->Next(act_c))) {
|
if (IsCornerOppositeToSeamEdge(corner_table_->Next(act_c))) {
|
||||||
first_vert_id = AttributeValueIndex(num_new_vertices++);
|
first_vert_id = AttributeValueIndex(num_new_vertices++);
|
||||||
if (init_vertex_to_attribute_entry_map) {
|
if (init_vertex_to_attribute_entry_map) {
|
||||||
|
@ -100,7 +100,7 @@ class MeshAttributeCornerTable {
|
|||||||
|
|
||||||
inline bool IsOnBoundary(VertexIndex vert) const {
|
inline bool IsOnBoundary(VertexIndex vert) const {
|
||||||
const CornerIndex corner = LeftMostCorner(vert);
|
const CornerIndex corner = LeftMostCorner(vert);
|
||||||
if (corner < 0)
|
if (corner == kInvalidCornerIndex)
|
||||||
return true;
|
return true;
|
||||||
return IsCornerOnSeam(corner);
|
return IsCornerOnSeam(corner);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ bool MeshCleanup::operator()(Mesh *mesh, const MeshCleanupOptions &options) {
|
|||||||
if (is_point_used[i.value()]) {
|
if (is_point_used[i.value()]) {
|
||||||
point_map[i] = num_new_points++;
|
point_map[i] = num_new_points++;
|
||||||
} else {
|
} else {
|
||||||
point_map[i] = -1;
|
point_map[i] = kInvalidPointIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Go over faces and update their points.
|
// Go over faces and update their points.
|
||||||
@ -107,7 +107,7 @@ bool MeshCleanup::operator()(Mesh *mesh, const MeshCleanupOptions &options) {
|
|||||||
att_index_map.clear();
|
att_index_map.clear();
|
||||||
AttributeValueIndex::ValueType num_used_entries = 0;
|
AttributeValueIndex::ValueType num_used_entries = 0;
|
||||||
for (PointIndex i(0); i < num_original_points; ++i) {
|
for (PointIndex i(0); i < num_original_points; ++i) {
|
||||||
if (point_map[i] != -1) {
|
if (point_map[i] != kInvalidPointIndex) {
|
||||||
const AttributeValueIndex entry_id = att->mapped_index(i);
|
const AttributeValueIndex entry_id = att->mapped_index(i);
|
||||||
if (!is_att_index_used[entry_id]) {
|
if (!is_att_index_used[entry_id]) {
|
||||||
is_att_index_used[entry_id] = 1;
|
is_att_index_used[entry_id] = 1;
|
||||||
@ -160,7 +160,7 @@ bool MeshCleanup::operator()(Mesh *mesh, const MeshCleanupOptions &options) {
|
|||||||
// The new point id that maps to the currently processed attribute
|
// The new point id that maps to the currently processed attribute
|
||||||
// entry.
|
// entry.
|
||||||
const PointIndex new_point_id = point_map[i];
|
const PointIndex new_point_id = point_map[i];
|
||||||
if (new_point_id < 0)
|
if (new_point_id == kInvalidPointIndex)
|
||||||
continue;
|
continue;
|
||||||
// Index of the currently processed attribute entry in the original
|
// Index of the currently processed attribute entry in the original
|
||||||
// mesh.
|
// mesh.
|
||||||
|
@ -40,7 +40,7 @@ inline bool IsCornerOppositeToAttributeSeam(CornerIndex ci,
|
|||||||
const Mesh &mesh,
|
const Mesh &mesh,
|
||||||
const CornerTable &ct) {
|
const CornerTable &ct) {
|
||||||
const CornerIndex opp_ci = ct.Opposite(ci);
|
const CornerIndex opp_ci = ct.Opposite(ci);
|
||||||
if (opp_ci < 0)
|
if (opp_ci == kInvalidCornerIndex)
|
||||||
return false; // No opposite corner == no attribute seam.
|
return false; // No opposite corner == no attribute seam.
|
||||||
// Compare attribute value indices on both ends of the opposite edge.
|
// Compare attribute value indices on both ends of the opposite edge.
|
||||||
CornerIndex c0 = ct.Next(ci);
|
CornerIndex c0 = ct.Next(ci);
|
||||||
|
@ -40,12 +40,13 @@ void MeshStripifier::GenerateStripsFromCroner(int local_strip_id,
|
|||||||
//
|
//
|
||||||
// Perform the backward pass only when there is no attribute seam between
|
// Perform the backward pass only when there is no attribute seam between
|
||||||
// the initial face and the first face of the backward traversal.
|
// the initial face and the first face of the backward traversal.
|
||||||
if (GetOppositeCorner(corner_table_->Previous(start_ci)) < 0)
|
if (GetOppositeCorner(corner_table_->Previous(start_ci)) ==
|
||||||
|
kInvalidCornerIndex)
|
||||||
break; // Attribute seam or a boundary.
|
break; // Attribute seam or a boundary.
|
||||||
|
|
||||||
ci = corner_table_->Next(start_ci);
|
ci = corner_table_->Next(start_ci);
|
||||||
ci = corner_table_->SwingLeft(ci);
|
ci = corner_table_->SwingLeft(ci);
|
||||||
if (ci < 0)
|
if (ci == kInvalidCornerIndex)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
fi = corner_table_->Face(ci);
|
fi = corner_table_->Face(ci);
|
||||||
@ -73,7 +74,7 @@ void MeshStripifier::GenerateStripsFromCroner(int local_strip_id,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ci = GetOppositeCorner(ci);
|
ci = GetOppositeCorner(ci);
|
||||||
if (ci < 0)
|
if (ci == kInvalidCornerIndex)
|
||||||
break;
|
break;
|
||||||
fi = corner_table_->Face(ci);
|
fi = corner_table_->Face(ci);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ class PredictionDegreeTraverser {
|
|||||||
traversal_observer_.OnNewVertexVisited(tip_vertex, corner_id);
|
traversal_observer_.OnNewVertexVisited(tip_vertex, corner_id);
|
||||||
}
|
}
|
||||||
// Start the actual traversal.
|
// Start the actual traversal.
|
||||||
while ((corner_id = PopNextCornerToTraverse()) >= 0) {
|
while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
|
||||||
FaceIndex face_id(corner_id.value() / 3);
|
FaceIndex face_id(corner_id.value() / 3);
|
||||||
// Make sure the face hasn't been visited yet.
|
// Make sure the face hasn't been visited yet.
|
||||||
if (processor_.IsFaceVisited(face_id)) {
|
if (processor_.IsFaceVisited(face_id)) {
|
||||||
@ -128,9 +128,13 @@ class PredictionDegreeTraverser {
|
|||||||
const CornerIndex left_corner_id =
|
const CornerIndex left_corner_id =
|
||||||
corner_table_->GetLeftCorner(corner_id);
|
corner_table_->GetLeftCorner(corner_id);
|
||||||
const FaceIndex right_face_id(
|
const FaceIndex right_face_id(
|
||||||
(right_corner_id < 0 ? -1 : right_corner_id.value() / 3));
|
(right_corner_id == kInvalidCornerIndex
|
||||||
|
? kInvalidFaceIndex
|
||||||
|
: FaceIndex(right_corner_id.value() / 3)));
|
||||||
const FaceIndex left_face_id(
|
const FaceIndex left_face_id(
|
||||||
(left_corner_id < 0 ? -1 : left_corner_id.value() / 3));
|
(left_corner_id == kInvalidCornerIndex
|
||||||
|
? kInvalidFaceIndex
|
||||||
|
: FaceIndex(left_corner_id.value() / 3)));
|
||||||
const bool is_right_face_visited =
|
const bool is_right_face_visited =
|
||||||
processor_.IsFaceVisited(right_face_id);
|
processor_.IsFaceVisited(right_face_id);
|
||||||
const bool is_left_face_visited =
|
const bool is_left_face_visited =
|
||||||
|
@ -94,6 +94,8 @@ bool MetadataDecoder::DecodeName(std::string *name) {
|
|||||||
if (!buffer_->Decode(&name_len))
|
if (!buffer_->Decode(&name_len))
|
||||||
return false;
|
return false;
|
||||||
name->resize(name_len);
|
name->resize(name_len);
|
||||||
|
if (name_len == 0)
|
||||||
|
return true;
|
||||||
if (!buffer_->Decode(&name->at(0), name_len))
|
if (!buffer_->Decode(&name->at(0), name_len))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -18,6 +18,37 @@
|
|||||||
|
|
||||||
namespace draco {
|
namespace draco {
|
||||||
|
|
||||||
|
void ReleaseUnityMesh(DracoToUnityMesh **mesh_ptr) {
|
||||||
|
DracoToUnityMesh *mesh = *mesh_ptr;
|
||||||
|
if (!mesh)
|
||||||
|
return;
|
||||||
|
if (mesh->indices) {
|
||||||
|
delete[] mesh->indices;
|
||||||
|
mesh->indices = nullptr;
|
||||||
|
}
|
||||||
|
if (mesh->position) {
|
||||||
|
delete[] mesh->position;
|
||||||
|
mesh->position = nullptr;
|
||||||
|
}
|
||||||
|
if (mesh->has_normal && mesh->normal) {
|
||||||
|
delete[] mesh->normal;
|
||||||
|
mesh->has_normal = false;
|
||||||
|
mesh->normal = nullptr;
|
||||||
|
}
|
||||||
|
if (mesh->has_texcoord && mesh->texcoord) {
|
||||||
|
delete[] mesh->texcoord;
|
||||||
|
mesh->has_texcoord = false;
|
||||||
|
mesh->texcoord = nullptr;
|
||||||
|
}
|
||||||
|
if (mesh->has_color && mesh->color) {
|
||||||
|
delete[] mesh->color;
|
||||||
|
mesh->has_color = false;
|
||||||
|
mesh->color = nullptr;
|
||||||
|
}
|
||||||
|
delete mesh;
|
||||||
|
*mesh_ptr = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
int DecodeMeshForUnity(char *data, unsigned int length,
|
int DecodeMeshForUnity(char *data, unsigned int length,
|
||||||
DracoToUnityMesh **tmp_mesh) {
|
DracoToUnityMesh **tmp_mesh) {
|
||||||
draco::DecoderBuffer buffer;
|
draco::DecoderBuffer buffer;
|
||||||
@ -59,12 +90,56 @@ int DecodeMeshForUnity(char *data, unsigned int length,
|
|||||||
const draco::AttributeValueIndex val_index = pos_att->mapped_index(i);
|
const draco::AttributeValueIndex val_index = pos_att->mapped_index(i);
|
||||||
if (!pos_att->ConvertValue<float, 3>(
|
if (!pos_att->ConvertValue<float, 3>(
|
||||||
val_index, unity_mesh->position + i.value() * 3)) {
|
val_index, unity_mesh->position + i.value() * 3)) {
|
||||||
delete[] unity_mesh->indices;
|
ReleaseUnityMesh(&unity_mesh);
|
||||||
delete[] unity_mesh->position;
|
|
||||||
delete unity_mesh;
|
|
||||||
return -8;
|
return -8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Get normal attributes.
|
||||||
|
const auto normal_att =
|
||||||
|
in_mesh->GetNamedAttribute(draco::GeometryAttribute::NORMAL);
|
||||||
|
if (normal_att != nullptr) {
|
||||||
|
unity_mesh->normal = new float[in_mesh->num_points() * 3];
|
||||||
|
unity_mesh->has_normal = true;
|
||||||
|
for (draco::PointIndex i(0); i < in_mesh->num_points(); ++i) {
|
||||||
|
const draco::AttributeValueIndex val_index = normal_att->mapped_index(i);
|
||||||
|
if (!normal_att->ConvertValue<float, 3>(
|
||||||
|
val_index, unity_mesh->normal + i.value() * 3)) {
|
||||||
|
ReleaseUnityMesh(&unity_mesh);
|
||||||
|
return -8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Get color attributes.
|
||||||
|
const auto color_att =
|
||||||
|
in_mesh->GetNamedAttribute(draco::GeometryAttribute::COLOR);
|
||||||
|
if (color_att != nullptr) {
|
||||||
|
unity_mesh->color = new float[in_mesh->num_points() * 3];
|
||||||
|
unity_mesh->has_color = true;
|
||||||
|
for (draco::PointIndex i(0); i < in_mesh->num_points(); ++i) {
|
||||||
|
const draco::AttributeValueIndex val_index = color_att->mapped_index(i);
|
||||||
|
if (!color_att->ConvertValue<float, 3>(
|
||||||
|
val_index, unity_mesh->color + i.value() * 3)) {
|
||||||
|
ReleaseUnityMesh(&unity_mesh);
|
||||||
|
return -8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Get texture coordinates attributes.
|
||||||
|
const auto texcoord_att =
|
||||||
|
in_mesh->GetNamedAttribute(draco::GeometryAttribute::TEX_COORD);
|
||||||
|
if (texcoord_att != nullptr) {
|
||||||
|
unity_mesh->texcoord = new float[in_mesh->num_points() * 2];
|
||||||
|
unity_mesh->has_texcoord = true;
|
||||||
|
for (draco::PointIndex i(0); i < in_mesh->num_points(); ++i) {
|
||||||
|
const draco::AttributeValueIndex val_index =
|
||||||
|
texcoord_att->mapped_index(i);
|
||||||
|
if (!texcoord_att->ConvertValue<float, 3>(
|
||||||
|
val_index, unity_mesh->texcoord + i.value() * 3)) {
|
||||||
|
ReleaseUnityMesh(&unity_mesh);
|
||||||
|
return -8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return in_mesh->num_faces();
|
return in_mesh->num_faces();
|
||||||
}
|
}
|
||||||
|
@ -37,20 +37,27 @@ struct EXPORT_API DracoToUnityMesh {
|
|||||||
indices(nullptr),
|
indices(nullptr),
|
||||||
num_vertices(0),
|
num_vertices(0),
|
||||||
position(nullptr),
|
position(nullptr),
|
||||||
|
has_normal(false),
|
||||||
normal(nullptr),
|
normal(nullptr),
|
||||||
|
has_texcoord(false),
|
||||||
texcoord(nullptr),
|
texcoord(nullptr),
|
||||||
|
has_color(false),
|
||||||
color(nullptr) {}
|
color(nullptr) {}
|
||||||
|
|
||||||
int num_faces;
|
int num_faces;
|
||||||
int *indices;
|
int *indices;
|
||||||
int num_vertices;
|
int num_vertices;
|
||||||
|
|
||||||
float *position;
|
float *position;
|
||||||
|
bool has_normal;
|
||||||
float *normal;
|
float *normal;
|
||||||
|
bool has_texcoord;
|
||||||
float *texcoord;
|
float *texcoord;
|
||||||
|
bool has_color;
|
||||||
float *color;
|
float *color;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void ReleaseUnityMesh(DracoToUnityMesh **mesh_ptr);
|
||||||
|
|
||||||
/* To use this function, you do not allocate memory for |tmp_mesh|, just
|
/* To use this function, you do not allocate memory for |tmp_mesh|, just
|
||||||
* define and pass a null pointer. Otherwise there will be memory leak.
|
* define and pass a null pointer. Otherwise there will be memory leak.
|
||||||
*/
|
*/
|
||||||
|
@ -52,24 +52,11 @@ class DracoUnityPluginTest : public ::testing::Test {
|
|||||||
ASSERT_EQ(num_faces, expected_num_faces);
|
ASSERT_EQ(num_faces, expected_num_faces);
|
||||||
ASSERT_EQ(unity_mesh_->num_faces, expected_num_faces);
|
ASSERT_EQ(unity_mesh_->num_faces, expected_num_faces);
|
||||||
ASSERT_EQ(unity_mesh_->num_vertices, expected_num_vertices);
|
ASSERT_EQ(unity_mesh_->num_vertices, expected_num_vertices);
|
||||||
|
ASSERT_TRUE(unity_mesh_->has_normal);
|
||||||
|
ASSERT_NE(unity_mesh_->normal, nullptr);
|
||||||
|
// TODO(fgalligan): Also test color and tex_coord attributes.
|
||||||
|
|
||||||
DestroyUnityMesh();
|
draco::ReleaseUnityMesh(&unity_mesh_);
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(zhafang): Consider move to draco_unity_plugin.h.
|
|
||||||
void DestroyUnityMesh() {
|
|
||||||
if (unity_mesh_ != nullptr) {
|
|
||||||
if (unity_mesh_->indices != nullptr) {
|
|
||||||
delete[] unity_mesh_->indices;
|
|
||||||
unity_mesh_->indices = nullptr;
|
|
||||||
}
|
|
||||||
if (unity_mesh_->position != nullptr) {
|
|
||||||
delete[] unity_mesh_->position;
|
|
||||||
unity_mesh_->position = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete unity_mesh_;
|
|
||||||
unity_mesh_ = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
draco::DracoToUnityMesh *unity_mesh_;
|
draco::DracoToUnityMesh *unity_mesh_;
|
||||||
@ -78,5 +65,4 @@ class DracoUnityPluginTest : public ::testing::Test {
|
|||||||
TEST_F(DracoUnityPluginTest, TestDecodingToDracoUnityMesh) {
|
TEST_F(DracoUnityPluginTest, TestDecodingToDracoUnityMesh) {
|
||||||
TestDecodingToDracoUnityMesh("test_nm.obj.edgebreaker.1.0.0.drc", 170, 99);
|
TestDecodingToDracoUnityMesh("test_nm.obj.edgebreaker.1.0.0.drc", 170, 99);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -18,144 +18,186 @@ using System.Collections.Generic;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public unsafe class DracoMeshLoader {
|
public unsafe class DracoMeshLoader
|
||||||
// Must stay the order to be consistent with C++ interface.
|
{
|
||||||
[StructLayout(LayoutKind.Sequential)] private struct DracoToUnityMesh {
|
// Must stay the order to be consistent with C++ interface.
|
||||||
public int numFaces;
|
[StructLayout (LayoutKind.Sequential)] private struct DracoToUnityMesh
|
||||||
public IntPtr indices;
|
{
|
||||||
public int numVertices;
|
public int numFaces;
|
||||||
public IntPtr position;
|
public IntPtr indices;
|
||||||
// TODO(zhafang): Add other attributes.
|
public int numVertices;
|
||||||
// public int numNormal;
|
public IntPtr position;
|
||||||
public float[] normal;
|
public bool hasNormal;
|
||||||
// public int numColor;
|
public IntPtr normal;
|
||||||
public float[] color;
|
public bool hasTexcoord;
|
||||||
public float[] texcoord;
|
public IntPtr texcoord;
|
||||||
}
|
public bool hasColor;
|
||||||
|
public IntPtr color;
|
||||||
|
}
|
||||||
|
|
||||||
private struct DecodedMesh {
|
private struct DecodedMesh
|
||||||
public int[] faces;
|
{
|
||||||
public Vector3[] vertices;
|
public int[] faces;
|
||||||
}
|
public Vector3[] vertices;
|
||||||
|
public Vector3[] normals;
|
||||||
|
public Vector2[] uvs;
|
||||||
|
public Vector3[] colors;
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport("dracodec_unity")] private static extern int DecodeMeshForUnity(
|
[DllImport ("dracodec_unity")] private static extern int DecodeMeshForUnity (
|
||||||
byte[] buffer, int length, DracoToUnityMesh **tmpMesh);
|
byte[] buffer, int length, DracoToUnityMesh**tmpMesh);
|
||||||
|
|
||||||
static private int maxNumVerticesPerMesh = 60000;
|
static private int maxNumVerticesPerMesh = 60000;
|
||||||
|
|
||||||
// Unity only support maximum 65534 vertices per mesh. So large meshes need
|
// Unity only support maximum 65534 vertices per mesh. So large meshes need
|
||||||
// to be splitted.
|
// to be splitted.
|
||||||
private void SplitMesh(DecodedMesh mesh, ref List<DecodedMesh> splittedMeshes) {
|
private void SplitMesh (DecodedMesh mesh, ref List<DecodedMesh> splittedMeshes)
|
||||||
List<int> facesLeft = new List<int>();
|
{
|
||||||
for (int i = 0; i < mesh.faces.Length; ++i) {
|
List<int> facesLeft = new List<int> ();
|
||||||
facesLeft.Add(mesh.faces[i]);
|
for (int i = 0; i < mesh.faces.Length; ++i) {
|
||||||
}
|
facesLeft.Add (mesh.faces [i]);
|
||||||
int numSubMeshes = 0;
|
}
|
||||||
|
int numSubMeshes = 0;
|
||||||
|
|
||||||
List<int> newCorners = new List<int>();
|
List<int> newCorners = new List<int> ();
|
||||||
Dictionary<int, int> indexToNewIndex = new Dictionary<int, int>();
|
Dictionary<int, int> indexToNewIndex = new Dictionary<int, int> ();
|
||||||
List<int> tmpLeftFaces = new List<int>();
|
|
||||||
List<int> facesExtracted = new List<int>();
|
|
||||||
List<Vector3> verticesExtracted = new List<Vector3>();
|
|
||||||
|
|
||||||
while (facesLeft.Count > 0) {
|
List<int> facesExtracted = new List<int> ();
|
||||||
Debug.Log("Faces left: " + facesLeft.Count.ToString());
|
List<Vector3> verticesExtracted = new List<Vector3> ();
|
||||||
numSubMeshes++;
|
List<Vector2> uvsExtracted = new List<Vector2> ();
|
||||||
tmpLeftFaces.Clear();
|
List<Vector3> normalsExtracted = new List<Vector3> ();
|
||||||
facesExtracted.Clear();
|
List<Vector3> colorsExtracted = new List<Vector3> ();
|
||||||
verticesExtracted.Clear();
|
|
||||||
|
|
||||||
int uniqueCornerId = 0;
|
while (facesLeft.Count > 0) {
|
||||||
indexToNewIndex.Clear();
|
numSubMeshes++;
|
||||||
for (int face = 0; face < facesLeft.Count / 3; ++face) {
|
List<int> tmpLeftFaces = new List<int> ();
|
||||||
newCorners.Clear();
|
facesExtracted.Clear ();
|
||||||
// If all indices has appeared or there's still space for more vertices.
|
verticesExtracted.Clear ();
|
||||||
for (int corner = 0; corner < 3; ++corner) {
|
uvsExtracted.Clear ();
|
||||||
if (!indexToNewIndex.ContainsKey(facesLeft[face * 3 + corner])) {
|
normalsExtracted.Clear ();
|
||||||
newCorners.Add(facesLeft[face * 3 + corner]);
|
colorsExtracted.Clear ();
|
||||||
}
|
|
||||||
}
|
|
||||||
if (newCorners.Count + uniqueCornerId > maxNumVerticesPerMesh) {
|
|
||||||
// Save face for the next sub-mesh.
|
|
||||||
for (int corner = 0; corner < 3; ++corner) {
|
|
||||||
tmpLeftFaces.Add(facesLeft[face * 3 + corner]);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Add new corners.
|
|
||||||
for (int i = 0; i < newCorners.Count; ++i) {
|
|
||||||
indexToNewIndex.Add(newCorners[i], uniqueCornerId);
|
|
||||||
verticesExtracted.Add(mesh.vertices[newCorners[i]]);
|
|
||||||
uniqueCornerId++;
|
|
||||||
}
|
|
||||||
// Add face to this sub-mesh.
|
|
||||||
for (int corner = 0; corner < 3; ++corner) {
|
|
||||||
facesExtracted.Add(
|
|
||||||
indexToNewIndex[facesLeft[face * 3 + corner]]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DecodedMesh subMesh = new DecodedMesh();
|
int uniqueCornerId = 0;
|
||||||
subMesh.faces = facesExtracted.ToArray();
|
indexToNewIndex.Clear ();
|
||||||
subMesh.vertices = verticesExtracted.ToArray();
|
for (int face = 0; face < facesLeft.Count / 3; ++face) {
|
||||||
splittedMeshes.Add(subMesh);
|
newCorners.Clear ();
|
||||||
|
// If all indices has appeared or there's still space for more vertices.
|
||||||
|
for (int corner = 0; corner < 3; ++corner) {
|
||||||
|
if (!indexToNewIndex.ContainsKey (facesLeft [face * 3 + corner])) {
|
||||||
|
newCorners.Add (facesLeft [face * 3 + corner]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (newCorners.Count + uniqueCornerId > maxNumVerticesPerMesh) {
|
||||||
|
// Save face for the next sub-mesh.
|
||||||
|
for (int corner = 0; corner < 3; ++corner) {
|
||||||
|
tmpLeftFaces.Add (facesLeft [face * 3 + corner]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Add new corners.
|
||||||
|
for (int i = 0; i < newCorners.Count; ++i) {
|
||||||
|
indexToNewIndex.Add (newCorners [i], uniqueCornerId);
|
||||||
|
verticesExtracted.Add (mesh.vertices [newCorners [i]]);
|
||||||
|
if (mesh.normals != null)
|
||||||
|
normalsExtracted.Add (mesh.normals [newCorners [i]]);
|
||||||
|
if (mesh.colors != null)
|
||||||
|
colorsExtracted.Add (mesh.colors [newCorners [i]]);
|
||||||
|
if (mesh.uvs != null)
|
||||||
|
uvsExtracted.Add (mesh.uvs [newCorners [i]]);
|
||||||
|
|
||||||
facesLeft = tmpLeftFaces;
|
uniqueCornerId++;
|
||||||
}
|
}
|
||||||
}
|
// Add face to this sub-mesh.
|
||||||
|
for (int corner = 0; corner < 3; ++corner) {
|
||||||
|
facesExtracted.Add (
|
||||||
|
indexToNewIndex [facesLeft [face * 3 + corner]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private float ReadFloatFromIntPtr(IntPtr data, int offset) {
|
DecodedMesh subMesh = new DecodedMesh ();
|
||||||
byte[] byteArray = new byte[4];
|
subMesh.faces = facesExtracted.ToArray ();
|
||||||
for (int j = 0; j < 4; ++j) {
|
subMesh.vertices = verticesExtracted.ToArray ();
|
||||||
byteArray[j] = Marshal.ReadByte(data, offset + j);
|
if (normalsExtracted.Count > 0) {
|
||||||
}
|
subMesh.normals = normalsExtracted.ToArray ();
|
||||||
return BitConverter.ToSingle(byteArray, 0);
|
}
|
||||||
}
|
if (uvsExtracted.Count > 0)
|
||||||
|
subMesh.uvs = uvsExtracted.ToArray ();
|
||||||
|
if (colorsExtracted.Count > 0)
|
||||||
|
subMesh.colors = colorsExtracted.ToArray ();
|
||||||
|
splittedMeshes.Add (subMesh);
|
||||||
|
|
||||||
// TODO(zhafang): Add back LoadFromURL.
|
facesLeft = tmpLeftFaces;
|
||||||
public int LoadMeshFromAsset(string assetName, ref List<Mesh> meshes) {
|
}
|
||||||
TextAsset asset = Resources.Load(assetName, typeof(TextAsset)) as TextAsset;
|
}
|
||||||
if (asset == null) {
|
|
||||||
Debug.Log("Didn't load file!");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
byte[] encodedData = asset.bytes;
|
|
||||||
Debug.Log(encodedData.Length.ToString());
|
|
||||||
if (encodedData.Length == 0) {
|
|
||||||
Debug.Log("Didn't load encoded data!");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return DecodeMesh(encodedData, ref meshes);
|
|
||||||
}
|
|
||||||
|
|
||||||
public unsafe int DecodeMesh(byte[] data, ref List<Mesh> meshes) {
|
private float ReadFloatFromIntPtr (IntPtr data, int offset)
|
||||||
DracoToUnityMesh *tmpMesh;
|
{
|
||||||
if (DecodeMeshForUnity(data, data.Length, &tmpMesh) <= 0) {
|
byte[] byteArray = new byte[4];
|
||||||
Debug.Log("Failed: Decoding error.");
|
for (int j = 0; j < 4; ++j) {
|
||||||
return -1;
|
byteArray [j] = Marshal.ReadByte (data, offset + j);
|
||||||
}
|
}
|
||||||
|
return BitConverter.ToSingle (byteArray, 0);
|
||||||
|
}
|
||||||
|
|
||||||
Debug.Log("Num indices: " + tmpMesh -> numFaces.ToString());
|
// TODO(zhafang): Add back LoadFromURL.
|
||||||
Debug.Log("Num vertices: " + tmpMesh -> numVertices.ToString());
|
public int LoadMeshFromAsset (string assetName, ref List<Mesh> meshes)
|
||||||
|
{
|
||||||
|
TextAsset asset = Resources.Load (assetName, typeof(TextAsset)) as TextAsset;
|
||||||
|
if (asset == null) {
|
||||||
|
Debug.Log ("Didn't load file!");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
byte[] encodedData = asset.bytes;
|
||||||
|
Debug.Log (encodedData.Length.ToString ());
|
||||||
|
if (encodedData.Length == 0) {
|
||||||
|
Debug.Log ("Didn't load encoded data!");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return DecodeMesh (encodedData, ref meshes);
|
||||||
|
}
|
||||||
|
|
||||||
int numFaces = tmpMesh -> numFaces;
|
public unsafe int DecodeMesh (byte[] data, ref List<Mesh> meshes)
|
||||||
int[] newTriangles = new int[tmpMesh -> numFaces * 3];
|
{
|
||||||
for (int i = 0; i < tmpMesh -> numFaces; ++i) {
|
DracoToUnityMesh* tmpMesh;
|
||||||
newTriangles[i * 3] = Marshal.ReadInt32(tmpMesh -> indices, i * 3 * 4);
|
if (DecodeMeshForUnity (data, data.Length, &tmpMesh) <= 0) {
|
||||||
newTriangles[i * 3 + 1] =
|
Debug.Log ("Failed: Decoding error.");
|
||||||
Marshal.ReadInt32(tmpMesh -> indices, i * 3 * 4 + 4);
|
return -1;
|
||||||
newTriangles[i * 3 + 2] =
|
}
|
||||||
Marshal.ReadInt32(tmpMesh -> indices, i * 3 * 4 + 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
// For floating point numbers, there's no Marshal functions could directly
|
Debug.Log ("Num indices: " + tmpMesh->numFaces.ToString ());
|
||||||
// read from the unmanaged data.
|
Debug.Log ("Num vertices: " + tmpMesh->numVertices.ToString ());
|
||||||
// TODO(zhafang): Find better way to read float numbers.
|
if (tmpMesh->hasNormal)
|
||||||
Vector3[] newVertices = new Vector3[tmpMesh -> numVertices];
|
Debug.Log ("Decoded mesh normals.");
|
||||||
int byteStridePerValue = 4;
|
if (tmpMesh->hasTexcoord)
|
||||||
int numValuePerVertex = 3;
|
Debug.Log ("Decoded mesh texcoords.");
|
||||||
int byteStridePerVertex = byteStridePerValue * numValuePerVertex;
|
if (tmpMesh->hasColor)
|
||||||
/*
|
Debug.Log ("Decoded mesh colors.");
|
||||||
|
|
||||||
|
int numFaces = tmpMesh->numFaces;
|
||||||
|
int[] newTriangles = new int[tmpMesh->numFaces * 3];
|
||||||
|
for (int i = 0; i < tmpMesh->numFaces; ++i) {
|
||||||
|
newTriangles [i * 3] = Marshal.ReadInt32 (tmpMesh->indices, i * 3 * 4);
|
||||||
|
newTriangles [i * 3 + 1] =
|
||||||
|
Marshal.ReadInt32 (tmpMesh->indices, i * 3 * 4 + 4);
|
||||||
|
newTriangles [i * 3 + 2] =
|
||||||
|
Marshal.ReadInt32 (tmpMesh->indices, i * 3 * 4 + 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
// For floating point numbers, there's no Marshal functions could directly
|
||||||
|
// read from the unmanaged data.
|
||||||
|
// TODO(zhafang): Find better way to read float numbers.
|
||||||
|
Vector3[] newVertices = new Vector3[tmpMesh->numVertices];
|
||||||
|
Vector2[] newUVs = new Vector2[0];
|
||||||
|
if (tmpMesh->hasTexcoord)
|
||||||
|
newUVs = new Vector2[tmpMesh->numVertices];
|
||||||
|
Vector3[] newNormals = new Vector3[0];
|
||||||
|
if (tmpMesh->hasNormal)
|
||||||
|
newNormals = new Vector3[tmpMesh->numVertices];
|
||||||
|
Vector3[] newColors = new Vector3[0];
|
||||||
|
if (tmpMesh->hasColor)
|
||||||
|
newColors = new Vector3[tmpMesh->numVertices];
|
||||||
|
int byteStridePerValue = 4;
|
||||||
|
/*
|
||||||
* TODO(zhafang): Change to:
|
* TODO(zhafang): Change to:
|
||||||
* float[] pos = new float[3];
|
* float[] pos = new float[3];
|
||||||
* for (int i = 0; i < tmpMesh -> numVertices; ++i) {
|
* for (int i = 0; i < tmpMesh -> numVertices; ++i) {
|
||||||
@ -165,47 +207,112 @@ public unsafe class DracoMeshLoader {
|
|||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
for (int i = 0; i < tmpMesh -> numVertices; ++i) {
|
for (int i = 0; i < tmpMesh->numVertices; ++i) {
|
||||||
for (int j = 0; j < 3; ++j) {
|
int numValuePerVertex = 3;
|
||||||
newVertices[i][j] =
|
for (int j = 0; j < numValuePerVertex; ++j) {
|
||||||
ReadFloatFromIntPtr(
|
int byteStridePerVertex = byteStridePerValue * numValuePerVertex;
|
||||||
tmpMesh -> position,
|
newVertices [i] [j] =
|
||||||
i * byteStridePerVertex + byteStridePerValue * j);
|
ReadFloatFromIntPtr (
|
||||||
}
|
tmpMesh->position,
|
||||||
}
|
i * byteStridePerVertex + byteStridePerValue * j);
|
||||||
Marshal.FreeCoTaskMem(tmpMesh -> indices);
|
if (tmpMesh->hasNormal)
|
||||||
Marshal.FreeCoTaskMem(tmpMesh -> position);
|
newNormals [i] [j] =
|
||||||
Marshal.FreeCoTaskMem((IntPtr) tmpMesh);
|
ReadFloatFromIntPtr (
|
||||||
|
tmpMesh->normal,
|
||||||
|
i * byteStridePerVertex + byteStridePerValue * j);
|
||||||
|
if (tmpMesh->hasColor)
|
||||||
|
newColors [i] [j] =
|
||||||
|
ReadFloatFromIntPtr (
|
||||||
|
tmpMesh->color,
|
||||||
|
i * byteStridePerVertex + byteStridePerValue * j);
|
||||||
|
}
|
||||||
|
if (tmpMesh->hasTexcoord) {
|
||||||
|
numValuePerVertex = 2;
|
||||||
|
for (int j = 0; j < numValuePerVertex; ++j) {
|
||||||
|
int byteStridePerVertex = byteStridePerValue * numValuePerVertex;
|
||||||
|
newUVs [i] [j] =
|
||||||
|
ReadFloatFromIntPtr (
|
||||||
|
tmpMesh->texcoord,
|
||||||
|
i * byteStridePerVertex + byteStridePerValue * j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (newVertices.Length > maxNumVerticesPerMesh) {
|
Marshal.FreeCoTaskMem (tmpMesh->indices);
|
||||||
// Unity only support maximum 65534 vertices per mesh. So large meshes
|
Marshal.FreeCoTaskMem (tmpMesh->position);
|
||||||
// need to be splitted.
|
if (tmpMesh->hasNormal)
|
||||||
DecodedMesh decodedMesh = new DecodedMesh();
|
Marshal.FreeCoTaskMem (tmpMesh->normal);
|
||||||
decodedMesh.vertices = newVertices;
|
if (tmpMesh->hasTexcoord)
|
||||||
decodedMesh.faces = newTriangles;
|
Marshal.FreeCoTaskMem (tmpMesh->texcoord);
|
||||||
List<DecodedMesh> splittedMeshes = new List<DecodedMesh>();
|
if (tmpMesh->hasColor)
|
||||||
|
Marshal.FreeCoTaskMem (tmpMesh->color);
|
||||||
|
Marshal.FreeCoTaskMem ((IntPtr)tmpMesh);
|
||||||
|
|
||||||
SplitMesh(decodedMesh, ref splittedMeshes);
|
if (newVertices.Length > maxNumVerticesPerMesh) {
|
||||||
for (int i = 0; i < splittedMeshes.Count; ++i) {
|
// Unity only support maximum 65534 vertices per mesh. So large meshes
|
||||||
Mesh mesh = new Mesh();
|
// need to be splitted.
|
||||||
mesh.vertices = splittedMeshes[i].vertices;
|
|
||||||
mesh.triangles = splittedMeshes[i].faces;
|
|
||||||
|
|
||||||
mesh.RecalculateBounds();
|
DecodedMesh decodedMesh = new DecodedMesh ();
|
||||||
mesh.RecalculateNormals();
|
decodedMesh.vertices = newVertices;
|
||||||
meshes.Add(mesh);
|
decodedMesh.faces = newTriangles;
|
||||||
}
|
if (newUVs.Length != 0)
|
||||||
} else {
|
decodedMesh.uvs = newUVs;
|
||||||
Mesh mesh = new Mesh();
|
if (newNormals.Length != 0)
|
||||||
mesh.vertices = newVertices;
|
decodedMesh.normals = newNormals;
|
||||||
mesh.triangles = newTriangles;
|
if (newColors.Length != 0)
|
||||||
|
decodedMesh.colors = newColors;
|
||||||
|
List<DecodedMesh> splittedMeshes = new List<DecodedMesh> ();
|
||||||
|
|
||||||
mesh.RecalculateBounds();
|
SplitMesh (decodedMesh, ref splittedMeshes);
|
||||||
mesh.RecalculateNormals();
|
for (int i = 0; i < splittedMeshes.Count; ++i) {
|
||||||
meshes.Add(mesh);
|
Mesh mesh = new Mesh ();
|
||||||
}
|
mesh.vertices = splittedMeshes [i].vertices;
|
||||||
// TODO(zhafang): Resize mesh to the a proper scale.
|
mesh.triangles = splittedMeshes [i].faces;
|
||||||
|
if (splittedMeshes [i].uvs != null)
|
||||||
|
mesh.uv = splittedMeshes [i].uvs;
|
||||||
|
|
||||||
return numFaces;
|
if (splittedMeshes [i].colors != null) {
|
||||||
}
|
mesh.colors = new Color[splittedMeshes [i].colors.Length];
|
||||||
|
for (int j = 0; j < splittedMeshes [i].colors.Length; ++j) {
|
||||||
|
mesh.colors [j] = new Color (splittedMeshes [i].colors [j] [0],
|
||||||
|
splittedMeshes [i].colors [j] [1], splittedMeshes [i].colors [j] [2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (splittedMeshes [i].normals != null) {
|
||||||
|
mesh.normals = splittedMeshes [i].normals;
|
||||||
|
} else {
|
||||||
|
Debug.Log ("Sub mesh doesn't have normals, recomputed.");
|
||||||
|
mesh.RecalculateNormals ();
|
||||||
|
}
|
||||||
|
mesh.RecalculateBounds ();
|
||||||
|
meshes.Add (mesh);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Mesh mesh = new Mesh ();
|
||||||
|
mesh.vertices = newVertices;
|
||||||
|
mesh.triangles = newTriangles;
|
||||||
|
if (newUVs.Length != 0)
|
||||||
|
mesh.uv = newUVs;
|
||||||
|
if (newNormals.Length != 0) {
|
||||||
|
mesh.normals = newNormals;
|
||||||
|
} else {
|
||||||
|
mesh.RecalculateNormals ();
|
||||||
|
Debug.Log ("Mesh doesn't have normals, recomputed.");
|
||||||
|
}
|
||||||
|
if (newColors.Length != 0) {
|
||||||
|
mesh.colors = new Color[newColors.Length];
|
||||||
|
for (int i = 0; i < newColors.Length; ++i) {
|
||||||
|
mesh.colors [i] = new Color (newColors [i] [0],
|
||||||
|
newColors [i] [1], newColors [i] [2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh.RecalculateBounds ();
|
||||||
|
meshes.Add (mesh);
|
||||||
|
}
|
||||||
|
// TODO(zhafang): Resize mesh to the a proper scale.
|
||||||
|
|
||||||
|
return numFaces;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user