├── .all-contributorsrc ├── .gitignore ├── Readme.md ├── next-env.d.ts ├── next.config.js ├── package.json ├── patches └── three+0.120.1.patch ├── public ├── draco-gltf │ ├── draco_decoder.js │ ├── draco_decoder.wasm │ └── draco_wasm_wrapper.js ├── favicon.ico ├── logo.png └── models │ ├── female.glb │ └── male.glb ├── reference.png ├── src ├── components │ ├── ModelContainer │ │ ├── ModelContainer.tsx │ │ └── index.ts │ ├── ModelLoader │ │ ├── ModelLoader.module.scss │ │ ├── ModelLoader.tsx │ │ └── index.ts │ └── Settings │ │ ├── Settings.module.scss │ │ ├── Settings.tsx │ │ └── index.ts ├── constants │ └── name.ts ├── hooks │ ├── useLoader.ts │ ├── useSobelRenderPass.ts │ └── useTransformOnClick.ts ├── pages │ ├── _app.tsx │ └── index.tsx ├── stores │ ├── environment.ts │ ├── material.ts │ ├── mode.ts │ ├── postProcessing.ts │ └── scene.ts ├── styles │ └── main.scss └── utils │ ├── assert.ts │ ├── convertPointerToCoordinate.ts │ └── geometry.ts ├── tsconfig.json ├── typings.d.ts └── yarn.lock /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "reference", 3 | "projectOwner": "ritz078", 4 | "repoType": "github", 5 | "repoHost": "https://github.com", 6 | "files": [ 7 | "README.md" 8 | ], 9 | "imageSize": 100, 10 | "commit": true, 11 | "commitConvention": "none", 12 | "contributors": [ 13 | { 14 | "login": "ritz078", 15 | "name": "Ritesh Kumar", 16 | "avatar_url": "https://avatars3.githubusercontent.com/u/5389035?v=4", 17 | "profile": "https://riteshkr.com/", 18 | "contributions": [ 19 | "code", 20 | "design", 21 | "ideas" 22 | ] 23 | } 24 | ], 25 | "contributorsPerLine": 7 26 | } 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | 21 | # debug 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | 26 | # local env files 27 | .env.local 28 | .env.development.local 29 | .env.test.local 30 | .env.production.local 31 | .idea 32 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ![](./reference.png) 2 | 3 | 4 | 5 | [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) 6 | 7 | 8 | 9 | Check out the website on https://getreference.vercel.app 10 | 11 | ### Contribution 12 | 13 | No specific rule. Just be kind to everyone and hear all the silly ideas. This whole project started from a silly idea. While making this I learnt that sometimes silly ways might work better than traditional methods. This project is like some kind of Research & Development. The first solution generally never works 😂. So in case you are stuck, don't worry. We can do it together. 💪 14 | 15 | In case you go through the code and feel like you can make it easier for others to understand by writing inline comments or documentation, feel free to open a PR. 16 | 17 | This is a creative project and there is no limit to creativity. If you have got a new idea (big or small), please open an issue. 18 | 19 | ### Development 20 | 21 | - Clone the repo 22 | - Run `yarn && yarn dev` 23 | - Open http://localhost:3000 on any browser 24 | 25 | ## Contributors ✨ 26 | 27 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |

Ritesh Kumar

💻 🎨 🤔
37 | 38 | 39 | 40 | 41 | 42 | 43 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 44 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | const withTM = require("next-transpile-modules")(); 2 | const webpack = require("webpack"); 3 | 4 | module.exports = withTM({ 5 | webpack: (config, { dev }) => { 6 | config.plugins.push( 7 | new webpack.DefinePlugin({ 8 | DEV: dev, 9 | }) 10 | ); 11 | 12 | return config; 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reference", 3 | "version": "0.1.0", 4 | "private": true, 5 | "license": "MIT", 6 | "scripts": { 7 | "dev": "next dev", 8 | "build": "next build", 9 | "start": "next start", 10 | "postinstall": "patch-package" 11 | }, 12 | "dependencies": { 13 | "@mdi/js": "^5.6.55", 14 | "@mdi/react": "^1.4.0", 15 | "drei": "^1.5.6", 16 | "next": "9.5.3", 17 | "react": "16.13.1", 18 | "react-color": "^2.18.1", 19 | "react-dom": "16.13.1", 20 | "react-github-corner": "^2.5.0", 21 | "react-switch": "^5.0.1", 22 | "react-three-fiber": "^4.2.21", 23 | "three": "^0.120.1", 24 | "zustand": "^2.2.3" 25 | }, 26 | "devDependencies": { 27 | "@types/node": "^14.11.1", 28 | "@types/react": "^16.9.49", 29 | "all-contributors-cli": "^6.17.4", 30 | "husky": "^4.3.0", 31 | "next-transpile-modules": "^4.1.0", 32 | "patch-package": "^6.2.2", 33 | "postinstall-postinstall": "^2.1.0", 34 | "prettier": "^2.1.2", 35 | "pretty-quick": "^3.0.2", 36 | "sass": "^1.26.11", 37 | "typescript": "^4.0.3", 38 | "webpack": "^4.44.2" 39 | }, 40 | "husky": { 41 | "hooks": { 42 | "pre-commit": "pretty-quick --staged" 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /patches/three+0.120.1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/node_modules/three/src/core/Object3D.d.ts b/node_modules/three/src/core/Object3D.d.ts 2 | index 76608a8..4a74d13 100644 3 | --- a/node_modules/three/src/core/Object3D.d.ts 4 | +++ b/node_modules/three/src/core/Object3D.d.ts 5 | @@ -14,6 +14,7 @@ import { Raycaster } from './Raycaster'; 6 | import { EventDispatcher } from './EventDispatcher'; 7 | import { BufferGeometry } from './BufferGeometry'; 8 | import { Intersection } from './Raycaster'; 9 | +import { Skeleton } from "../objects/Skeleton"; 10 | 11 | export let Object3DIdCount: number; 12 | 13 | @@ -180,6 +181,8 @@ export class Object3D extends EventDispatcher { 14 | */ 15 | readonly isObject3D: true; 16 | 17 | + geometry: Geometry | BufferGeometry; 18 | + 19 | /** 20 | * Calls before rendering object 21 | */ 22 | -------------------------------------------------------------------------------- /public/draco-gltf/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ritz078/reference/cbc20ed0c9fd2be373156718f7711b5dd4a88d66/public/draco-gltf/draco_decoder.wasm -------------------------------------------------------------------------------- /public/draco-gltf/draco_wasm_wrapper.js: -------------------------------------------------------------------------------- 1 | var $jscomp = $jscomp || {}; 2 | $jscomp.scope = {}; 3 | $jscomp.ASSUME_ES5 = !1; 4 | $jscomp.ASSUME_NO_NATIVE_MAP = !1; 5 | $jscomp.ASSUME_NO_NATIVE_SET = !1; 6 | $jscomp.defineProperty = 7 | $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties 8 | ? Object.defineProperty 9 | : function (d, k, f) { 10 | d != Array.prototype && d != Object.prototype && (d[k] = f.value); 11 | }; 12 | $jscomp.getGlobal = function (d) { 13 | return "undefined" != typeof window && window === d 14 | ? d 15 | : "undefined" != typeof global && null != global 16 | ? global 17 | : d; 18 | }; 19 | $jscomp.global = $jscomp.getGlobal(this); 20 | $jscomp.polyfill = function (d, k, f, u) { 21 | if (k) { 22 | f = $jscomp.global; 23 | d = d.split("."); 24 | for (u = 0; u < d.length - 1; u++) { 25 | var h = d[u]; 26 | h in f || (f[h] = {}); 27 | f = f[h]; 28 | } 29 | d = d[d.length - 1]; 30 | u = f[d]; 31 | k = k(u); 32 | k != u && 33 | null != k && 34 | $jscomp.defineProperty(f, d, { 35 | configurable: !0, 36 | writable: !0, 37 | value: k, 38 | }); 39 | } 40 | }; 41 | $jscomp.polyfill( 42 | "Math.imul", 43 | function (d) { 44 | return d 45 | ? d 46 | : function (d, f) { 47 | d = Number(d); 48 | f = Number(f); 49 | var k = d & 65535, 50 | h = f & 65535; 51 | return ( 52 | (k * h + 53 | (((((d >>> 16) & 65535) * h + k * ((f >>> 16) & 65535)) << 16) >>> 54 | 0)) | 55 | 0 56 | ); 57 | }; 58 | }, 59 | "es6", 60 | "es3" 61 | ); 62 | $jscomp.polyfill( 63 | "Math.clz32", 64 | function (d) { 65 | return d 66 | ? d 67 | : function (d) { 68 | d = Number(d) >>> 0; 69 | if (0 === d) return 32; 70 | var f = 0; 71 | 0 === (d & 4294901760) && ((d <<= 16), (f += 16)); 72 | 0 === (d & 4278190080) && ((d <<= 8), (f += 8)); 73 | 0 === (d & 4026531840) && ((d <<= 4), (f += 4)); 74 | 0 === (d & 3221225472) && ((d <<= 2), (f += 2)); 75 | 0 === (d & 2147483648) && f++; 76 | return f; 77 | }; 78 | }, 79 | "es6", 80 | "es3" 81 | ); 82 | $jscomp.polyfill( 83 | "Math.trunc", 84 | function (d) { 85 | return d 86 | ? d 87 | : function (d) { 88 | d = Number(d); 89 | if (isNaN(d) || Infinity === d || -Infinity === d || 0 === d) 90 | return d; 91 | var f = Math.floor(Math.abs(d)); 92 | return 0 > d ? -f : f; 93 | }; 94 | }, 95 | "es6", 96 | "es3" 97 | ); 98 | $jscomp.SYMBOL_PREFIX = "jscomp_symbol_"; 99 | $jscomp.initSymbol = function () { 100 | $jscomp.initSymbol = function () {}; 101 | $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol); 102 | }; 103 | $jscomp.Symbol = (function () { 104 | var d = 0; 105 | return function (k) { 106 | return $jscomp.SYMBOL_PREFIX + (k || "") + d++; 107 | }; 108 | })(); 109 | $jscomp.initSymbolIterator = function () { 110 | $jscomp.initSymbol(); 111 | var d = $jscomp.global.Symbol.iterator; 112 | d || (d = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator")); 113 | "function" != typeof Array.prototype[d] && 114 | $jscomp.defineProperty(Array.prototype, d, { 115 | configurable: !0, 116 | writable: !0, 117 | value: function () { 118 | return $jscomp.arrayIterator(this); 119 | }, 120 | }); 121 | $jscomp.initSymbolIterator = function () {}; 122 | }; 123 | $jscomp.arrayIterator = function (d) { 124 | var k = 0; 125 | return $jscomp.iteratorPrototype(function () { 126 | return k < d.length ? { done: !1, value: d[k++] } : { done: !0 }; 127 | }); 128 | }; 129 | $jscomp.iteratorPrototype = function (d) { 130 | $jscomp.initSymbolIterator(); 131 | d = { next: d }; 132 | d[$jscomp.global.Symbol.iterator] = function () { 133 | return this; 134 | }; 135 | return d; 136 | }; 137 | $jscomp.makeIterator = function (d) { 138 | $jscomp.initSymbolIterator(); 139 | var k = d[Symbol.iterator]; 140 | return k ? k.call(d) : $jscomp.arrayIterator(d); 141 | }; 142 | $jscomp.FORCE_POLYFILL_PROMISE = !1; 143 | $jscomp.polyfill( 144 | "Promise", 145 | function (d) { 146 | function k() { 147 | this.batch_ = null; 148 | } 149 | function f(d) { 150 | return d instanceof h 151 | ? d 152 | : new h(function (r, f) { 153 | r(d); 154 | }); 155 | } 156 | if (d && !$jscomp.FORCE_POLYFILL_PROMISE) return d; 157 | k.prototype.asyncExecute = function (d) { 158 | null == this.batch_ && ((this.batch_ = []), this.asyncExecuteBatch_()); 159 | this.batch_.push(d); 160 | return this; 161 | }; 162 | k.prototype.asyncExecuteBatch_ = function () { 163 | var d = this; 164 | this.asyncExecuteFunction(function () { 165 | d.executeBatch_(); 166 | }); 167 | }; 168 | var u = $jscomp.global.setTimeout; 169 | k.prototype.asyncExecuteFunction = function (d) { 170 | u(d, 0); 171 | }; 172 | k.prototype.executeBatch_ = function () { 173 | for (; this.batch_ && this.batch_.length; ) { 174 | var d = this.batch_; 175 | this.batch_ = []; 176 | for (var B = 0; B < d.length; ++B) { 177 | var f = d[B]; 178 | delete d[B]; 179 | try { 180 | f(); 181 | } catch (v) { 182 | this.asyncThrow_(v); 183 | } 184 | } 185 | } 186 | this.batch_ = null; 187 | }; 188 | k.prototype.asyncThrow_ = function (d) { 189 | this.asyncExecuteFunction(function () { 190 | throw d; 191 | }); 192 | }; 193 | var h = function (d) { 194 | this.state_ = 0; 195 | this.result_ = void 0; 196 | this.onSettledCallbacks_ = []; 197 | var r = this.createResolveAndReject_(); 198 | try { 199 | d(r.resolve, r.reject); 200 | } catch (Y) { 201 | r.reject(Y); 202 | } 203 | }; 204 | h.prototype.createResolveAndReject_ = function () { 205 | function d(d) { 206 | return function (r) { 207 | h || ((h = !0), d.call(f, r)); 208 | }; 209 | } 210 | var f = this, 211 | h = !1; 212 | return { resolve: d(this.resolveTo_), reject: d(this.reject_) }; 213 | }; 214 | h.prototype.resolveTo_ = function (d) { 215 | if (d === this) 216 | this.reject_(new TypeError("A Promise cannot resolve to itself")); 217 | else if (d instanceof h) this.settleSameAsPromise_(d); 218 | else { 219 | a: switch (typeof d) { 220 | case "object": 221 | var f = null != d; 222 | break a; 223 | case "function": 224 | f = !0; 225 | break a; 226 | default: 227 | f = !1; 228 | } 229 | f ? this.resolveToNonPromiseObj_(d) : this.fulfill_(d); 230 | } 231 | }; 232 | h.prototype.resolveToNonPromiseObj_ = function (d) { 233 | var f = void 0; 234 | try { 235 | f = d.then; 236 | } catch (Y) { 237 | this.reject_(Y); 238 | return; 239 | } 240 | "function" == typeof f 241 | ? this.settleSameAsThenable_(f, d) 242 | : this.fulfill_(d); 243 | }; 244 | h.prototype.reject_ = function (d) { 245 | this.settle_(2, d); 246 | }; 247 | h.prototype.fulfill_ = function (d) { 248 | this.settle_(1, d); 249 | }; 250 | h.prototype.settle_ = function (d, f) { 251 | if (0 != this.state_) 252 | throw Error( 253 | ("Cannot settle(" + d + ", " + f) | 254 | ("): Promise already settled in state" + this.state_) 255 | ); 256 | this.state_ = d; 257 | this.result_ = f; 258 | this.executeOnSettledCallbacks_(); 259 | }; 260 | h.prototype.executeOnSettledCallbacks_ = function () { 261 | if (null != this.onSettledCallbacks_) { 262 | for (var d = this.onSettledCallbacks_, f = 0; f < d.length; ++f) 263 | d[f].call(), (d[f] = null); 264 | this.onSettledCallbacks_ = null; 265 | } 266 | }; 267 | var ha = new k(); 268 | h.prototype.settleSameAsPromise_ = function (d) { 269 | var f = this.createResolveAndReject_(); 270 | d.callWhenSettled_(f.resolve, f.reject); 271 | }; 272 | h.prototype.settleSameAsThenable_ = function (d, f) { 273 | var h = this.createResolveAndReject_(); 274 | try { 275 | d.call(f, h.resolve, h.reject); 276 | } catch (v) { 277 | h.reject(v); 278 | } 279 | }; 280 | h.prototype.then = function (d, f) { 281 | function k(d, f) { 282 | return "function" == typeof d 283 | ? function (f) { 284 | try { 285 | v(d(f)); 286 | } catch (O) { 287 | r(O); 288 | } 289 | } 290 | : f; 291 | } 292 | var v, 293 | r, 294 | B = new h(function (d, f) { 295 | v = d; 296 | r = f; 297 | }); 298 | this.callWhenSettled_(k(d, v), k(f, r)); 299 | return B; 300 | }; 301 | h.prototype.catch = function (d) { 302 | return this.then(void 0, d); 303 | }; 304 | h.prototype.callWhenSettled_ = function (d, f) { 305 | function h() { 306 | switch (k.state_) { 307 | case 1: 308 | d(k.result_); 309 | break; 310 | case 2: 311 | f(k.result_); 312 | break; 313 | default: 314 | throw Error("Unexpected state: " + k.state_); 315 | } 316 | } 317 | var k = this; 318 | null == this.onSettledCallbacks_ 319 | ? ha.asyncExecute(h) 320 | : this.onSettledCallbacks_.push(function () { 321 | ha.asyncExecute(h); 322 | }); 323 | }; 324 | h.resolve = f; 325 | h.reject = function (d) { 326 | return new h(function (f, h) { 327 | h(d); 328 | }); 329 | }; 330 | h.race = function (d) { 331 | return new h(function (h, k) { 332 | for ( 333 | var v = $jscomp.makeIterator(d), r = v.next(); 334 | !r.done; 335 | r = v.next() 336 | ) 337 | f(r.value).callWhenSettled_(h, k); 338 | }); 339 | }; 340 | h.all = function (d) { 341 | var k = $jscomp.makeIterator(d), 342 | r = k.next(); 343 | return r.done 344 | ? f([]) 345 | : new h(function (d, h) { 346 | function v(f) { 347 | return function (h) { 348 | u[f] = h; 349 | B--; 350 | 0 == B && d(u); 351 | }; 352 | } 353 | var u = [], 354 | B = 0; 355 | do 356 | u.push(void 0), 357 | B++, 358 | f(r.value).callWhenSettled_(v(u.length - 1), h), 359 | (r = k.next()); 360 | while (!r.done); 361 | }); 362 | }; 363 | return h; 364 | }, 365 | "es6", 366 | "es3" 367 | ); 368 | var DracoDecoderModule = function (d) { 369 | function k(a, c) { 370 | c || (c = 16); 371 | return Math.ceil(a / c) * c; 372 | } 373 | function f(a, c) { 374 | a || O("Assertion failed: " + c); 375 | } 376 | function u(a, c) { 377 | if (0 === c || !a) return ""; 378 | for (var b = 0, e, d = 0; ; ) { 379 | e = W[(a + d) >> 0]; 380 | b |= e; 381 | if (0 == e && !c) break; 382 | d++; 383 | if (c && d == c) break; 384 | } 385 | c || (c = d); 386 | e = ""; 387 | if (128 > b) { 388 | for (; 0 < c; ) 389 | (b = String.fromCharCode.apply( 390 | String, 391 | W.subarray(a, a + Math.min(c, 1024)) 392 | )), 393 | (e = e ? e + b : b), 394 | (a += 1024), 395 | (c -= 1024); 396 | return e; 397 | } 398 | return h(W, a); 399 | } 400 | function h(a, c) { 401 | for (var b = c; a[b]; ) ++b; 402 | if (16 < b - c && a.subarray && Ia) return Ia.decode(a.subarray(c, b)); 403 | for (b = ""; ; ) { 404 | var e = a[c++]; 405 | if (!e) return b; 406 | if (e & 128) { 407 | var d = a[c++] & 63; 408 | if (192 == (e & 224)) b += String.fromCharCode(((e & 31) << 6) | d); 409 | else { 410 | var f = a[c++] & 63; 411 | if (224 == (e & 240)) e = ((e & 15) << 12) | (d << 6) | f; 412 | else { 413 | var g = a[c++] & 63; 414 | if (240 == (e & 248)) 415 | e = ((e & 7) << 18) | (d << 12) | (f << 6) | g; 416 | else { 417 | var h = a[c++] & 63; 418 | if (248 == (e & 252)) 419 | e = ((e & 3) << 24) | (d << 18) | (f << 12) | (g << 6) | h; 420 | else { 421 | var k = a[c++] & 63; 422 | e = 423 | ((e & 1) << 30) | 424 | (d << 24) | 425 | (f << 18) | 426 | (g << 12) | 427 | (h << 6) | 428 | k; 429 | } 430 | } 431 | } 432 | 65536 > e 433 | ? (b += String.fromCharCode(e)) 434 | : ((e -= 65536), 435 | (b += String.fromCharCode( 436 | 55296 | (e >> 10), 437 | 56320 | (e & 1023) 438 | ))); 439 | } 440 | } else b += String.fromCharCode(e); 441 | } 442 | } 443 | function ha(a, c) { 444 | 0 < a % c && (a += c - (a % c)); 445 | return a; 446 | } 447 | function r() { 448 | a.HEAP8 = ia = new Int8Array(D); 449 | a.HEAP16 = Ja = new Int16Array(D); 450 | a.HEAP32 = E = new Int32Array(D); 451 | a.HEAPU8 = W = new Uint8Array(D); 452 | a.HEAPU16 = new Uint16Array(D); 453 | a.HEAPU32 = new Uint32Array(D); 454 | a.HEAPF32 = new Float32Array(D); 455 | a.HEAPF64 = new Float64Array(D); 456 | } 457 | function B(e) { 458 | for (; 0 < e.length; ) { 459 | var c = e.shift(); 460 | if ("function" == typeof c) c(); 461 | else { 462 | var b = c.func; 463 | "number" === typeof b 464 | ? void 0 === c.arg 465 | ? a.dynCall_v(b) 466 | : a.dynCall_vi(b, c.arg) 467 | : b(void 0 === c.arg ? null : c.arg); 468 | } 469 | } 470 | } 471 | function Y(a) { 472 | return String.prototype.startsWith 473 | ? a.startsWith("data:application/octet-stream;base64,") 474 | : 0 === a.indexOf("data:application/octet-stream;base64,"); 475 | } 476 | function v() { 477 | return !!v.uncaught_exception; 478 | } 479 | function la() { 480 | var e = y.last; 481 | if (!e) return (sa(0), 0) | 0; 482 | var c = y.infos[e], 483 | b = c.type; 484 | if (!b) return (sa(0), e) | 0; 485 | var p = Array.prototype.slice.call(arguments); 486 | a.___cxa_is_pointer_type(b); 487 | la.buffer || (la.buffer = Ka(4)); 488 | E[la.buffer >> 2] = e; 489 | e = la.buffer; 490 | for (var d = 0; d < p.length; d++) 491 | if (p[d] && a.___cxa_can_catch(p[d], b, e)) 492 | return (e = E[e >> 2]), (c.adjusted = e), (sa(p[d]), e) | 0; 493 | e = E[e >> 2]; 494 | return (sa(b), e) | 0; 495 | } 496 | function Z(e, c) { 497 | w.varargs = c; 498 | try { 499 | var b = w.get(), 500 | p = w.get(), 501 | d = w.get(); 502 | e = 0; 503 | Z.buffers || 504 | ((Z.buffers = [null, [], []]), 505 | (Z.printChar = function (c, b) { 506 | var e = Z.buffers[c]; 507 | f(e); 508 | 0 === b || 10 === b 509 | ? ((1 === c ? a.print : a.printErr)(h(e, 0)), (e.length = 0)) 510 | : e.push(b); 511 | })); 512 | for (c = 0; c < d; c++) { 513 | for ( 514 | var g = E[(p + 8 * c) >> 2], k = E[(p + (8 * c + 4)) >> 2], l = 0; 515 | l < k; 516 | l++ 517 | ) 518 | Z.printChar(b, W[g + l]); 519 | e += k; 520 | } 521 | return e; 522 | } catch (ya) { 523 | return ( 524 | ("undefined" !== typeof FS && ya instanceof FS.ErrnoError) || O(ya), 525 | -ya.errno 526 | ); 527 | } 528 | } 529 | function ma(e, c) { 530 | ma.seen || (ma.seen = {}); 531 | e in ma.seen || (a.dynCall_v(c), (ma.seen[e] = 1)); 532 | } 533 | function na(a) { 534 | this.name = "ExitStatus"; 535 | this.message = "Program terminated with exit(" + a + ")"; 536 | this.status = a; 537 | } 538 | function wa(e) { 539 | function c() { 540 | if (!a.calledRun && ((a.calledRun = !0), !oa)) { 541 | La || ((La = !0), B(Ma)); 542 | B(Na); 543 | if (a.onRuntimeInitialized) a.onRuntimeInitialized(); 544 | if (a.postRun) 545 | for ( 546 | "function" == typeof a.postRun && (a.postRun = [a.postRun]); 547 | a.postRun.length; 548 | 549 | ) 550 | Oa.unshift(a.postRun.shift()); 551 | B(Oa); 552 | } 553 | } 554 | if (!(0 < ea)) { 555 | if (a.preRun) 556 | for ( 557 | "function" == typeof a.preRun && (a.preRun = [a.preRun]); 558 | a.preRun.length; 559 | 560 | ) 561 | Pa.unshift(a.preRun.shift()); 562 | B(Pa); 563 | 0 < ea || 564 | a.calledRun || 565 | (a.setStatus 566 | ? (a.setStatus("Running..."), 567 | setTimeout(function () { 568 | setTimeout(function () { 569 | a.setStatus(""); 570 | }, 1); 571 | c(); 572 | }, 1)) 573 | : c()); 574 | } 575 | } 576 | function O(e) { 577 | if (a.onAbort) a.onAbort(e); 578 | void 0 !== e 579 | ? (a.print(e), a.printErr(e), (e = JSON.stringify(e))) 580 | : (e = ""); 581 | oa = !0; 582 | throw "abort(" + e + "). Build with -s ASSERTIONS=1 for more info."; 583 | } 584 | function m() {} 585 | function t(a) { 586 | return (a || m).__cache__; 587 | } 588 | function T(a, c) { 589 | var b = t(c), 590 | e = b[a]; 591 | if (e) return e; 592 | e = Object.create((c || m).prototype); 593 | e.ptr = a; 594 | return (b[a] = e); 595 | } 596 | function U(a) { 597 | if ("string" === typeof a) { 598 | for (var c = 0, b = 0; b < a.length; ++b) { 599 | var e = a.charCodeAt(b); 600 | 55296 <= e && 601 | 57343 >= e && 602 | (e = (65536 + ((e & 1023) << 10)) | (a.charCodeAt(++b) & 1023)); 603 | 127 >= e 604 | ? ++c 605 | : (c = 606 | 2047 >= e 607 | ? c + 2 608 | : 65535 >= e 609 | ? c + 3 610 | : 2097151 >= e 611 | ? c + 4 612 | : 67108863 >= e 613 | ? c + 5 614 | : c + 6); 615 | } 616 | c = Array(c + 1); 617 | b = 0; 618 | e = c.length; 619 | if (0 < e) { 620 | e = b + e - 1; 621 | for (var d = 0; d < a.length; ++d) { 622 | var f = a.charCodeAt(d); 623 | 55296 <= f && 624 | 57343 >= f && 625 | (f = (65536 + ((f & 1023) << 10)) | (a.charCodeAt(++d) & 1023)); 626 | if (127 >= f) { 627 | if (b >= e) break; 628 | c[b++] = f; 629 | } else { 630 | if (2047 >= f) { 631 | if (b + 1 >= e) break; 632 | c[b++] = 192 | (f >> 6); 633 | } else { 634 | if (65535 >= f) { 635 | if (b + 2 >= e) break; 636 | c[b++] = 224 | (f >> 12); 637 | } else { 638 | if (2097151 >= f) { 639 | if (b + 3 >= e) break; 640 | c[b++] = 240 | (f >> 18); 641 | } else { 642 | if (67108863 >= f) { 643 | if (b + 4 >= e) break; 644 | c[b++] = 248 | (f >> 24); 645 | } else { 646 | if (b + 5 >= e) break; 647 | c[b++] = 252 | (f >> 30); 648 | c[b++] = 128 | ((f >> 24) & 63); 649 | } 650 | c[b++] = 128 | ((f >> 18) & 63); 651 | } 652 | c[b++] = 128 | ((f >> 12) & 63); 653 | } 654 | c[b++] = 128 | ((f >> 6) & 63); 655 | } 656 | c[b++] = 128 | (f & 63); 657 | } 658 | } 659 | c[b] = 0; 660 | } 661 | a = l.alloc(c, ia); 662 | l.copy(c, ia, a); 663 | } 664 | return a; 665 | } 666 | function z() { 667 | throw "cannot construct a Status, no constructor in IDL"; 668 | } 669 | function F() { 670 | this.ptr = Wa(); 671 | t(F)[this.ptr] = this; 672 | } 673 | function G() { 674 | this.ptr = Xa(); 675 | t(G)[this.ptr] = this; 676 | } 677 | function H() { 678 | this.ptr = Ya(); 679 | t(H)[this.ptr] = this; 680 | } 681 | function I() { 682 | this.ptr = Za(); 683 | t(I)[this.ptr] = this; 684 | } 685 | function J() { 686 | this.ptr = $a(); 687 | t(J)[this.ptr] = this; 688 | } 689 | function n() { 690 | this.ptr = ab(); 691 | t(n)[this.ptr] = this; 692 | } 693 | function P() { 694 | this.ptr = bb(); 695 | t(P)[this.ptr] = this; 696 | } 697 | function x() { 698 | this.ptr = cb(); 699 | t(x)[this.ptr] = this; 700 | } 701 | function K() { 702 | this.ptr = db(); 703 | t(K)[this.ptr] = this; 704 | } 705 | function q() { 706 | this.ptr = eb(); 707 | t(q)[this.ptr] = this; 708 | } 709 | function L() { 710 | this.ptr = fb(); 711 | t(L)[this.ptr] = this; 712 | } 713 | function M() { 714 | this.ptr = gb(); 715 | t(M)[this.ptr] = this; 716 | } 717 | function V() { 718 | this.ptr = hb(); 719 | t(V)[this.ptr] = this; 720 | } 721 | function Q() { 722 | this.ptr = ib(); 723 | t(Q)[this.ptr] = this; 724 | } 725 | function g() { 726 | this.ptr = jb(); 727 | t(g)[this.ptr] = this; 728 | } 729 | function C() { 730 | this.ptr = kb(); 731 | t(C)[this.ptr] = this; 732 | } 733 | function X() { 734 | throw "cannot construct a VoidPtr, no constructor in IDL"; 735 | } 736 | function N() { 737 | this.ptr = lb(); 738 | t(N)[this.ptr] = this; 739 | } 740 | function R() { 741 | this.ptr = mb(); 742 | t(R)[this.ptr] = this; 743 | } 744 | d = d || {}; 745 | var a = "undefined" !== typeof d ? d : {}, 746 | Qa = !1, 747 | Ra = !1; 748 | a.onRuntimeInitialized = function () { 749 | Qa = !0; 750 | if (Ra && "function" === typeof a.onModuleLoaded) a.onModuleLoaded(a); 751 | }; 752 | a.onModuleParsed = function () { 753 | Ra = !0; 754 | if (Qa && "function" === typeof a.onModuleLoaded) a.onModuleLoaded(a); 755 | }; 756 | a.isVersionSupported = function (a) { 757 | if ("string" !== typeof a) return !1; 758 | a = a.split("."); 759 | return 2 > a.length || 3 < a.length 760 | ? !1 761 | : 1 == a[0] && 0 <= a[1] && 3 >= a[1] 762 | ? !0 763 | : 0 != a[0] || 10 < a[1] 764 | ? !1 765 | : !0; 766 | }; 767 | var pa = {}, 768 | aa; 769 | for (aa in a) a.hasOwnProperty(aa) && (pa[aa] = a[aa]); 770 | a.arguments = []; 771 | a.thisProgram = "./this.program"; 772 | a.quit = function (a, c) { 773 | throw c; 774 | }; 775 | a.preRun = []; 776 | a.postRun = []; 777 | var ja = !1, 778 | fa = !1, 779 | qa = !1, 780 | za = !1; 781 | if (a.ENVIRONMENT) 782 | if ("WEB" === a.ENVIRONMENT) ja = !0; 783 | else if ("WORKER" === a.ENVIRONMENT) fa = !0; 784 | else if ("NODE" === a.ENVIRONMENT) qa = !0; 785 | else if ("SHELL" === a.ENVIRONMENT) za = !0; 786 | else 787 | throw Error( 788 | "Module['ENVIRONMENT'] value is not valid. must be one of: WEB|WORKER|NODE|SHELL." 789 | ); 790 | else 791 | (ja = "object" === typeof window), 792 | (fa = "function" === typeof importScripts), 793 | (qa = 794 | "object" === typeof process && 795 | "function" === typeof require && 796 | !ja && 797 | !fa), 798 | (za = !ja && !qa && !fa); 799 | if (qa) { 800 | var Aa, Ba; 801 | a.read = function (a, c) { 802 | Aa || (Aa = require("fs")); 803 | Ba || (Ba = require("path")); 804 | a = Ba.normalize(a); 805 | a = Aa.readFileSync(a); 806 | return c ? a : a.toString(); 807 | }; 808 | a.readBinary = function (e) { 809 | e = a.read(e, !0); 810 | e.buffer || (e = new Uint8Array(e)); 811 | f(e.buffer); 812 | return e; 813 | }; 814 | 1 < process.argv.length && 815 | (a.thisProgram = process.argv[1].replace(/\\/g, "/")); 816 | a.arguments = process.argv.slice(2); 817 | process.on("uncaughtException", function (a) { 818 | if (!(a instanceof na)) throw a; 819 | }); 820 | process.on("unhandledRejection", function (a, c) { 821 | process.exit(1); 822 | }); 823 | a.inspect = function () { 824 | return "[Emscripten Module object]"; 825 | }; 826 | } else if (za) 827 | "undefined" != typeof read && 828 | (a.read = function (a) { 829 | return read(a); 830 | }), 831 | (a.readBinary = function (a) { 832 | if ("function" === typeof readbuffer) 833 | return new Uint8Array(readbuffer(a)); 834 | a = read(a, "binary"); 835 | f("object" === typeof a); 836 | return a; 837 | }), 838 | "undefined" != typeof scriptArgs 839 | ? (a.arguments = scriptArgs) 840 | : "undefined" != typeof arguments && (a.arguments = arguments), 841 | "function" === typeof quit && 842 | (a.quit = function (a, c) { 843 | quit(a); 844 | }); 845 | else if (ja || fa) 846 | (a.read = function (a) { 847 | var c = new XMLHttpRequest(); 848 | c.open("GET", a, !1); 849 | c.send(null); 850 | return c.responseText; 851 | }), 852 | fa && 853 | (a.readBinary = function (a) { 854 | var c = new XMLHttpRequest(); 855 | c.open("GET", a, !1); 856 | c.responseType = "arraybuffer"; 857 | c.send(null); 858 | return new Uint8Array(c.response); 859 | }), 860 | (a.readAsync = function (a, c, b) { 861 | var e = new XMLHttpRequest(); 862 | e.open("GET", a, !0); 863 | e.responseType = "arraybuffer"; 864 | e.onload = function () { 865 | 200 == e.status || (0 == e.status && e.response) 866 | ? c(e.response) 867 | : b(); 868 | }; 869 | e.onerror = b; 870 | e.send(null); 871 | }), 872 | (a.setWindowTitle = function (a) { 873 | document.title = a; 874 | }); 875 | a.print = 876 | "undefined" !== typeof console 877 | ? console.log.bind(console) 878 | : "undefined" !== typeof print 879 | ? print 880 | : null; 881 | a.printErr = 882 | "undefined" !== typeof printErr 883 | ? printErr 884 | : ("undefined" !== typeof console && console.warn.bind(console)) || 885 | a.print; 886 | a.print = a.print; 887 | a.printErr = a.printErr; 888 | for (aa in pa) pa.hasOwnProperty(aa) && (a[aa] = pa[aa]); 889 | pa = void 0; 890 | var oa = 0, 891 | Ia = "undefined" !== typeof TextDecoder ? new TextDecoder("utf8") : void 0; 892 | "undefined" !== typeof TextDecoder && new TextDecoder("utf-16le"); 893 | var ia, W, Ja, E, ba, Ca, ta, ua, Da, ka; 894 | var Ea = (ba = Ca = ta = ua = Da = ka = 0); 895 | var Sa = !1; 896 | a.reallocBuffer || 897 | (a.reallocBuffer = function (a) { 898 | try { 899 | if (ArrayBuffer.transfer) var c = ArrayBuffer.transfer(D, a); 900 | else { 901 | var b = ia; 902 | c = new ArrayBuffer(a); 903 | new Int8Array(c).set(b); 904 | } 905 | } catch (p) { 906 | return !1; 907 | } 908 | return nb(c) ? c : !1; 909 | }); 910 | try { 911 | var Ta = Function.prototype.call.bind( 912 | Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get 913 | ); 914 | Ta(new ArrayBuffer(4)); 915 | } catch (e) { 916 | Ta = function (a) { 917 | return a.byteLength; 918 | }; 919 | } 920 | var Fa = a.TOTAL_STACK || 5242880, 921 | A = a.TOTAL_MEMORY || 16777216; 922 | A < Fa && 923 | a.printErr( 924 | "TOTAL_MEMORY should be larger than TOTAL_STACK, was " + 925 | A + 926 | "! (TOTAL_STACK=" + 927 | Fa + 928 | ")" 929 | ); 930 | if (a.buffer) var D = a.buffer; 931 | else 932 | "object" === typeof WebAssembly && "function" === typeof WebAssembly.Memory 933 | ? ((a.wasmMemory = new WebAssembly.Memory({ initial: A / 65536 })), 934 | (D = a.wasmMemory.buffer)) 935 | : (D = new ArrayBuffer(A)), 936 | (a.buffer = D); 937 | r(); 938 | E[0] = 1668509029; 939 | Ja[1] = 25459; 940 | if (115 !== W[2] || 99 !== W[3]) 941 | throw "Runtime error: expected the system to be little-endian!"; 942 | var Pa = [], 943 | Ma = [], 944 | Na = [], 945 | ob = [], 946 | Oa = [], 947 | La = !1, 948 | ea = 0, 949 | Ga = null, 950 | ra = null; 951 | a.preloadedImages = {}; 952 | a.preloadedAudios = {}; 953 | (function () { 954 | function e() { 955 | try { 956 | if (a.wasmBinary) return new Uint8Array(a.wasmBinary); 957 | if (a.readBinary) return a.readBinary(f); 958 | 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)"; 959 | } catch (Va) { 960 | O(Va); 961 | } 962 | } 963 | function c() { 964 | return a.wasmBinary || (!ja && !fa) || "function" !== typeof fetch 965 | ? new Promise(function (a, c) { 966 | a(e()); 967 | }) 968 | : fetch(f, { credentials: "same-origin" }) 969 | .then(function (a) { 970 | if (!a.ok) throw "failed to load wasm binary file at '" + f + "'"; 971 | return a.arrayBuffer(); 972 | }) 973 | .catch(function () { 974 | return e(); 975 | }); 976 | } 977 | function b(b, e, d) { 978 | function p(c, b) { 979 | k = c.exports; 980 | k.memory && 981 | ((c = k.memory), 982 | (b = a.buffer), 983 | c.byteLength < b.byteLength && 984 | a.printErr( 985 | "the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here" 986 | ), 987 | (b = new Int8Array(b)), 988 | new Int8Array(c).set(b), 989 | (a.buffer = D = c), 990 | r()); 991 | a.asm = k; 992 | a.usingWasm = !0; 993 | ea--; 994 | a.monitorRunDependencies && a.monitorRunDependencies(ea); 995 | 0 == ea && 996 | (null !== Ga && (clearInterval(Ga), (Ga = null)), 997 | ra && ((c = ra), (ra = null), c())); 998 | } 999 | function g(a) { 1000 | p(a.instance, a.module); 1001 | } 1002 | function S(b) { 1003 | c() 1004 | .then(function (a) { 1005 | return WebAssembly.instantiate(a, h); 1006 | }) 1007 | .then(b) 1008 | .catch(function (c) { 1009 | a.printErr("failed to asynchronously prepare wasm: " + c); 1010 | O(c); 1011 | }); 1012 | } 1013 | if ("object" !== typeof WebAssembly) 1014 | return a.printErr("no native wasm support detected"), !1; 1015 | if (!(a.wasmMemory instanceof WebAssembly.Memory)) 1016 | return a.printErr("no native wasm Memory in use"), !1; 1017 | e.memory = a.wasmMemory; 1018 | h.global = { NaN: NaN, Infinity: Infinity }; 1019 | h["global.Math"] = Math; 1020 | h.env = e; 1021 | ea++; 1022 | a.monitorRunDependencies && a.monitorRunDependencies(ea); 1023 | if (a.instantiateWasm) 1024 | try { 1025 | return a.instantiateWasm(h, p); 1026 | } catch (pb) { 1027 | return ( 1028 | a.printErr( 1029 | "Module.instantiateWasm callback failed with error: " + pb 1030 | ), 1031 | !1 1032 | ); 1033 | } 1034 | a.wasmBinary || 1035 | "function" !== typeof WebAssembly.instantiateStreaming || 1036 | Y(f) || 1037 | "function" !== typeof fetch 1038 | ? S(g) 1039 | : WebAssembly.instantiateStreaming( 1040 | fetch(f, { credentials: "same-origin" }), 1041 | h 1042 | ) 1043 | .then(g) 1044 | .catch(function (c) { 1045 | a.printErr("wasm streaming compile failed: " + c); 1046 | a.printErr("falling back to ArrayBuffer instantiation"); 1047 | S(g); 1048 | }); 1049 | return {}; 1050 | } 1051 | var d = "draco_decoder.wast", 1052 | f = "draco_decoder.wasm", 1053 | g = "draco_decoder.temp.asm.js"; 1054 | "function" === typeof a.locateFile && 1055 | (Y(d) || (d = a.locateFile(d)), 1056 | Y(f) || (f = a.locateFile(f)), 1057 | Y(g) || (g = a.locateFile(g))); 1058 | var h = { 1059 | global: null, 1060 | env: null, 1061 | asm2wasm: { 1062 | "f64-rem": function (a, c) { 1063 | return a % c; 1064 | }, 1065 | debugger: function () { 1066 | debugger; 1067 | }, 1068 | }, 1069 | parent: a, 1070 | }, 1071 | k = null; 1072 | a.asmPreload = a.asm; 1073 | var l = a.reallocBuffer; 1074 | a.reallocBuffer = function (c) { 1075 | if ("asmjs" === m) var b = l(c); 1076 | else 1077 | a: { 1078 | c = ha(c, a.usingWasm ? 65536 : 16777216); 1079 | var e = a.buffer.byteLength; 1080 | if (a.usingWasm) 1081 | try { 1082 | b = 1083 | -1 !== a.wasmMemory.grow((c - e) / 65536) 1084 | ? (a.buffer = a.wasmMemory.buffer) 1085 | : null; 1086 | break a; 1087 | } catch (ud) { 1088 | b = null; 1089 | break a; 1090 | } 1091 | b = void 0; 1092 | } 1093 | return b; 1094 | }; 1095 | var m = ""; 1096 | a.asm = function (c, e, d) { 1097 | if (!e.table) { 1098 | var p = a.wasmTableSize; 1099 | void 0 === p && (p = 1024); 1100 | var f = a.wasmMaxTableSize; 1101 | e.table = 1102 | "object" === typeof WebAssembly && 1103 | "function" === typeof WebAssembly.Table 1104 | ? void 0 !== f 1105 | ? new WebAssembly.Table({ 1106 | initial: p, 1107 | maximum: f, 1108 | element: "anyfunc", 1109 | }) 1110 | : new WebAssembly.Table({ initial: p, element: "anyfunc" }) 1111 | : Array(p); 1112 | a.wasmTable = e.table; 1113 | } 1114 | e.memoryBase || (e.memoryBase = a.STATIC_BASE); 1115 | e.tableBase || (e.tableBase = 0); 1116 | (c = b(c, e, d)) || 1117 | O( 1118 | "no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods" 1119 | ); 1120 | return c; 1121 | }; 1122 | })(); 1123 | Ea = 1024; 1124 | ba = Ea + 14480; 1125 | Ma.push(); 1126 | a.STATIC_BASE = Ea; 1127 | a.STATIC_BUMP = 14480; 1128 | var qb = ba; 1129 | ba += 16; 1130 | var y = { 1131 | last: 0, 1132 | caught: [], 1133 | infos: {}, 1134 | deAdjust: function (a) { 1135 | if (!a || y.infos[a]) return a; 1136 | for (var c in y.infos) if (y.infos[c].adjusted === a) return c; 1137 | return a; 1138 | }, 1139 | addRef: function (a) { 1140 | a && y.infos[a].refcount++; 1141 | }, 1142 | decRef: function (e) { 1143 | if (e) { 1144 | var c = y.infos[e]; 1145 | f(0 < c.refcount); 1146 | c.refcount--; 1147 | 0 !== c.refcount || 1148 | c.rethrown || 1149 | (c.destructor && a.dynCall_vi(c.destructor, e), 1150 | delete y.infos[e], 1151 | ___cxa_free_exception(e)); 1152 | } 1153 | }, 1154 | clearRef: function (a) { 1155 | a && (y.infos[a].refcount = 0); 1156 | }, 1157 | }, 1158 | w = { 1159 | varargs: 0, 1160 | get: function (a) { 1161 | w.varargs += 4; 1162 | return E[(w.varargs - 4) >> 2]; 1163 | }, 1164 | getStr: function () { 1165 | return u(w.get()); 1166 | }, 1167 | get64: function () { 1168 | var a = w.get(), 1169 | c = w.get(); 1170 | 0 <= a ? f(0 === c) : f(-1 === c); 1171 | return a; 1172 | }, 1173 | getZero: function () { 1174 | f(0 === w.get()); 1175 | }, 1176 | }, 1177 | va = {}, 1178 | Ha = 1; 1179 | ka = (function (a) { 1180 | f(!Sa); 1181 | var c = ba; 1182 | ba = (ba + a + 15) & -16; 1183 | return c; 1184 | })(4); 1185 | Ca = ta = k(ba); 1186 | ua = Ca + Fa; 1187 | Da = k(ua); 1188 | E[ka >> 2] = Da; 1189 | Sa = !0; 1190 | a.wasmTableSize = 468; 1191 | a.wasmMaxTableSize = 468; 1192 | a.asmGlobalArg = {}; 1193 | a.asmLibraryArg = { 1194 | abort: O, 1195 | assert: f, 1196 | enlargeMemory: function () { 1197 | var e = a.usingWasm ? 65536 : 16777216, 1198 | c = 2147483648 - e; 1199 | if (E[ka >> 2] > c) return !1; 1200 | var b = A; 1201 | for (A = Math.max(A, 16777216); A < E[ka >> 2]; ) 1202 | A = 1203 | 536870912 >= A 1204 | ? ha(2 * A, e) 1205 | : Math.min(ha((3 * A + 2147483648) / 4, e), c); 1206 | e = a.reallocBuffer(A); 1207 | if (!e || e.byteLength != A) return (A = b), !1; 1208 | a.buffer = D = e; 1209 | r(); 1210 | return !0; 1211 | }, 1212 | getTotalMemory: function () { 1213 | return A; 1214 | }, 1215 | abortOnCannotGrowMemory: function () { 1216 | O( 1217 | "Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value " + 1218 | A + 1219 | ", (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 " 1220 | ); 1221 | }, 1222 | invoke_ii: function (e, c) { 1223 | try { 1224 | return a.dynCall_ii(e, c); 1225 | } catch (b) { 1226 | if ("number" !== typeof b && "longjmp" !== b) throw b; 1227 | a.setThrew(1, 0); 1228 | } 1229 | }, 1230 | invoke_iii: function (e, c, b) { 1231 | try { 1232 | return a.dynCall_iii(e, c, b); 1233 | } catch (p) { 1234 | if ("number" !== typeof p && "longjmp" !== p) throw p; 1235 | a.setThrew(1, 0); 1236 | } 1237 | }, 1238 | invoke_iiii: function (e, c, b, d) { 1239 | try { 1240 | return a.dynCall_iiii(e, c, b, d); 1241 | } catch (S) { 1242 | if ("number" !== typeof S && "longjmp" !== S) throw S; 1243 | a.setThrew(1, 0); 1244 | } 1245 | }, 1246 | invoke_iiiiiii: function (e, c, b, d, f, g, h) { 1247 | try { 1248 | return a.dynCall_iiiiiii(e, c, b, d, f, g, h); 1249 | } catch (da) { 1250 | if ("number" !== typeof da && "longjmp" !== da) throw da; 1251 | a.setThrew(1, 0); 1252 | } 1253 | }, 1254 | invoke_v: function (e) { 1255 | try { 1256 | a.dynCall_v(e); 1257 | } catch (c) { 1258 | if ("number" !== typeof c && "longjmp" !== c) throw c; 1259 | a.setThrew(1, 0); 1260 | } 1261 | }, 1262 | invoke_vi: function (e, c) { 1263 | try { 1264 | a.dynCall_vi(e, c); 1265 | } catch (b) { 1266 | if ("number" !== typeof b && "longjmp" !== b) throw b; 1267 | a.setThrew(1, 0); 1268 | } 1269 | }, 1270 | invoke_vii: function (e, c, b) { 1271 | try { 1272 | a.dynCall_vii(e, c, b); 1273 | } catch (p) { 1274 | if ("number" !== typeof p && "longjmp" !== p) throw p; 1275 | a.setThrew(1, 0); 1276 | } 1277 | }, 1278 | invoke_viii: function (e, c, b, d) { 1279 | try { 1280 | a.dynCall_viii(e, c, b, d); 1281 | } catch (S) { 1282 | if ("number" !== typeof S && "longjmp" !== S) throw S; 1283 | a.setThrew(1, 0); 1284 | } 1285 | }, 1286 | invoke_viiii: function (e, c, b, d, f) { 1287 | try { 1288 | a.dynCall_viiii(e, c, b, d, f); 1289 | } catch (xa) { 1290 | if ("number" !== typeof xa && "longjmp" !== xa) throw xa; 1291 | a.setThrew(1, 0); 1292 | } 1293 | }, 1294 | invoke_viiiii: function (e, c, b, d, f, g) { 1295 | try { 1296 | a.dynCall_viiiii(e, c, b, d, f, g); 1297 | } catch (ca) { 1298 | if ("number" !== typeof ca && "longjmp" !== ca) throw ca; 1299 | a.setThrew(1, 0); 1300 | } 1301 | }, 1302 | invoke_viiiiii: function (e, c, b, d, f, g, h) { 1303 | try { 1304 | a.dynCall_viiiiii(e, c, b, d, f, g, h); 1305 | } catch (da) { 1306 | if ("number" !== typeof da && "longjmp" !== da) throw da; 1307 | a.setThrew(1, 0); 1308 | } 1309 | }, 1310 | __ZSt18uncaught_exceptionv: v, 1311 | ___cxa_allocate_exception: function (a) { 1312 | return Ka(a); 1313 | }, 1314 | ___cxa_begin_catch: function (a) { 1315 | var c = y.infos[a]; 1316 | c && !c.caught && ((c.caught = !0), v.uncaught_exception--); 1317 | c && (c.rethrown = !1); 1318 | y.caught.push(a); 1319 | y.addRef(y.deAdjust(a)); 1320 | return a; 1321 | }, 1322 | ___cxa_find_matching_catch: la, 1323 | ___cxa_pure_virtual: function () { 1324 | oa = !0; 1325 | throw "Pure virtual function called!"; 1326 | }, 1327 | ___cxa_throw: function (a, c, b) { 1328 | y.infos[a] = { 1329 | ptr: a, 1330 | adjusted: a, 1331 | type: c, 1332 | destructor: b, 1333 | refcount: 0, 1334 | caught: !1, 1335 | rethrown: !1, 1336 | }; 1337 | y.last = a; 1338 | "uncaught_exception" in v 1339 | ? v.uncaught_exception++ 1340 | : (v.uncaught_exception = 1); 1341 | throw ( 1342 | a + 1343 | " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch." 1344 | ); 1345 | }, 1346 | ___gxx_personality_v0: function () {}, 1347 | ___resumeException: function (a) { 1348 | y.last || (y.last = a); 1349 | throw ( 1350 | a + 1351 | " - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch." 1352 | ); 1353 | }, 1354 | ___setErrNo: function (d) { 1355 | a.___errno_location && (E[a.___errno_location() >> 2] = d); 1356 | return d; 1357 | }, 1358 | ___syscall140: function (a, c) { 1359 | w.varargs = c; 1360 | try { 1361 | var b = w.getStreamFromFD(); 1362 | w.get(); 1363 | var d = w.get(), 1364 | e = w.get(), 1365 | f = w.get(); 1366 | FS.llseek(b, d, f); 1367 | E[e >> 2] = b.position; 1368 | b.getdents && 0 === d && 0 === f && (b.getdents = null); 1369 | return 0; 1370 | } catch (ca) { 1371 | return ( 1372 | ("undefined" !== typeof FS && ca instanceof FS.ErrnoError) || O(ca), 1373 | -ca.errno 1374 | ); 1375 | } 1376 | }, 1377 | ___syscall146: Z, 1378 | ___syscall6: function (a, c) { 1379 | w.varargs = c; 1380 | try { 1381 | var b = w.getStreamFromFD(); 1382 | FS.close(b); 1383 | return 0; 1384 | } catch (p) { 1385 | return ( 1386 | ("undefined" !== typeof FS && p instanceof FS.ErrnoError) || O(p), 1387 | -p.errno 1388 | ); 1389 | } 1390 | }, 1391 | _abort: function () { 1392 | a.abort(); 1393 | }, 1394 | _emscripten_memcpy_big: function (a, c, b) { 1395 | W.set(W.subarray(c, c + b), a); 1396 | return a; 1397 | }, 1398 | _llvm_trap: function () { 1399 | O("trap!"); 1400 | }, 1401 | _pthread_getspecific: function (a) { 1402 | return va[a] || 0; 1403 | }, 1404 | _pthread_key_create: function (a, c) { 1405 | if (0 == a) return 22; 1406 | E[a >> 2] = Ha; 1407 | va[Ha] = 0; 1408 | Ha++; 1409 | return 0; 1410 | }, 1411 | _pthread_once: ma, 1412 | _pthread_setspecific: function (a, c) { 1413 | if (!(a in va)) return 22; 1414 | va[a] = c; 1415 | return 0; 1416 | }, 1417 | flush_NO_FILESYSTEM: function () { 1418 | var d = a._fflush; 1419 | d && d(0); 1420 | if ((d = Z.printChar)) { 1421 | var c = Z.buffers; 1422 | c[1].length && d(1, 10); 1423 | c[2].length && d(2, 10); 1424 | } 1425 | }, 1426 | DYNAMICTOP_PTR: ka, 1427 | tempDoublePtr: qb, 1428 | ABORT: oa, 1429 | STACKTOP: ta, 1430 | STACK_MAX: ua, 1431 | }; 1432 | var Ua = a.asm(a.asmGlobalArg, a.asmLibraryArg, D); 1433 | a.asm = Ua; 1434 | a.___cxa_can_catch = function () { 1435 | return a.asm.___cxa_can_catch.apply(null, arguments); 1436 | }; 1437 | a.___cxa_is_pointer_type = function () { 1438 | return a.asm.___cxa_is_pointer_type.apply(null, arguments); 1439 | }; 1440 | var $a = (a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0 = function () { 1441 | return a.asm._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply( 1442 | null, 1443 | arguments 1444 | ); 1445 | }), 1446 | rb = (a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1 = function () { 1447 | return a.asm._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply( 1448 | null, 1449 | arguments 1450 | ); 1451 | }), 1452 | sb = (a._emscripten_bind_AttributeOctahedronTransform___destroy___0 = function () { 1453 | return a.asm._emscripten_bind_AttributeOctahedronTransform___destroy___0.apply( 1454 | null, 1455 | arguments 1456 | ); 1457 | }), 1458 | tb = (a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0 = function () { 1459 | return a.asm._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply( 1460 | null, 1461 | arguments 1462 | ); 1463 | }), 1464 | cb = (a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0 = function () { 1465 | return a.asm._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply( 1466 | null, 1467 | arguments 1468 | ); 1469 | }), 1470 | ub = (a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1 = function () { 1471 | return a.asm._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply( 1472 | null, 1473 | arguments 1474 | ); 1475 | }), 1476 | vb = (a._emscripten_bind_AttributeQuantizationTransform___destroy___0 = function () { 1477 | return a.asm._emscripten_bind_AttributeQuantizationTransform___destroy___0.apply( 1478 | null, 1479 | arguments 1480 | ); 1481 | }), 1482 | wb = (a._emscripten_bind_AttributeQuantizationTransform_min_value_1 = function () { 1483 | return a.asm._emscripten_bind_AttributeQuantizationTransform_min_value_1.apply( 1484 | null, 1485 | arguments 1486 | ); 1487 | }), 1488 | xb = (a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0 = function () { 1489 | return a.asm._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply( 1490 | null, 1491 | arguments 1492 | ); 1493 | }), 1494 | yb = (a._emscripten_bind_AttributeQuantizationTransform_range_0 = function () { 1495 | return a.asm._emscripten_bind_AttributeQuantizationTransform_range_0.apply( 1496 | null, 1497 | arguments 1498 | ); 1499 | }), 1500 | bb = (a._emscripten_bind_AttributeTransformData_AttributeTransformData_0 = function () { 1501 | return a.asm._emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply( 1502 | null, 1503 | arguments 1504 | ); 1505 | }), 1506 | zb = (a._emscripten_bind_AttributeTransformData___destroy___0 = function () { 1507 | return a.asm._emscripten_bind_AttributeTransformData___destroy___0.apply( 1508 | null, 1509 | arguments 1510 | ); 1511 | }), 1512 | Ab = (a._emscripten_bind_AttributeTransformData_transform_type_0 = function () { 1513 | return a.asm._emscripten_bind_AttributeTransformData_transform_type_0.apply( 1514 | null, 1515 | arguments 1516 | ); 1517 | }), 1518 | ib = (a._emscripten_bind_DecoderBuffer_DecoderBuffer_0 = function () { 1519 | return a.asm._emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply( 1520 | null, 1521 | arguments 1522 | ); 1523 | }), 1524 | Bb = (a._emscripten_bind_DecoderBuffer_Init_2 = function () { 1525 | return a.asm._emscripten_bind_DecoderBuffer_Init_2.apply(null, arguments); 1526 | }), 1527 | Cb = (a._emscripten_bind_DecoderBuffer___destroy___0 = function () { 1528 | return a.asm._emscripten_bind_DecoderBuffer___destroy___0.apply( 1529 | null, 1530 | arguments 1531 | ); 1532 | }), 1533 | Db = (a._emscripten_bind_Decoder_DecodeBufferToMesh_2 = function () { 1534 | return a.asm._emscripten_bind_Decoder_DecodeBufferToMesh_2.apply( 1535 | null, 1536 | arguments 1537 | ); 1538 | }), 1539 | Eb = (a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2 = function () { 1540 | return a.asm._emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply( 1541 | null, 1542 | arguments 1543 | ); 1544 | }), 1545 | jb = (a._emscripten_bind_Decoder_Decoder_0 = function () { 1546 | return a.asm._emscripten_bind_Decoder_Decoder_0.apply(null, arguments); 1547 | }), 1548 | Fb = (a._emscripten_bind_Decoder_GetAttributeByUniqueId_2 = function () { 1549 | return a.asm._emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply( 1550 | null, 1551 | arguments 1552 | ); 1553 | }), 1554 | Gb = (a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3 = function () { 1555 | return a.asm._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply( 1556 | null, 1557 | arguments 1558 | ); 1559 | }), 1560 | Hb = (a._emscripten_bind_Decoder_GetAttributeFloat_3 = function () { 1561 | return a.asm._emscripten_bind_Decoder_GetAttributeFloat_3.apply( 1562 | null, 1563 | arguments 1564 | ); 1565 | }), 1566 | Ib = (a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3 = function () { 1567 | return a.asm._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply( 1568 | null, 1569 | arguments 1570 | ); 1571 | }), 1572 | Jb = (a._emscripten_bind_Decoder_GetAttributeIdByName_2 = function () { 1573 | return a.asm._emscripten_bind_Decoder_GetAttributeIdByName_2.apply( 1574 | null, 1575 | arguments 1576 | ); 1577 | }), 1578 | Kb = (a._emscripten_bind_Decoder_GetAttributeId_2 = function () { 1579 | return a.asm._emscripten_bind_Decoder_GetAttributeId_2.apply( 1580 | null, 1581 | arguments 1582 | ); 1583 | }), 1584 | Lb = (a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3 = function () { 1585 | return a.asm._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply( 1586 | null, 1587 | arguments 1588 | ); 1589 | }), 1590 | Mb = (a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3 = function () { 1591 | return a.asm._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply( 1592 | null, 1593 | arguments 1594 | ); 1595 | }), 1596 | Nb = (a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3 = function () { 1597 | return a.asm._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply( 1598 | null, 1599 | arguments 1600 | ); 1601 | }), 1602 | Ob = (a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3 = function () { 1603 | return a.asm._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply( 1604 | null, 1605 | arguments 1606 | ); 1607 | }), 1608 | Pb = (a._emscripten_bind_Decoder_GetAttributeMetadata_2 = function () { 1609 | return a.asm._emscripten_bind_Decoder_GetAttributeMetadata_2.apply( 1610 | null, 1611 | arguments 1612 | ); 1613 | }), 1614 | Qb = (a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3 = function () { 1615 | return a.asm._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply( 1616 | null, 1617 | arguments 1618 | ); 1619 | }), 1620 | Rb = (a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3 = function () { 1621 | return a.asm._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply( 1622 | null, 1623 | arguments 1624 | ); 1625 | }), 1626 | Sb = (a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3 = function () { 1627 | return a.asm._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply( 1628 | null, 1629 | arguments 1630 | ); 1631 | }), 1632 | Tb = (a._emscripten_bind_Decoder_GetAttribute_2 = function () { 1633 | return a.asm._emscripten_bind_Decoder_GetAttribute_2.apply( 1634 | null, 1635 | arguments 1636 | ); 1637 | }), 1638 | Ub = (a._emscripten_bind_Decoder_GetEncodedGeometryType_1 = function () { 1639 | return a.asm._emscripten_bind_Decoder_GetEncodedGeometryType_1.apply( 1640 | null, 1641 | arguments 1642 | ); 1643 | }), 1644 | Vb = (a._emscripten_bind_Decoder_GetFaceFromMesh_3 = function () { 1645 | return a.asm._emscripten_bind_Decoder_GetFaceFromMesh_3.apply( 1646 | null, 1647 | arguments 1648 | ); 1649 | }), 1650 | Wb = (a._emscripten_bind_Decoder_GetMetadata_1 = function () { 1651 | return a.asm._emscripten_bind_Decoder_GetMetadata_1.apply( 1652 | null, 1653 | arguments 1654 | ); 1655 | }), 1656 | Xb = (a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2 = function () { 1657 | return a.asm._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply( 1658 | null, 1659 | arguments 1660 | ); 1661 | }), 1662 | Yb = (a._emscripten_bind_Decoder_SkipAttributeTransform_1 = function () { 1663 | return a.asm._emscripten_bind_Decoder_SkipAttributeTransform_1.apply( 1664 | null, 1665 | arguments 1666 | ); 1667 | }), 1668 | Zb = (a._emscripten_bind_Decoder___destroy___0 = function () { 1669 | return a.asm._emscripten_bind_Decoder___destroy___0.apply( 1670 | null, 1671 | arguments 1672 | ); 1673 | }), 1674 | gb = (a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0 = function () { 1675 | return a.asm._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply( 1676 | null, 1677 | arguments 1678 | ); 1679 | }), 1680 | $b = (a._emscripten_bind_DracoFloat32Array_GetValue_1 = function () { 1681 | return a.asm._emscripten_bind_DracoFloat32Array_GetValue_1.apply( 1682 | null, 1683 | arguments 1684 | ); 1685 | }), 1686 | ac = (a._emscripten_bind_DracoFloat32Array___destroy___0 = function () { 1687 | return a.asm._emscripten_bind_DracoFloat32Array___destroy___0.apply( 1688 | null, 1689 | arguments 1690 | ); 1691 | }), 1692 | bc = (a._emscripten_bind_DracoFloat32Array_size_0 = function () { 1693 | return a.asm._emscripten_bind_DracoFloat32Array_size_0.apply( 1694 | null, 1695 | arguments 1696 | ); 1697 | }), 1698 | fb = (a._emscripten_bind_DracoInt16Array_DracoInt16Array_0 = function () { 1699 | return a.asm._emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply( 1700 | null, 1701 | arguments 1702 | ); 1703 | }), 1704 | cc = (a._emscripten_bind_DracoInt16Array_GetValue_1 = function () { 1705 | return a.asm._emscripten_bind_DracoInt16Array_GetValue_1.apply( 1706 | null, 1707 | arguments 1708 | ); 1709 | }), 1710 | dc = (a._emscripten_bind_DracoInt16Array___destroy___0 = function () { 1711 | return a.asm._emscripten_bind_DracoInt16Array___destroy___0.apply( 1712 | null, 1713 | arguments 1714 | ); 1715 | }), 1716 | ec = (a._emscripten_bind_DracoInt16Array_size_0 = function () { 1717 | return a.asm._emscripten_bind_DracoInt16Array_size_0.apply( 1718 | null, 1719 | arguments 1720 | ); 1721 | }), 1722 | lb = (a._emscripten_bind_DracoInt32Array_DracoInt32Array_0 = function () { 1723 | return a.asm._emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply( 1724 | null, 1725 | arguments 1726 | ); 1727 | }), 1728 | fc = (a._emscripten_bind_DracoInt32Array_GetValue_1 = function () { 1729 | return a.asm._emscripten_bind_DracoInt32Array_GetValue_1.apply( 1730 | null, 1731 | arguments 1732 | ); 1733 | }), 1734 | gc = (a._emscripten_bind_DracoInt32Array___destroy___0 = function () { 1735 | return a.asm._emscripten_bind_DracoInt32Array___destroy___0.apply( 1736 | null, 1737 | arguments 1738 | ); 1739 | }), 1740 | hc = (a._emscripten_bind_DracoInt32Array_size_0 = function () { 1741 | return a.asm._emscripten_bind_DracoInt32Array_size_0.apply( 1742 | null, 1743 | arguments 1744 | ); 1745 | }), 1746 | db = (a._emscripten_bind_DracoInt8Array_DracoInt8Array_0 = function () { 1747 | return a.asm._emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply( 1748 | null, 1749 | arguments 1750 | ); 1751 | }), 1752 | ic = (a._emscripten_bind_DracoInt8Array_GetValue_1 = function () { 1753 | return a.asm._emscripten_bind_DracoInt8Array_GetValue_1.apply( 1754 | null, 1755 | arguments 1756 | ); 1757 | }), 1758 | jc = (a._emscripten_bind_DracoInt8Array___destroy___0 = function () { 1759 | return a.asm._emscripten_bind_DracoInt8Array___destroy___0.apply( 1760 | null, 1761 | arguments 1762 | ); 1763 | }), 1764 | kc = (a._emscripten_bind_DracoInt8Array_size_0 = function () { 1765 | return a.asm._emscripten_bind_DracoInt8Array_size_0.apply( 1766 | null, 1767 | arguments 1768 | ); 1769 | }), 1770 | Wa = (a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0 = function () { 1771 | return a.asm._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply( 1772 | null, 1773 | arguments 1774 | ); 1775 | }), 1776 | lc = (a._emscripten_bind_DracoUInt16Array_GetValue_1 = function () { 1777 | return a.asm._emscripten_bind_DracoUInt16Array_GetValue_1.apply( 1778 | null, 1779 | arguments 1780 | ); 1781 | }), 1782 | mc = (a._emscripten_bind_DracoUInt16Array___destroy___0 = function () { 1783 | return a.asm._emscripten_bind_DracoUInt16Array___destroy___0.apply( 1784 | null, 1785 | arguments 1786 | ); 1787 | }), 1788 | nc = (a._emscripten_bind_DracoUInt16Array_size_0 = function () { 1789 | return a.asm._emscripten_bind_DracoUInt16Array_size_0.apply( 1790 | null, 1791 | arguments 1792 | ); 1793 | }), 1794 | Za = (a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0 = function () { 1795 | return a.asm._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply( 1796 | null, 1797 | arguments 1798 | ); 1799 | }), 1800 | oc = (a._emscripten_bind_DracoUInt32Array_GetValue_1 = function () { 1801 | return a.asm._emscripten_bind_DracoUInt32Array_GetValue_1.apply( 1802 | null, 1803 | arguments 1804 | ); 1805 | }), 1806 | pc = (a._emscripten_bind_DracoUInt32Array___destroy___0 = function () { 1807 | return a.asm._emscripten_bind_DracoUInt32Array___destroy___0.apply( 1808 | null, 1809 | arguments 1810 | ); 1811 | }), 1812 | qc = (a._emscripten_bind_DracoUInt32Array_size_0 = function () { 1813 | return a.asm._emscripten_bind_DracoUInt32Array_size_0.apply( 1814 | null, 1815 | arguments 1816 | ); 1817 | }), 1818 | Ya = (a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0 = function () { 1819 | return a.asm._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply( 1820 | null, 1821 | arguments 1822 | ); 1823 | }), 1824 | rc = (a._emscripten_bind_DracoUInt8Array_GetValue_1 = function () { 1825 | return a.asm._emscripten_bind_DracoUInt8Array_GetValue_1.apply( 1826 | null, 1827 | arguments 1828 | ); 1829 | }), 1830 | sc = (a._emscripten_bind_DracoUInt8Array___destroy___0 = function () { 1831 | return a.asm._emscripten_bind_DracoUInt8Array___destroy___0.apply( 1832 | null, 1833 | arguments 1834 | ); 1835 | }), 1836 | tc = (a._emscripten_bind_DracoUInt8Array_size_0 = function () { 1837 | return a.asm._emscripten_bind_DracoUInt8Array_size_0.apply( 1838 | null, 1839 | arguments 1840 | ); 1841 | }), 1842 | hb = (a._emscripten_bind_GeometryAttribute_GeometryAttribute_0 = function () { 1843 | return a.asm._emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply( 1844 | null, 1845 | arguments 1846 | ); 1847 | }), 1848 | uc = (a._emscripten_bind_GeometryAttribute___destroy___0 = function () { 1849 | return a.asm._emscripten_bind_GeometryAttribute___destroy___0.apply( 1850 | null, 1851 | arguments 1852 | ); 1853 | }), 1854 | kb = (a._emscripten_bind_Mesh_Mesh_0 = function () { 1855 | return a.asm._emscripten_bind_Mesh_Mesh_0.apply(null, arguments); 1856 | }), 1857 | vc = (a._emscripten_bind_Mesh___destroy___0 = function () { 1858 | return a.asm._emscripten_bind_Mesh___destroy___0.apply(null, arguments); 1859 | }), 1860 | wc = (a._emscripten_bind_Mesh_num_attributes_0 = function () { 1861 | return a.asm._emscripten_bind_Mesh_num_attributes_0.apply( 1862 | null, 1863 | arguments 1864 | ); 1865 | }), 1866 | xc = (a._emscripten_bind_Mesh_num_faces_0 = function () { 1867 | return a.asm._emscripten_bind_Mesh_num_faces_0.apply(null, arguments); 1868 | }), 1869 | yc = (a._emscripten_bind_Mesh_num_points_0 = function () { 1870 | return a.asm._emscripten_bind_Mesh_num_points_0.apply(null, arguments); 1871 | }), 1872 | zc = (a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2 = function () { 1873 | return a.asm._emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply( 1874 | null, 1875 | arguments 1876 | ); 1877 | }), 1878 | Ac = (a._emscripten_bind_MetadataQuerier_GetEntryName_2 = function () { 1879 | return a.asm._emscripten_bind_MetadataQuerier_GetEntryName_2.apply( 1880 | null, 1881 | arguments 1882 | ); 1883 | }), 1884 | Bc = (a._emscripten_bind_MetadataQuerier_GetIntEntry_2 = function () { 1885 | return a.asm._emscripten_bind_MetadataQuerier_GetIntEntry_2.apply( 1886 | null, 1887 | arguments 1888 | ); 1889 | }), 1890 | Cc = (a._emscripten_bind_MetadataQuerier_GetStringEntry_2 = function () { 1891 | return a.asm._emscripten_bind_MetadataQuerier_GetStringEntry_2.apply( 1892 | null, 1893 | arguments 1894 | ); 1895 | }), 1896 | Dc = (a._emscripten_bind_MetadataQuerier_HasDoubleEntry_2 = function () { 1897 | return a.asm._emscripten_bind_MetadataQuerier_HasDoubleEntry_2.apply( 1898 | null, 1899 | arguments 1900 | ); 1901 | }), 1902 | Ec = (a._emscripten_bind_MetadataQuerier_HasEntry_2 = function () { 1903 | return a.asm._emscripten_bind_MetadataQuerier_HasEntry_2.apply( 1904 | null, 1905 | arguments 1906 | ); 1907 | }), 1908 | Fc = (a._emscripten_bind_MetadataQuerier_HasIntEntry_2 = function () { 1909 | return a.asm._emscripten_bind_MetadataQuerier_HasIntEntry_2.apply( 1910 | null, 1911 | arguments 1912 | ); 1913 | }), 1914 | Gc = (a._emscripten_bind_MetadataQuerier_HasStringEntry_2 = function () { 1915 | return a.asm._emscripten_bind_MetadataQuerier_HasStringEntry_2.apply( 1916 | null, 1917 | arguments 1918 | ); 1919 | }), 1920 | eb = (a._emscripten_bind_MetadataQuerier_MetadataQuerier_0 = function () { 1921 | return a.asm._emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply( 1922 | null, 1923 | arguments 1924 | ); 1925 | }), 1926 | Hc = (a._emscripten_bind_MetadataQuerier_NumEntries_1 = function () { 1927 | return a.asm._emscripten_bind_MetadataQuerier_NumEntries_1.apply( 1928 | null, 1929 | arguments 1930 | ); 1931 | }), 1932 | Ic = (a._emscripten_bind_MetadataQuerier___destroy___0 = function () { 1933 | return a.asm._emscripten_bind_MetadataQuerier___destroy___0.apply( 1934 | null, 1935 | arguments 1936 | ); 1937 | }), 1938 | mb = (a._emscripten_bind_Metadata_Metadata_0 = function () { 1939 | return a.asm._emscripten_bind_Metadata_Metadata_0.apply(null, arguments); 1940 | }), 1941 | Jc = (a._emscripten_bind_Metadata___destroy___0 = function () { 1942 | return a.asm._emscripten_bind_Metadata___destroy___0.apply( 1943 | null, 1944 | arguments 1945 | ); 1946 | }), 1947 | Kc = (a._emscripten_bind_PointAttribute_GetAttributeTransformData_0 = function () { 1948 | return a.asm._emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply( 1949 | null, 1950 | arguments 1951 | ); 1952 | }), 1953 | ab = (a._emscripten_bind_PointAttribute_PointAttribute_0 = function () { 1954 | return a.asm._emscripten_bind_PointAttribute_PointAttribute_0.apply( 1955 | null, 1956 | arguments 1957 | ); 1958 | }), 1959 | Lc = (a._emscripten_bind_PointAttribute___destroy___0 = function () { 1960 | return a.asm._emscripten_bind_PointAttribute___destroy___0.apply( 1961 | null, 1962 | arguments 1963 | ); 1964 | }), 1965 | Mc = (a._emscripten_bind_PointAttribute_attribute_type_0 = function () { 1966 | return a.asm._emscripten_bind_PointAttribute_attribute_type_0.apply( 1967 | null, 1968 | arguments 1969 | ); 1970 | }), 1971 | Nc = (a._emscripten_bind_PointAttribute_byte_offset_0 = function () { 1972 | return a.asm._emscripten_bind_PointAttribute_byte_offset_0.apply( 1973 | null, 1974 | arguments 1975 | ); 1976 | }), 1977 | Oc = (a._emscripten_bind_PointAttribute_byte_stride_0 = function () { 1978 | return a.asm._emscripten_bind_PointAttribute_byte_stride_0.apply( 1979 | null, 1980 | arguments 1981 | ); 1982 | }), 1983 | Pc = (a._emscripten_bind_PointAttribute_data_type_0 = function () { 1984 | return a.asm._emscripten_bind_PointAttribute_data_type_0.apply( 1985 | null, 1986 | arguments 1987 | ); 1988 | }), 1989 | Qc = (a._emscripten_bind_PointAttribute_normalized_0 = function () { 1990 | return a.asm._emscripten_bind_PointAttribute_normalized_0.apply( 1991 | null, 1992 | arguments 1993 | ); 1994 | }), 1995 | Rc = (a._emscripten_bind_PointAttribute_num_components_0 = function () { 1996 | return a.asm._emscripten_bind_PointAttribute_num_components_0.apply( 1997 | null, 1998 | arguments 1999 | ); 2000 | }), 2001 | Sc = (a._emscripten_bind_PointAttribute_size_0 = function () { 2002 | return a.asm._emscripten_bind_PointAttribute_size_0.apply( 2003 | null, 2004 | arguments 2005 | ); 2006 | }), 2007 | Tc = (a._emscripten_bind_PointAttribute_unique_id_0 = function () { 2008 | return a.asm._emscripten_bind_PointAttribute_unique_id_0.apply( 2009 | null, 2010 | arguments 2011 | ); 2012 | }), 2013 | Xa = (a._emscripten_bind_PointCloud_PointCloud_0 = function () { 2014 | return a.asm._emscripten_bind_PointCloud_PointCloud_0.apply( 2015 | null, 2016 | arguments 2017 | ); 2018 | }), 2019 | Uc = (a._emscripten_bind_PointCloud___destroy___0 = function () { 2020 | return a.asm._emscripten_bind_PointCloud___destroy___0.apply( 2021 | null, 2022 | arguments 2023 | ); 2024 | }), 2025 | Vc = (a._emscripten_bind_PointCloud_num_attributes_0 = function () { 2026 | return a.asm._emscripten_bind_PointCloud_num_attributes_0.apply( 2027 | null, 2028 | arguments 2029 | ); 2030 | }), 2031 | Wc = (a._emscripten_bind_PointCloud_num_points_0 = function () { 2032 | return a.asm._emscripten_bind_PointCloud_num_points_0.apply( 2033 | null, 2034 | arguments 2035 | ); 2036 | }), 2037 | Xc = (a._emscripten_bind_Status___destroy___0 = function () { 2038 | return a.asm._emscripten_bind_Status___destroy___0.apply(null, arguments); 2039 | }), 2040 | Yc = (a._emscripten_bind_Status_code_0 = function () { 2041 | return a.asm._emscripten_bind_Status_code_0.apply(null, arguments); 2042 | }), 2043 | Zc = (a._emscripten_bind_Status_error_msg_0 = function () { 2044 | return a.asm._emscripten_bind_Status_error_msg_0.apply(null, arguments); 2045 | }), 2046 | $c = (a._emscripten_bind_Status_ok_0 = function () { 2047 | return a.asm._emscripten_bind_Status_ok_0.apply(null, arguments); 2048 | }), 2049 | ad = (a._emscripten_bind_VoidPtr___destroy___0 = function () { 2050 | return a.asm._emscripten_bind_VoidPtr___destroy___0.apply( 2051 | null, 2052 | arguments 2053 | ); 2054 | }), 2055 | bd = (a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM = function () { 2056 | return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply( 2057 | null, 2058 | arguments 2059 | ); 2060 | }), 2061 | cd = (a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM = function () { 2062 | return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply( 2063 | null, 2064 | arguments 2065 | ); 2066 | }), 2067 | dd = (a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM = function () { 2068 | return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply( 2069 | null, 2070 | arguments 2071 | ); 2072 | }), 2073 | ed = (a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM = function () { 2074 | return a.asm._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply( 2075 | null, 2076 | arguments 2077 | ); 2078 | }), 2079 | fd = (a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE = function () { 2080 | return a.asm._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply( 2081 | null, 2082 | arguments 2083 | ); 2084 | }), 2085 | gd = (a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD = function () { 2086 | return a.asm._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply( 2087 | null, 2088 | arguments 2089 | ); 2090 | }), 2091 | hd = (a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH = function () { 2092 | return a.asm._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply( 2093 | null, 2094 | arguments 2095 | ); 2096 | }), 2097 | id = (a._emscripten_enum_draco_GeometryAttribute_Type_COLOR = function () { 2098 | return a.asm._emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply( 2099 | null, 2100 | arguments 2101 | ); 2102 | }), 2103 | jd = (a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC = function () { 2104 | return a.asm._emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply( 2105 | null, 2106 | arguments 2107 | ); 2108 | }), 2109 | kd = (a._emscripten_enum_draco_GeometryAttribute_Type_INVALID = function () { 2110 | return a.asm._emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply( 2111 | null, 2112 | arguments 2113 | ); 2114 | }), 2115 | ld = (a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL = function () { 2116 | return a.asm._emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply( 2117 | null, 2118 | arguments 2119 | ); 2120 | }), 2121 | md = (a._emscripten_enum_draco_GeometryAttribute_Type_POSITION = function () { 2122 | return a.asm._emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply( 2123 | null, 2124 | arguments 2125 | ); 2126 | }), 2127 | nd = (a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD = function () { 2128 | return a.asm._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply( 2129 | null, 2130 | arguments 2131 | ); 2132 | }), 2133 | od = (a._emscripten_enum_draco_StatusCode_ERROR = function () { 2134 | return a.asm._emscripten_enum_draco_StatusCode_ERROR.apply( 2135 | null, 2136 | arguments 2137 | ); 2138 | }), 2139 | pd = (a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER = function () { 2140 | return a.asm._emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply( 2141 | null, 2142 | arguments 2143 | ); 2144 | }), 2145 | qd = (a._emscripten_enum_draco_StatusCode_IO_ERROR = function () { 2146 | return a.asm._emscripten_enum_draco_StatusCode_IO_ERROR.apply( 2147 | null, 2148 | arguments 2149 | ); 2150 | }), 2151 | rd = (a._emscripten_enum_draco_StatusCode_OK = function () { 2152 | return a.asm._emscripten_enum_draco_StatusCode_OK.apply(null, arguments); 2153 | }), 2154 | sd = (a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION = function () { 2155 | return a.asm._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply( 2156 | null, 2157 | arguments 2158 | ); 2159 | }), 2160 | td = (a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION = function () { 2161 | return a.asm._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply( 2162 | null, 2163 | arguments 2164 | ); 2165 | }), 2166 | nb = (a._emscripten_replace_memory = function () { 2167 | return a.asm._emscripten_replace_memory.apply(null, arguments); 2168 | }); 2169 | a._free = function () { 2170 | return a.asm._free.apply(null, arguments); 2171 | }; 2172 | a._llvm_bswap_i32 = function () { 2173 | return a.asm._llvm_bswap_i32.apply(null, arguments); 2174 | }; 2175 | var Ka = (a._malloc = function () { 2176 | return a.asm._malloc.apply(null, arguments); 2177 | }); 2178 | a._memcpy = function () { 2179 | return a.asm._memcpy.apply(null, arguments); 2180 | }; 2181 | a._memmove = function () { 2182 | return a.asm._memmove.apply(null, arguments); 2183 | }; 2184 | a._memset = function () { 2185 | return a.asm._memset.apply(null, arguments); 2186 | }; 2187 | a._sbrk = function () { 2188 | return a.asm._sbrk.apply(null, arguments); 2189 | }; 2190 | a.establishStackSpace = function () { 2191 | return a.asm.establishStackSpace.apply(null, arguments); 2192 | }; 2193 | a.getTempRet0 = function () { 2194 | return a.asm.getTempRet0.apply(null, arguments); 2195 | }; 2196 | a.runPostSets = function () { 2197 | return a.asm.runPostSets.apply(null, arguments); 2198 | }; 2199 | var sa = (a.setTempRet0 = function () { 2200 | return a.asm.setTempRet0.apply(null, arguments); 2201 | }); 2202 | a.setThrew = function () { 2203 | return a.asm.setThrew.apply(null, arguments); 2204 | }; 2205 | a.stackAlloc = function () { 2206 | return a.asm.stackAlloc.apply(null, arguments); 2207 | }; 2208 | a.stackRestore = function () { 2209 | return a.asm.stackRestore.apply(null, arguments); 2210 | }; 2211 | a.stackSave = function () { 2212 | return a.asm.stackSave.apply(null, arguments); 2213 | }; 2214 | a.dynCall_ii = function () { 2215 | return a.asm.dynCall_ii.apply(null, arguments); 2216 | }; 2217 | a.dynCall_iii = function () { 2218 | return a.asm.dynCall_iii.apply(null, arguments); 2219 | }; 2220 | a.dynCall_iiii = function () { 2221 | return a.asm.dynCall_iiii.apply(null, arguments); 2222 | }; 2223 | a.dynCall_iiiiiii = function () { 2224 | return a.asm.dynCall_iiiiiii.apply(null, arguments); 2225 | }; 2226 | a.dynCall_v = function () { 2227 | return a.asm.dynCall_v.apply(null, arguments); 2228 | }; 2229 | a.dynCall_vi = function () { 2230 | return a.asm.dynCall_vi.apply(null, arguments); 2231 | }; 2232 | a.dynCall_vii = function () { 2233 | return a.asm.dynCall_vii.apply(null, arguments); 2234 | }; 2235 | a.dynCall_viii = function () { 2236 | return a.asm.dynCall_viii.apply(null, arguments); 2237 | }; 2238 | a.dynCall_viiii = function () { 2239 | return a.asm.dynCall_viiii.apply(null, arguments); 2240 | }; 2241 | a.dynCall_viiiii = function () { 2242 | return a.asm.dynCall_viiiii.apply(null, arguments); 2243 | }; 2244 | a.dynCall_viiiiii = function () { 2245 | return a.asm.dynCall_viiiiii.apply(null, arguments); 2246 | }; 2247 | a.asm = Ua; 2248 | a.then = function (d) { 2249 | if (a.calledRun) d(a); 2250 | else { 2251 | var c = a.onRuntimeInitialized; 2252 | a.onRuntimeInitialized = function () { 2253 | c && c(); 2254 | d(a); 2255 | }; 2256 | } 2257 | return a; 2258 | }; 2259 | na.prototype = Error(); 2260 | na.prototype.constructor = na; 2261 | ra = function c() { 2262 | a.calledRun || wa(); 2263 | a.calledRun || (ra = c); 2264 | }; 2265 | a.run = wa; 2266 | a.exit = function (c, b) { 2267 | if (!b || !a.noExitRuntime || 0 !== c) { 2268 | if (!a.noExitRuntime && ((oa = !0), (ta = void 0), B(ob), a.onExit)) 2269 | a.onExit(c); 2270 | qa && process.exit(c); 2271 | a.quit(c, new na(c)); 2272 | } 2273 | }; 2274 | a.abort = O; 2275 | if (a.preInit) 2276 | for ( 2277 | "function" == typeof a.preInit && (a.preInit = [a.preInit]); 2278 | 0 < a.preInit.length; 2279 | 2280 | ) 2281 | a.preInit.pop()(); 2282 | a.noExitRuntime = !0; 2283 | wa(); 2284 | m.prototype = Object.create(m.prototype); 2285 | m.prototype.constructor = m; 2286 | m.prototype.__class__ = m; 2287 | m.__cache__ = {}; 2288 | a.WrapperObject = m; 2289 | a.getCache = t; 2290 | a.wrapPointer = T; 2291 | a.castObject = function (a, b) { 2292 | return T(a.ptr, b); 2293 | }; 2294 | a.NULL = T(0); 2295 | a.destroy = function (a) { 2296 | if (!a.__destroy__) 2297 | throw "Error: Cannot destroy object. (Did you create it yourself?)"; 2298 | a.__destroy__(); 2299 | delete t(a.__class__)[a.ptr]; 2300 | }; 2301 | a.compare = function (a, b) { 2302 | return a.ptr === b.ptr; 2303 | }; 2304 | a.getPointer = function (a) { 2305 | return a.ptr; 2306 | }; 2307 | a.getClass = function (a) { 2308 | return a.__class__; 2309 | }; 2310 | var l = { 2311 | buffer: 0, 2312 | size: 0, 2313 | pos: 0, 2314 | temps: [], 2315 | needed: 0, 2316 | prepare: function () { 2317 | if (l.needed) { 2318 | for (var c = 0; c < l.temps.length; c++) a._free(l.temps[c]); 2319 | l.temps.length = 0; 2320 | a._free(l.buffer); 2321 | l.buffer = 0; 2322 | l.size += l.needed; 2323 | l.needed = 0; 2324 | } 2325 | l.buffer || 2326 | ((l.size += 128), (l.buffer = a._malloc(l.size)), f(l.buffer)); 2327 | l.pos = 0; 2328 | }, 2329 | alloc: function (c, b) { 2330 | f(l.buffer); 2331 | c = c.length * b.BYTES_PER_ELEMENT; 2332 | c = (c + 7) & -8; 2333 | l.pos + c >= l.size 2334 | ? (f(0 < c), (l.needed += c), (b = a._malloc(c)), l.temps.push(b)) 2335 | : ((b = l.buffer + l.pos), (l.pos += c)); 2336 | return b; 2337 | }, 2338 | copy: function (a, b, d) { 2339 | switch (b.BYTES_PER_ELEMENT) { 2340 | case 2: 2341 | d >>= 1; 2342 | break; 2343 | case 4: 2344 | d >>= 2; 2345 | break; 2346 | case 8: 2347 | d >>= 3; 2348 | } 2349 | for (var c = 0; c < a.length; c++) b[d + c] = a[c]; 2350 | }, 2351 | }; 2352 | z.prototype = Object.create(m.prototype); 2353 | z.prototype.constructor = z; 2354 | z.prototype.__class__ = z; 2355 | z.__cache__ = {}; 2356 | a.Status = z; 2357 | z.prototype.code = z.prototype.code = function () { 2358 | return Yc(this.ptr); 2359 | }; 2360 | z.prototype.ok = z.prototype.ok = function () { 2361 | return !!$c(this.ptr); 2362 | }; 2363 | z.prototype.error_msg = z.prototype.error_msg = function () { 2364 | return u(Zc(this.ptr)); 2365 | }; 2366 | z.prototype.__destroy__ = z.prototype.__destroy__ = function () { 2367 | Xc(this.ptr); 2368 | }; 2369 | F.prototype = Object.create(m.prototype); 2370 | F.prototype.constructor = F; 2371 | F.prototype.__class__ = F; 2372 | F.__cache__ = {}; 2373 | a.DracoUInt16Array = F; 2374 | F.prototype.GetValue = F.prototype.GetValue = function (a) { 2375 | var c = this.ptr; 2376 | a && "object" === typeof a && (a = a.ptr); 2377 | return lc(c, a); 2378 | }; 2379 | F.prototype.size = F.prototype.size = function () { 2380 | return nc(this.ptr); 2381 | }; 2382 | F.prototype.__destroy__ = F.prototype.__destroy__ = function () { 2383 | mc(this.ptr); 2384 | }; 2385 | G.prototype = Object.create(m.prototype); 2386 | G.prototype.constructor = G; 2387 | G.prototype.__class__ = G; 2388 | G.__cache__ = {}; 2389 | a.PointCloud = G; 2390 | G.prototype.num_attributes = G.prototype.num_attributes = function () { 2391 | return Vc(this.ptr); 2392 | }; 2393 | G.prototype.num_points = G.prototype.num_points = function () { 2394 | return Wc(this.ptr); 2395 | }; 2396 | G.prototype.__destroy__ = G.prototype.__destroy__ = function () { 2397 | Uc(this.ptr); 2398 | }; 2399 | H.prototype = Object.create(m.prototype); 2400 | H.prototype.constructor = H; 2401 | H.prototype.__class__ = H; 2402 | H.__cache__ = {}; 2403 | a.DracoUInt8Array = H; 2404 | H.prototype.GetValue = H.prototype.GetValue = function (a) { 2405 | var c = this.ptr; 2406 | a && "object" === typeof a && (a = a.ptr); 2407 | return rc(c, a); 2408 | }; 2409 | H.prototype.size = H.prototype.size = function () { 2410 | return tc(this.ptr); 2411 | }; 2412 | H.prototype.__destroy__ = H.prototype.__destroy__ = function () { 2413 | sc(this.ptr); 2414 | }; 2415 | I.prototype = Object.create(m.prototype); 2416 | I.prototype.constructor = I; 2417 | I.prototype.__class__ = I; 2418 | I.__cache__ = {}; 2419 | a.DracoUInt32Array = I; 2420 | I.prototype.GetValue = I.prototype.GetValue = function (a) { 2421 | var c = this.ptr; 2422 | a && "object" === typeof a && (a = a.ptr); 2423 | return oc(c, a); 2424 | }; 2425 | I.prototype.size = I.prototype.size = function () { 2426 | return qc(this.ptr); 2427 | }; 2428 | I.prototype.__destroy__ = I.prototype.__destroy__ = function () { 2429 | pc(this.ptr); 2430 | }; 2431 | J.prototype = Object.create(m.prototype); 2432 | J.prototype.constructor = J; 2433 | J.prototype.__class__ = J; 2434 | J.__cache__ = {}; 2435 | a.AttributeOctahedronTransform = J; 2436 | J.prototype.InitFromAttribute = J.prototype.InitFromAttribute = function (a) { 2437 | var c = this.ptr; 2438 | a && "object" === typeof a && (a = a.ptr); 2439 | return !!rb(c, a); 2440 | }; 2441 | J.prototype.quantization_bits = J.prototype.quantization_bits = function () { 2442 | return tb(this.ptr); 2443 | }; 2444 | J.prototype.__destroy__ = J.prototype.__destroy__ = function () { 2445 | sb(this.ptr); 2446 | }; 2447 | n.prototype = Object.create(m.prototype); 2448 | n.prototype.constructor = n; 2449 | n.prototype.__class__ = n; 2450 | n.__cache__ = {}; 2451 | a.PointAttribute = n; 2452 | n.prototype.size = n.prototype.size = function () { 2453 | return Sc(this.ptr); 2454 | }; 2455 | n.prototype.GetAttributeTransformData = n.prototype.GetAttributeTransformData = function () { 2456 | return T(Kc(this.ptr), P); 2457 | }; 2458 | n.prototype.attribute_type = n.prototype.attribute_type = function () { 2459 | return Mc(this.ptr); 2460 | }; 2461 | n.prototype.data_type = n.prototype.data_type = function () { 2462 | return Pc(this.ptr); 2463 | }; 2464 | n.prototype.num_components = n.prototype.num_components = function () { 2465 | return Rc(this.ptr); 2466 | }; 2467 | n.prototype.normalized = n.prototype.normalized = function () { 2468 | return !!Qc(this.ptr); 2469 | }; 2470 | n.prototype.byte_stride = n.prototype.byte_stride = function () { 2471 | return Oc(this.ptr); 2472 | }; 2473 | n.prototype.byte_offset = n.prototype.byte_offset = function () { 2474 | return Nc(this.ptr); 2475 | }; 2476 | n.prototype.unique_id = n.prototype.unique_id = function () { 2477 | return Tc(this.ptr); 2478 | }; 2479 | n.prototype.__destroy__ = n.prototype.__destroy__ = function () { 2480 | Lc(this.ptr); 2481 | }; 2482 | P.prototype = Object.create(m.prototype); 2483 | P.prototype.constructor = P; 2484 | P.prototype.__class__ = P; 2485 | P.__cache__ = {}; 2486 | a.AttributeTransformData = P; 2487 | P.prototype.transform_type = P.prototype.transform_type = function () { 2488 | return Ab(this.ptr); 2489 | }; 2490 | P.prototype.__destroy__ = P.prototype.__destroy__ = function () { 2491 | zb(this.ptr); 2492 | }; 2493 | x.prototype = Object.create(m.prototype); 2494 | x.prototype.constructor = x; 2495 | x.prototype.__class__ = x; 2496 | x.__cache__ = {}; 2497 | a.AttributeQuantizationTransform = x; 2498 | x.prototype.InitFromAttribute = x.prototype.InitFromAttribute = function (a) { 2499 | var c = this.ptr; 2500 | a && "object" === typeof a && (a = a.ptr); 2501 | return !!ub(c, a); 2502 | }; 2503 | x.prototype.quantization_bits = x.prototype.quantization_bits = function () { 2504 | return xb(this.ptr); 2505 | }; 2506 | x.prototype.min_value = x.prototype.min_value = function (a) { 2507 | var c = this.ptr; 2508 | a && "object" === typeof a && (a = a.ptr); 2509 | return wb(c, a); 2510 | }; 2511 | x.prototype.range = x.prototype.range = function () { 2512 | return yb(this.ptr); 2513 | }; 2514 | x.prototype.__destroy__ = x.prototype.__destroy__ = function () { 2515 | vb(this.ptr); 2516 | }; 2517 | K.prototype = Object.create(m.prototype); 2518 | K.prototype.constructor = K; 2519 | K.prototype.__class__ = K; 2520 | K.__cache__ = {}; 2521 | a.DracoInt8Array = K; 2522 | K.prototype.GetValue = K.prototype.GetValue = function (a) { 2523 | var c = this.ptr; 2524 | a && "object" === typeof a && (a = a.ptr); 2525 | return ic(c, a); 2526 | }; 2527 | K.prototype.size = K.prototype.size = function () { 2528 | return kc(this.ptr); 2529 | }; 2530 | K.prototype.__destroy__ = K.prototype.__destroy__ = function () { 2531 | jc(this.ptr); 2532 | }; 2533 | q.prototype = Object.create(m.prototype); 2534 | q.prototype.constructor = q; 2535 | q.prototype.__class__ = q; 2536 | q.__cache__ = {}; 2537 | a.MetadataQuerier = q; 2538 | q.prototype.HasEntry = q.prototype.HasEntry = function (a, b) { 2539 | var c = this.ptr; 2540 | l.prepare(); 2541 | a && "object" === typeof a && (a = a.ptr); 2542 | b = b && "object" === typeof b ? b.ptr : U(b); 2543 | return !!Ec(c, a, b); 2544 | }; 2545 | q.prototype.HasIntEntry = q.prototype.HasIntEntry = function (a, b) { 2546 | var c = this.ptr; 2547 | l.prepare(); 2548 | a && "object" === typeof a && (a = a.ptr); 2549 | b = b && "object" === typeof b ? b.ptr : U(b); 2550 | return !!Fc(c, a, b); 2551 | }; 2552 | q.prototype.GetIntEntry = q.prototype.GetIntEntry = function (a, b) { 2553 | var c = this.ptr; 2554 | l.prepare(); 2555 | a && "object" === typeof a && (a = a.ptr); 2556 | b = b && "object" === typeof b ? b.ptr : U(b); 2557 | return Bc(c, a, b); 2558 | }; 2559 | q.prototype.HasDoubleEntry = q.prototype.HasDoubleEntry = function (a, b) { 2560 | var c = this.ptr; 2561 | l.prepare(); 2562 | a && "object" === typeof a && (a = a.ptr); 2563 | b = b && "object" === typeof b ? b.ptr : U(b); 2564 | return !!Dc(c, a, b); 2565 | }; 2566 | q.prototype.GetDoubleEntry = q.prototype.GetDoubleEntry = function (a, b) { 2567 | var c = this.ptr; 2568 | l.prepare(); 2569 | a && "object" === typeof a && (a = a.ptr); 2570 | b = b && "object" === typeof b ? b.ptr : U(b); 2571 | return zc(c, a, b); 2572 | }; 2573 | q.prototype.HasStringEntry = q.prototype.HasStringEntry = function (a, b) { 2574 | var c = this.ptr; 2575 | l.prepare(); 2576 | a && "object" === typeof a && (a = a.ptr); 2577 | b = b && "object" === typeof b ? b.ptr : U(b); 2578 | return !!Gc(c, a, b); 2579 | }; 2580 | q.prototype.GetStringEntry = q.prototype.GetStringEntry = function (a, b) { 2581 | var c = this.ptr; 2582 | l.prepare(); 2583 | a && "object" === typeof a && (a = a.ptr); 2584 | b = b && "object" === typeof b ? b.ptr : U(b); 2585 | return u(Cc(c, a, b)); 2586 | }; 2587 | q.prototype.NumEntries = q.prototype.NumEntries = function (a) { 2588 | var c = this.ptr; 2589 | a && "object" === typeof a && (a = a.ptr); 2590 | return Hc(c, a); 2591 | }; 2592 | q.prototype.GetEntryName = q.prototype.GetEntryName = function (a, b) { 2593 | var c = this.ptr; 2594 | a && "object" === typeof a && (a = a.ptr); 2595 | b && "object" === typeof b && (b = b.ptr); 2596 | return u(Ac(c, a, b)); 2597 | }; 2598 | q.prototype.__destroy__ = q.prototype.__destroy__ = function () { 2599 | Ic(this.ptr); 2600 | }; 2601 | L.prototype = Object.create(m.prototype); 2602 | L.prototype.constructor = L; 2603 | L.prototype.__class__ = L; 2604 | L.__cache__ = {}; 2605 | a.DracoInt16Array = L; 2606 | L.prototype.GetValue = L.prototype.GetValue = function (a) { 2607 | var c = this.ptr; 2608 | a && "object" === typeof a && (a = a.ptr); 2609 | return cc(c, a); 2610 | }; 2611 | L.prototype.size = L.prototype.size = function () { 2612 | return ec(this.ptr); 2613 | }; 2614 | L.prototype.__destroy__ = L.prototype.__destroy__ = function () { 2615 | dc(this.ptr); 2616 | }; 2617 | M.prototype = Object.create(m.prototype); 2618 | M.prototype.constructor = M; 2619 | M.prototype.__class__ = M; 2620 | M.__cache__ = {}; 2621 | a.DracoFloat32Array = M; 2622 | M.prototype.GetValue = M.prototype.GetValue = function (a) { 2623 | var c = this.ptr; 2624 | a && "object" === typeof a && (a = a.ptr); 2625 | return $b(c, a); 2626 | }; 2627 | M.prototype.size = M.prototype.size = function () { 2628 | return bc(this.ptr); 2629 | }; 2630 | M.prototype.__destroy__ = M.prototype.__destroy__ = function () { 2631 | ac(this.ptr); 2632 | }; 2633 | V.prototype = Object.create(m.prototype); 2634 | V.prototype.constructor = V; 2635 | V.prototype.__class__ = V; 2636 | V.__cache__ = {}; 2637 | a.GeometryAttribute = V; 2638 | V.prototype.__destroy__ = V.prototype.__destroy__ = function () { 2639 | uc(this.ptr); 2640 | }; 2641 | Q.prototype = Object.create(m.prototype); 2642 | Q.prototype.constructor = Q; 2643 | Q.prototype.__class__ = Q; 2644 | Q.__cache__ = {}; 2645 | a.DecoderBuffer = Q; 2646 | Q.prototype.Init = Q.prototype.Init = function (a, b) { 2647 | var c = this.ptr; 2648 | l.prepare(); 2649 | if ("object" == typeof a && "object" === typeof a) { 2650 | var d = l.alloc(a, ia); 2651 | l.copy(a, ia, d); 2652 | a = d; 2653 | } 2654 | b && "object" === typeof b && (b = b.ptr); 2655 | Bb(c, a, b); 2656 | }; 2657 | Q.prototype.__destroy__ = Q.prototype.__destroy__ = function () { 2658 | Cb(this.ptr); 2659 | }; 2660 | g.prototype = Object.create(m.prototype); 2661 | g.prototype.constructor = g; 2662 | g.prototype.__class__ = g; 2663 | g.__cache__ = {}; 2664 | a.Decoder = g; 2665 | g.prototype.GetEncodedGeometryType = g.prototype.GetEncodedGeometryType = function ( 2666 | a 2667 | ) { 2668 | var c = this.ptr; 2669 | a && "object" === typeof a && (a = a.ptr); 2670 | return Ub(c, a); 2671 | }; 2672 | g.prototype.DecodeBufferToPointCloud = g.prototype.DecodeBufferToPointCloud = function ( 2673 | a, 2674 | b 2675 | ) { 2676 | var c = this.ptr; 2677 | a && "object" === typeof a && (a = a.ptr); 2678 | b && "object" === typeof b && (b = b.ptr); 2679 | return T(Eb(c, a, b), z); 2680 | }; 2681 | g.prototype.DecodeBufferToMesh = g.prototype.DecodeBufferToMesh = function ( 2682 | a, 2683 | b 2684 | ) { 2685 | var c = this.ptr; 2686 | a && "object" === typeof a && (a = a.ptr); 2687 | b && "object" === typeof b && (b = b.ptr); 2688 | return T(Db(c, a, b), z); 2689 | }; 2690 | g.prototype.GetAttributeId = g.prototype.GetAttributeId = function (a, b) { 2691 | var c = this.ptr; 2692 | a && "object" === typeof a && (a = a.ptr); 2693 | b && "object" === typeof b && (b = b.ptr); 2694 | return Kb(c, a, b); 2695 | }; 2696 | g.prototype.GetAttributeIdByName = g.prototype.GetAttributeIdByName = function ( 2697 | a, 2698 | b 2699 | ) { 2700 | var c = this.ptr; 2701 | l.prepare(); 2702 | a && "object" === typeof a && (a = a.ptr); 2703 | b = b && "object" === typeof b ? b.ptr : U(b); 2704 | return Jb(c, a, b); 2705 | }; 2706 | g.prototype.GetAttributeIdByMetadataEntry = g.prototype.GetAttributeIdByMetadataEntry = function ( 2707 | a, 2708 | b, 2709 | d 2710 | ) { 2711 | var c = this.ptr; 2712 | l.prepare(); 2713 | a && "object" === typeof a && (a = a.ptr); 2714 | b = b && "object" === typeof b ? b.ptr : U(b); 2715 | d = d && "object" === typeof d ? d.ptr : U(d); 2716 | return Ib(c, a, b, d); 2717 | }; 2718 | g.prototype.GetAttribute = g.prototype.GetAttribute = function (a, b) { 2719 | var c = this.ptr; 2720 | a && "object" === typeof a && (a = a.ptr); 2721 | b && "object" === typeof b && (b = b.ptr); 2722 | return T(Tb(c, a, b), n); 2723 | }; 2724 | g.prototype.GetAttributeByUniqueId = g.prototype.GetAttributeByUniqueId = function ( 2725 | a, 2726 | b 2727 | ) { 2728 | var c = this.ptr; 2729 | a && "object" === typeof a && (a = a.ptr); 2730 | b && "object" === typeof b && (b = b.ptr); 2731 | return T(Fb(c, a, b), n); 2732 | }; 2733 | g.prototype.GetMetadata = g.prototype.GetMetadata = function (a) { 2734 | var c = this.ptr; 2735 | a && "object" === typeof a && (a = a.ptr); 2736 | return T(Wb(c, a), R); 2737 | }; 2738 | g.prototype.GetAttributeMetadata = g.prototype.GetAttributeMetadata = function ( 2739 | a, 2740 | b 2741 | ) { 2742 | var c = this.ptr; 2743 | a && "object" === typeof a && (a = a.ptr); 2744 | b && "object" === typeof b && (b = b.ptr); 2745 | return T(Pb(c, a, b), R); 2746 | }; 2747 | g.prototype.GetFaceFromMesh = g.prototype.GetFaceFromMesh = function ( 2748 | a, 2749 | b, 2750 | d 2751 | ) { 2752 | var c = this.ptr; 2753 | a && "object" === typeof a && (a = a.ptr); 2754 | b && "object" === typeof b && (b = b.ptr); 2755 | d && "object" === typeof d && (d = d.ptr); 2756 | return !!Vb(c, a, b, d); 2757 | }; 2758 | g.prototype.GetTriangleStripsFromMesh = g.prototype.GetTriangleStripsFromMesh = function ( 2759 | a, 2760 | b 2761 | ) { 2762 | var c = this.ptr; 2763 | a && "object" === typeof a && (a = a.ptr); 2764 | b && "object" === typeof b && (b = b.ptr); 2765 | return Xb(c, a, b); 2766 | }; 2767 | g.prototype.GetAttributeFloat = g.prototype.GetAttributeFloat = function ( 2768 | a, 2769 | b, 2770 | d 2771 | ) { 2772 | var c = this.ptr; 2773 | a && "object" === typeof a && (a = a.ptr); 2774 | b && "object" === typeof b && (b = b.ptr); 2775 | d && "object" === typeof d && (d = d.ptr); 2776 | return !!Hb(c, a, b, d); 2777 | }; 2778 | g.prototype.GetAttributeFloatForAllPoints = g.prototype.GetAttributeFloatForAllPoints = function ( 2779 | a, 2780 | b, 2781 | d 2782 | ) { 2783 | var c = this.ptr; 2784 | a && "object" === typeof a && (a = a.ptr); 2785 | b && "object" === typeof b && (b = b.ptr); 2786 | d && "object" === typeof d && (d = d.ptr); 2787 | return !!Gb(c, a, b, d); 2788 | }; 2789 | g.prototype.GetAttributeIntForAllPoints = g.prototype.GetAttributeIntForAllPoints = function ( 2790 | a, 2791 | b, 2792 | d 2793 | ) { 2794 | var c = this.ptr; 2795 | a && "object" === typeof a && (a = a.ptr); 2796 | b && "object" === typeof b && (b = b.ptr); 2797 | d && "object" === typeof d && (d = d.ptr); 2798 | return !!Ob(c, a, b, d); 2799 | }; 2800 | g.prototype.GetAttributeInt8ForAllPoints = g.prototype.GetAttributeInt8ForAllPoints = function ( 2801 | a, 2802 | b, 2803 | d 2804 | ) { 2805 | var c = this.ptr; 2806 | a && "object" === typeof a && (a = a.ptr); 2807 | b && "object" === typeof b && (b = b.ptr); 2808 | d && "object" === typeof d && (d = d.ptr); 2809 | return !!Nb(c, a, b, d); 2810 | }; 2811 | g.prototype.GetAttributeUInt8ForAllPoints = g.prototype.GetAttributeUInt8ForAllPoints = function ( 2812 | a, 2813 | b, 2814 | d 2815 | ) { 2816 | var c = this.ptr; 2817 | a && "object" === typeof a && (a = a.ptr); 2818 | b && "object" === typeof b && (b = b.ptr); 2819 | d && "object" === typeof d && (d = d.ptr); 2820 | return !!Sb(c, a, b, d); 2821 | }; 2822 | g.prototype.GetAttributeInt16ForAllPoints = g.prototype.GetAttributeInt16ForAllPoints = function ( 2823 | a, 2824 | b, 2825 | d 2826 | ) { 2827 | var c = this.ptr; 2828 | a && "object" === typeof a && (a = a.ptr); 2829 | b && "object" === typeof b && (b = b.ptr); 2830 | d && "object" === typeof d && (d = d.ptr); 2831 | return !!Lb(c, a, b, d); 2832 | }; 2833 | g.prototype.GetAttributeUInt16ForAllPoints = g.prototype.GetAttributeUInt16ForAllPoints = function ( 2834 | a, 2835 | b, 2836 | d 2837 | ) { 2838 | var c = this.ptr; 2839 | a && "object" === typeof a && (a = a.ptr); 2840 | b && "object" === typeof b && (b = b.ptr); 2841 | d && "object" === typeof d && (d = d.ptr); 2842 | return !!Qb(c, a, b, d); 2843 | }; 2844 | g.prototype.GetAttributeInt32ForAllPoints = g.prototype.GetAttributeInt32ForAllPoints = function ( 2845 | a, 2846 | b, 2847 | d 2848 | ) { 2849 | var c = this.ptr; 2850 | a && "object" === typeof a && (a = a.ptr); 2851 | b && "object" === typeof b && (b = b.ptr); 2852 | d && "object" === typeof d && (d = d.ptr); 2853 | return !!Mb(c, a, b, d); 2854 | }; 2855 | g.prototype.GetAttributeUInt32ForAllPoints = g.prototype.GetAttributeUInt32ForAllPoints = function ( 2856 | a, 2857 | b, 2858 | d 2859 | ) { 2860 | var c = this.ptr; 2861 | a && "object" === typeof a && (a = a.ptr); 2862 | b && "object" === typeof b && (b = b.ptr); 2863 | d && "object" === typeof d && (d = d.ptr); 2864 | return !!Rb(c, a, b, d); 2865 | }; 2866 | g.prototype.SkipAttributeTransform = g.prototype.SkipAttributeTransform = function ( 2867 | a 2868 | ) { 2869 | var c = this.ptr; 2870 | a && "object" === typeof a && (a = a.ptr); 2871 | Yb(c, a); 2872 | }; 2873 | g.prototype.__destroy__ = g.prototype.__destroy__ = function () { 2874 | Zb(this.ptr); 2875 | }; 2876 | C.prototype = Object.create(m.prototype); 2877 | C.prototype.constructor = C; 2878 | C.prototype.__class__ = C; 2879 | C.__cache__ = {}; 2880 | a.Mesh = C; 2881 | C.prototype.num_faces = C.prototype.num_faces = function () { 2882 | return xc(this.ptr); 2883 | }; 2884 | C.prototype.num_attributes = C.prototype.num_attributes = function () { 2885 | return wc(this.ptr); 2886 | }; 2887 | C.prototype.num_points = C.prototype.num_points = function () { 2888 | return yc(this.ptr); 2889 | }; 2890 | C.prototype.__destroy__ = C.prototype.__destroy__ = function () { 2891 | vc(this.ptr); 2892 | }; 2893 | X.prototype = Object.create(m.prototype); 2894 | X.prototype.constructor = X; 2895 | X.prototype.__class__ = X; 2896 | X.__cache__ = {}; 2897 | a.VoidPtr = X; 2898 | X.prototype.__destroy__ = X.prototype.__destroy__ = function () { 2899 | ad(this.ptr); 2900 | }; 2901 | N.prototype = Object.create(m.prototype); 2902 | N.prototype.constructor = N; 2903 | N.prototype.__class__ = N; 2904 | N.__cache__ = {}; 2905 | a.DracoInt32Array = N; 2906 | N.prototype.GetValue = N.prototype.GetValue = function (a) { 2907 | var b = this.ptr; 2908 | a && "object" === typeof a && (a = a.ptr); 2909 | return fc(b, a); 2910 | }; 2911 | N.prototype.size = N.prototype.size = function () { 2912 | return hc(this.ptr); 2913 | }; 2914 | N.prototype.__destroy__ = N.prototype.__destroy__ = function () { 2915 | gc(this.ptr); 2916 | }; 2917 | R.prototype = Object.create(m.prototype); 2918 | R.prototype.constructor = R; 2919 | R.prototype.__class__ = R; 2920 | R.__cache__ = {}; 2921 | a.Metadata = R; 2922 | R.prototype.__destroy__ = R.prototype.__destroy__ = function () { 2923 | Jc(this.ptr); 2924 | }; 2925 | (function () { 2926 | function c() { 2927 | a.OK = rd(); 2928 | a.ERROR = od(); 2929 | a.IO_ERROR = qd(); 2930 | a.INVALID_PARAMETER = pd(); 2931 | a.UNSUPPORTED_VERSION = td(); 2932 | a.UNKNOWN_VERSION = sd(); 2933 | a.INVALID_GEOMETRY_TYPE = fd(); 2934 | a.POINT_CLOUD = gd(); 2935 | a.TRIANGULAR_MESH = hd(); 2936 | a.ATTRIBUTE_INVALID_TRANSFORM = bd(); 2937 | a.ATTRIBUTE_NO_TRANSFORM = cd(); 2938 | a.ATTRIBUTE_QUANTIZATION_TRANSFORM = ed(); 2939 | a.ATTRIBUTE_OCTAHEDRON_TRANSFORM = dd(); 2940 | a.INVALID = kd(); 2941 | a.POSITION = md(); 2942 | a.NORMAL = ld(); 2943 | a.COLOR = id(); 2944 | a.TEX_COORD = nd(); 2945 | a.GENERIC = jd(); 2946 | } 2947 | a.calledRun ? c() : Na.unshift(c); 2948 | })(); 2949 | if ("function" === typeof a.onModuleParsed) a.onModuleParsed(); 2950 | return d; 2951 | }; 2952 | "object" === typeof exports && "object" === typeof module 2953 | ? (module.exports = DracoDecoderModule) 2954 | : "function" === typeof define && define.amd 2955 | ? define([], function () { 2956 | return DracoDecoderModule; 2957 | }) 2958 | : "object" === typeof exports && 2959 | (exports.DracoDecoderModule = DracoDecoderModule); 2960 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ritz078/reference/cbc20ed0c9fd2be373156718f7711b5dd4a88d66/public/favicon.ico -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ritz078/reference/cbc20ed0c9fd2be373156718f7711b5dd4a88d66/public/logo.png -------------------------------------------------------------------------------- /public/models/female.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ritz078/reference/cbc20ed0c9fd2be373156718f7711b5dd4a88d66/public/models/female.glb -------------------------------------------------------------------------------- /public/models/male.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ritz078/reference/cbc20ed0c9fd2be373156718f7711b5dd4a88d66/public/models/male.glb -------------------------------------------------------------------------------- /reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ritz078/reference/cbc20ed0c9fd2be373156718f7711b5dd4a88d66/reference.png -------------------------------------------------------------------------------- /src/components/ModelContainer/ModelContainer.tsx: -------------------------------------------------------------------------------- 1 | import React, { memo, useCallback, useEffect, useMemo, useRef } from "react"; 2 | import { useThree } from "react-three-fiber"; 3 | import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"; 4 | import { 5 | SkinnedMesh, 6 | Mesh, 7 | MeshBasicMaterial, 8 | SphereBufferGeometry, 9 | MeshStandardMaterial, 10 | GridHelper, 11 | Color, 12 | SpotLight, 13 | } from "three"; 14 | import { useTransformOnClick } from "@hooks/useTransformOnClick"; 15 | import { useLoader } from "@hooks/useLoader"; 16 | import { MODEL_NAME } from "@constants/name"; 17 | import { getModelCenter } from "@utils/geometry"; 18 | import { useEnvironment } from "@stores/environment"; 19 | import { useMaterial } from "@stores/material"; 20 | import { useSobelRenderPass } from "@hooks/useSobelRenderPass"; 21 | import { useMode } from "@stores/mode"; 22 | import { useScene } from "@stores/scene"; 23 | 24 | function _ModelContainer({ onInitialModelLoad }) { 25 | const { scene, gl, camera } = useThree(); 26 | const gridHelperRef = useRef(null); 27 | const boneMeshMaterial = useMemo( 28 | () => 29 | new MeshBasicMaterial({ 30 | color: "red", 31 | wireframe: true, 32 | }), 33 | [] 34 | ); 35 | 36 | const { model: modelName, setRenderer } = useScene(); 37 | const { showGrid } = useEnvironment(); 38 | const { materialColor } = useMaterial(); 39 | const editMode = useMode((state) => state.editMode); 40 | 41 | useEffect(() => { 42 | if (gridHelperRef.current) { 43 | scene.remove(gridHelperRef.current); 44 | } 45 | 46 | if (showGrid) { 47 | const gridHelper = new GridHelper(1000, 50); 48 | gridHelperRef.current = gridHelper; 49 | scene.add(gridHelper); 50 | } 51 | }, [showGrid]); 52 | 53 | const orbitalControls = useMemo(() => { 54 | const orbitalControls = new OrbitControls(camera, gl.domElement); 55 | orbitalControls.maxDistance = 500; 56 | orbitalControls.minDistance = 50; 57 | orbitalControls.screenSpacePanning = false; 58 | return orbitalControls; 59 | }, []); 60 | 61 | useTransformOnClick(orbitalControls); 62 | useSobelRenderPass(); 63 | 64 | useEffect(() => { 65 | const model = scene.getObjectByName(MODEL_NAME); 66 | 67 | model?.traverse((object) => { 68 | if (object instanceof SkinnedMesh) { 69 | if (object.material instanceof MeshStandardMaterial) { 70 | object.material.wireframe = editMode; 71 | } 72 | } 73 | }); 74 | 75 | boneMeshMaterial.visible = editMode; 76 | }, [editMode]); 77 | 78 | useEffect(() => { 79 | const model = scene.getObjectByName(MODEL_NAME); 80 | 81 | model?.traverse((object) => { 82 | if (object instanceof SkinnedMesh) { 83 | if (object.material instanceof MeshStandardMaterial) { 84 | object.material.color = new Color(materialColor); 85 | } 86 | } 87 | }); 88 | }, [materialColor]); 89 | 90 | const reset = useCallback(() => { 91 | const model = scene.getObjectByName(MODEL_NAME); 92 | orbitalControls.target = getModelCenter(model, modelName); 93 | orbitalControls.update(); 94 | }, [scene, orbitalControls, modelName]); 95 | 96 | const onLoad = useCallback(() => { 97 | const model = scene.getObjectByName(MODEL_NAME); 98 | 99 | model.traverse((object) => { 100 | if (object instanceof SkinnedMesh) { 101 | if (object.material instanceof MeshStandardMaterial) { 102 | object.material.wireframe = editMode; 103 | } 104 | 105 | const bbox = object.geometry.boundingBox; 106 | const rootBone = object.skeleton.bones[0]; 107 | 108 | const mesh = new Mesh(new SphereBufferGeometry(2.5), boneMeshMaterial); 109 | mesh.name = object.id.toString(10); 110 | rootBone.add(mesh); 111 | 112 | bbox.setFromObject(rootBone); 113 | } 114 | }); 115 | reset(); 116 | onInitialModelLoad(true); 117 | }, [editMode, onInitialModelLoad]); 118 | 119 | useEffect(() => { 120 | onInitialModelLoad(false); 121 | }, [modelName]); 122 | 123 | useLoader(modelName, onLoad); 124 | 125 | useEffect(() => { 126 | const spotLight = new SpotLight(0xffffff, 0.7); 127 | spotLight.position.set(50, 50, 300); 128 | scene.add(spotLight); 129 | 130 | const spotLightBack = new SpotLight(0xffffff, 0.7); 131 | spotLightBack.position.set(50, 50, -300); 132 | scene.add(spotLightBack); 133 | 134 | setRenderer(gl); 135 | }, []); 136 | 137 | return null; 138 | } 139 | 140 | export const ModelContainer = memo(_ModelContainer); 141 | -------------------------------------------------------------------------------- /src/components/ModelContainer/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./ModelContainer"; 2 | -------------------------------------------------------------------------------- /src/components/ModelLoader/ModelLoader.module.scss: -------------------------------------------------------------------------------- 1 | .loader { 2 | display: flex; 3 | flex: 1; 4 | justify-content: center; 5 | align-items: center; 6 | color: white; 7 | position: absolute; 8 | right: 0; 9 | left: 0; 10 | bottom: 0; 11 | top: 0; 12 | } 13 | -------------------------------------------------------------------------------- /src/components/ModelLoader/ModelLoader.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Canvas } from "react-three-fiber"; 3 | import { ModelContainer } from "../ModelContainer"; 4 | import styles from "./ModelLoader.module.scss"; 5 | import Icon from "@mdi/react"; 6 | import { mdiSnowflake } from "@mdi/js"; 7 | 8 | const cameraProps = { 9 | position: [100, 120, 200], 10 | }; 11 | 12 | const webRendererOptions = { 13 | // This is needed if you want to get the image 14 | // from the canvas. 15 | // https://stackoverflow.com/a/15563621/3366126 16 | preserveDrawingBuffer: true, 17 | }; 18 | 19 | export default function ModelLoader() { 20 | const [isModelLoaded, setIsModelLoaded] = useState(false); 21 | 22 | return ( 23 | <> 24 | {!isModelLoaded && ( 25 |
26 | 27 |
28 | )} 29 |
35 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /src/components/ModelLoader/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./ModelLoader"; 2 | -------------------------------------------------------------------------------- /src/components/Settings/Settings.module.scss: -------------------------------------------------------------------------------- 1 | .settings { 2 | background-color: #ffffff0f; 3 | width: 270px; 4 | border-radius: 2px; 5 | display: flex; 6 | flex-direction: column; 7 | flex-shrink: 0; 8 | margin: 20px 0 20px 20px; 9 | 10 | @media screen and (max-width: 620px) { 11 | width: 100vw; 12 | margin: 0; 13 | padding: 0; 14 | } 15 | } 16 | 17 | .settingContent { 18 | display: flex; 19 | flex: 1; 20 | flex-direction: column; 21 | } 22 | 23 | .footer { 24 | color: #a2a2a2; 25 | font-size: 15px; 26 | padding: 20px 10px; 27 | text-align: center; 28 | border-top: 1px solid #2d2d2d; 29 | line-height: 21px; 30 | 31 | a { 32 | color: deepskyblue; 33 | margin-left: 5px; 34 | text-decoration: none; 35 | } 36 | 37 | @media screen and (max-width: 620px) { 38 | padding: 10px; 39 | } 40 | } 41 | 42 | .gender { 43 | display: flex; 44 | flex-direction: row; 45 | justify-content: center; 46 | padding: 10px; 47 | 48 | @media screen and (max-width: 620px) { 49 | justify-content: space-between; 50 | } 51 | } 52 | 53 | .iconButton { 54 | display: inline-flex; 55 | flex-direction: row; 56 | color: #ffffff; 57 | padding: 5px; 58 | background-color: #ffffff12; 59 | border-radius: 2px; 60 | margin: 0 10px; 61 | cursor: pointer; 62 | transition: background-color 200ms; 63 | border: 1px solid transparent; 64 | font-size: 14px; 65 | align-items: center; 66 | 67 | &:hover { 68 | background-color: rgba(255, 255, 255, 0.15); 69 | } 70 | 71 | &[aria-selected="true"] { 72 | border-color: #2196f3; 73 | } 74 | } 75 | 76 | .iconLabel { 77 | margin: 2px 5px; 78 | } 79 | 80 | .separator { 81 | margin: 10px 0; 82 | height: 1px; 83 | width: 100%; 84 | background-color: #333333; 85 | 86 | @media screen and (max-width: 620px) { 87 | margin: 0; 88 | } 89 | } 90 | 91 | .title { 92 | font-size: 14px; 93 | color: #ffffff; 94 | background-color: #ffffff1f; 95 | padding: 6px 20px; 96 | } 97 | 98 | .switchWrapper { 99 | display: flex; 100 | flex-direction: row; 101 | color: rgba(255, 255, 255, 0.75); 102 | justify-content: space-between; 103 | font-size: 14px; 104 | padding: 10px 0; 105 | margin: 0 20px; 106 | border-bottom: 1px solid rgba(255, 255, 255, 0.05); 107 | cursor: pointer; 108 | 109 | @media screen and (max-width: 620px) { 110 | margin: 0; 111 | padding: 10px; 112 | width: 50%; 113 | } 114 | } 115 | 116 | .switchWrapperContainer { 117 | @media screen and (max-width: 620px) { 118 | display: flex; 119 | margin: 0 10px; 120 | flex-wrap: wrap; 121 | } 122 | } 123 | 124 | .disabled { 125 | opacity: 0.3; 126 | pointer-events: none; 127 | } 128 | 129 | .colorModal { 130 | position: absolute; 131 | z-index: 9; 132 | margin-top: 5px; 133 | transform: translateX(-204px); 134 | } 135 | 136 | .colorSwatch { 137 | height: 20px; 138 | width: 20px; 139 | border-radius: 2px; 140 | } 141 | 142 | .colorWrapper { 143 | position: relative; 144 | } 145 | 146 | .download { 147 | @extend .iconButton; 148 | margin: 15px 10px 10px; 149 | padding: 6px 15px; 150 | text-align: center; 151 | outline: none; 152 | width: 100px; 153 | justify-content: center; 154 | align-self: center; 155 | 156 | @media screen and (max-width: 620px) { 157 | display: none; 158 | } 159 | } 160 | 161 | .name { 162 | background-image: url(/logo.png); 163 | height: 45px; 164 | background-repeat: no-repeat; 165 | background-size: contain; 166 | margin: 10px 30px 15px; 167 | background-position: center; 168 | 169 | @media screen and (max-width: 620px) { 170 | display: none; 171 | } 172 | } 173 | 174 | .downloadMobile { 175 | display: none; 176 | @media screen and (max-width: 620px) { 177 | display: block; 178 | } 179 | } 180 | 181 | .switch { 182 | pointer-events: none; 183 | } 184 | -------------------------------------------------------------------------------- /src/components/Settings/Settings.tsx: -------------------------------------------------------------------------------- 1 | import React, { useCallback, useEffect, useRef, useState } from "react"; 2 | import styles from "./Settings.module.scss"; 3 | import Icon from "@mdi/react"; 4 | import { mdiDownload, mdiHumanFemale, mdiHumanMale } from "@mdi/js"; 5 | import { IconProps } from "@mdi/react/dist/IconProps"; 6 | import { useEnvironment } from "@stores/environment"; 7 | import Switch from "react-switch"; 8 | import { useMaterial } from "@stores/material"; 9 | import { ChromePicker } from "react-color"; 10 | import { usePostProcessing } from "@stores/postProcessing"; 11 | import { useMode } from "@stores/mode"; 12 | import { useScene } from "@stores/scene"; 13 | import { MODEL_NAME } from "@constants/name"; 14 | 15 | interface IconButtonProps extends IconProps { 16 | label?: string; 17 | onClick?: () => void; 18 | selected?: boolean; 19 | } 20 | 21 | export function Settings() { 22 | const { showGrid, toggleGrid } = useEnvironment(); 23 | const { materialColor, setMaterialColor } = useMaterial(); 24 | const { editMode, toggleEditMode } = useMode(); 25 | const { sobelRenderPass, toggleSobelRenderPass } = usePostProcessing(); 26 | const { setModel, renderer, model } = useScene(); 27 | 28 | const download = useCallback(() => { 29 | if (!renderer) return; 30 | 31 | const dataURL = renderer.domElement.toDataURL(); 32 | const a = document.createElement("a"); 33 | a.href = dataURL; 34 | a.style.display = "none"; 35 | a.download = `${MODEL_NAME}.png`; 36 | document.body.appendChild(a); 37 | a.click(); 38 | document.body.removeChild(a); 39 | }, [renderer]); 40 | 41 | const _toggleSobelRenderPass = useCallback(() => { 42 | if (editMode) { 43 | toggleEditMode(); 44 | } 45 | 46 | if (showGrid) { 47 | toggleGrid(); 48 | } 49 | 50 | toggleSobelRenderPass(); 51 | }, [showGrid, editMode]); 52 | 53 | return ( 54 |
55 |
56 |
57 |
58 |
59 | setModel("male")} 62 | path={mdiHumanMale} 63 | selected={model === "male"} 64 | /> 65 | setModel("female")} 68 | path={mdiHumanFemale} 69 | selected={model === "female"} 70 | /> 71 |
72 | 73 |
74 | 79 |
80 |
81 | 82 |
83 | 84 |
85 | { 87 | if (sobelRenderPass) { 88 | toggleSobelRenderPass(); 89 | } 90 | toggleEditMode(); 91 | }} 92 | checked={editMode} 93 | label={"Edit"} 94 | /> 95 | 96 | 101 | 106 | 107 | 112 |
113 |
114 | Download 115 |
116 |
117 | 123 |
124 | ); 125 | } 126 | 127 | function ColorPicker({ color, onChange, disabled = false }) { 128 | const [show, setShow] = useState(false); 129 | const divRef = useRef(null); 130 | 131 | useEffect(() => { 132 | function handleClick(e: MouseEvent) { 133 | if (!divRef.current.contains(e.target as Node)) { 134 | setShow(false); 135 | } else { 136 | e.preventDefault(); 137 | e.stopPropagation(); 138 | } 139 | } 140 | 141 | document.addEventListener("click", handleClick); 142 | return () => document.removeEventListener("click", handleClick); 143 | }, []); 144 | 145 | const className = `${styles.switchWrapper} ${ 146 | disabled ? styles.disabled : "" 147 | }`; 148 | 149 | return ( 150 |
151 | Model Color 152 |
153 |
setShow(!show)} 159 | /> 160 | 161 |
162 | {show && } 163 |
164 |
165 |
166 | ); 167 | } 168 | 169 | function SwitchButton({ label, checked, onChange, disabled = false }) { 170 | const className = `${styles.switchWrapper} ${ 171 | disabled ? styles.disabled : "" 172 | }`; 173 | 174 | return ( 175 |
176 | {label} 177 | {}} 182 | height={8} 183 | width={24} 184 | onColor="#2196f3" 185 | handleDiameter={16} 186 | className={styles.switch} 187 | /> 188 |
189 | ); 190 | } 191 | 192 | const IconButton = React.memo(function ({ 193 | className, 194 | label, 195 | onClick, 196 | title, 197 | selected, 198 | ...rest 199 | }: IconButtonProps) { 200 | return ( 201 |
207 | {" "} 208 | {label &&
{label}
} 209 |
210 | ); 211 | }); 212 | -------------------------------------------------------------------------------- /src/components/Settings/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Settings"; 2 | -------------------------------------------------------------------------------- /src/constants/name.ts: -------------------------------------------------------------------------------- 1 | import { name, version } from "../../package.json"; 2 | 3 | export const MODEL_NAME = `${name}-${version}`; 4 | -------------------------------------------------------------------------------- /src/hooks/useLoader.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useMemo } from "react"; 2 | import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader"; 3 | import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; 4 | import { useThree } from "react-three-fiber"; 5 | import { MODEL_NAME } from "@constants/name"; 6 | 7 | export function useLoader(path: string, onLoad: () => void) { 8 | const { scene } = useThree(); 9 | 10 | const loader = useMemo(() => { 11 | const loader = new GLTFLoader(); 12 | const dracoLoader = new DRACOLoader(); 13 | dracoLoader.setDecoderPath("/draco-gltf/"); 14 | loader.setDRACOLoader(dracoLoader); 15 | return loader; 16 | }, []); 17 | 18 | useEffect(() => { 19 | if (!path) return; 20 | 21 | if (scene.getObjectByName(MODEL_NAME)) { 22 | scene.remove(scene.getObjectByName(MODEL_NAME)); 23 | } 24 | loader.load(`/models/${path}.glb`, (gltf) => { 25 | scene.add(gltf.scene); 26 | gltf.scene.name = MODEL_NAME; 27 | 28 | onLoad(); 29 | }); 30 | }, [path, loader]); 31 | } 32 | -------------------------------------------------------------------------------- /src/hooks/useSobelRenderPass.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useMemo, useRef } from "react"; 2 | import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer"; 3 | import { useFrame, useThree } from "react-three-fiber"; 4 | import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass"; 5 | import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass"; 6 | import { SobelOperatorShader } from "three/examples/jsm/shaders/SobelOperatorShader"; 7 | import { usePostProcessing } from "@stores/postProcessing"; 8 | 9 | export function useSobelRenderPass() { 10 | const { scene, camera, gl, size } = useThree(); 11 | const soberRenderPass = usePostProcessing((state) => state.sobelRenderPass); 12 | 13 | const composer = useMemo(() => { 14 | const composer = new EffectComposer(gl); 15 | const renderPass = new RenderPass(scene, camera); 16 | composer.addPass(renderPass); 17 | 18 | const sobelEffect = new ShaderPass(SobelOperatorShader); 19 | sobelEffect.uniforms["resolution"].value.x = 20 | window.innerWidth * window.devicePixelRatio; 21 | sobelEffect.uniforms["resolution"].value.y = 22 | window.innerHeight * window.devicePixelRatio; 23 | 24 | composer.addPass(sobelEffect); 25 | return composer; 26 | }, [camera, scene, gl]); 27 | 28 | useEffect(() => { 29 | composer.setSize(size.width, size.height); 30 | }, [composer, size]); 31 | 32 | useFrame( 33 | (_, delta) => { 34 | if (soberRenderPass) { 35 | composer.render(delta); 36 | } 37 | }, 38 | soberRenderPass ? 1 : 0 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /src/hooks/useTransformOnClick.ts: -------------------------------------------------------------------------------- 1 | import { useThree } from "react-three-fiber"; 2 | import { useEffect, useMemo } from "react"; 3 | import { Mesh, SkinnedMesh } from "three"; 4 | import { TransformControls } from "three/examples/jsm/controls/TransformControls"; 5 | import { convertPointerToCoordinate } from "@utils/convertPointerToCoordinate"; 6 | import { usePostProcessing } from "@stores/postProcessing"; 7 | import { MODEL_NAME } from "@constants/name"; 8 | 9 | export function useTransformOnClick(orbitalControls) { 10 | const { raycaster, gl, camera, scene } = useThree(); 11 | const transformControls = useMemo( 12 | () => new TransformControls(camera, gl.domElement), 13 | [] 14 | ); 15 | const sobelRenderPass = usePostProcessing((state) => state.sobelRenderPass); 16 | 17 | useEffect(() => { 18 | function handleChange(e) { 19 | orbitalControls.enabled = !e.value; 20 | } 21 | 22 | transformControls.addEventListener("dragging-changed", handleChange); 23 | transformControls.mode = "rotate"; 24 | transformControls.axis = "local"; 25 | scene.add(transformControls); 26 | 27 | return () => { 28 | transformControls.removeEventListener("dragging-changed", handleChange); 29 | transformControls.dispose(); 30 | }; 31 | }, [transformControls]); 32 | 33 | useEffect(() => { 34 | function handleClick(ev: PointerEvent) { 35 | if (sobelRenderPass) return; 36 | ev.preventDefault(); 37 | 38 | raycaster.setFromCamera( 39 | convertPointerToCoordinate(ev, gl.domElement), 40 | camera 41 | ); 42 | 43 | const intersects = raycaster.intersectObject( 44 | scene.getObjectByName(MODEL_NAME), 45 | true 46 | ); 47 | 48 | const intersectedBoneMesh = intersects.filter( 49 | (x) => x.object instanceof Mesh && !(x.object instanceof SkinnedMesh) 50 | ); 51 | 52 | if (intersectedBoneMesh.length) { 53 | const boneMesh = intersectedBoneMesh[0].object as Mesh; 54 | const rootBone = boneMesh.parent; 55 | 56 | transformControls.attach(rootBone); 57 | } 58 | // checking if orbitalControls is enabled tells us whether the uer clicked 59 | // somewhere on the canvas or if it's just the pointerup event that is triggered when 60 | // we stop the dragging of transformControls. We detach the transformControl only if 61 | // the user has clicked somewhere else in the canvas. 62 | else if (orbitalControls.enabled) { 63 | transformControls.detach(); 64 | } 65 | } 66 | 67 | gl.domElement.addEventListener("pointerup", handleClick); 68 | return () => { 69 | gl.domElement.addEventListener("pointerup", handleClick); 70 | }; 71 | }, [sobelRenderPass, orbitalControls]); 72 | } 73 | -------------------------------------------------------------------------------- /src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import "../styles/main.scss"; 2 | import React from "react"; 3 | import Head from "next/head"; 4 | 5 | export default function MyApp({ Component, pageProps }) { 6 | return ( 7 | <> 8 | 9 | Reference 10 | 14 | 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import dynamic from "next/dynamic"; 3 | import { Settings } from "@components/Settings"; 4 | import GitHubCorners from "react-github-corner"; 5 | 6 | const Scene = dynamic(() => import("@components/ModelLoader/ModelLoader"), { 7 | ssr: false, 8 | }); 9 | 10 | export default function App() { 11 | return ( 12 |
13 | 14 |
15 | 16 |
17 | 22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /src/stores/environment.ts: -------------------------------------------------------------------------------- 1 | import create from "zustand"; 2 | 3 | const [useEnvironment] = create((set) => ({ 4 | showGrid: true, 5 | toggleGrid: () => 6 | set((state) => ({ 7 | showGrid: !state.showGrid, 8 | })), 9 | })); 10 | 11 | export { useEnvironment }; 12 | 13 | interface IEnvironmentState { 14 | showGrid: boolean; 15 | toggleGrid: () => void; 16 | } 17 | -------------------------------------------------------------------------------- /src/stores/material.ts: -------------------------------------------------------------------------------- 1 | import create from "zustand"; 2 | 3 | const [useMaterial] = create((set) => ({ 4 | materialColor: "#fff", 5 | setMaterialColor: (color) => 6 | set({ 7 | materialColor: color.hex, 8 | }), 9 | })); 10 | 11 | export { useMaterial }; 12 | -------------------------------------------------------------------------------- /src/stores/mode.ts: -------------------------------------------------------------------------------- 1 | import create from "zustand"; 2 | 3 | interface IMode { 4 | editMode: boolean; 5 | toggleEditMode: () => void; 6 | } 7 | 8 | const [useMode] = create((set) => ({ 9 | editMode: true, 10 | toggleEditMode: () => 11 | set((state) => ({ 12 | editMode: !state.editMode, 13 | })), 14 | })); 15 | 16 | export { useMode }; 17 | -------------------------------------------------------------------------------- /src/stores/postProcessing.ts: -------------------------------------------------------------------------------- 1 | import create from "zustand"; 2 | 3 | const [usePostProcessing] = create((set) => ({ 4 | sobelRenderPass: false, 5 | toggleSobelRenderPass: () => { 6 | set((state) => ({ 7 | sobelRenderPass: !state.sobelRenderPass, 8 | })); 9 | }, 10 | })); 11 | 12 | export { usePostProcessing }; 13 | 14 | interface IPostProcessing { 15 | sobelRenderPass: boolean; 16 | toggleSobelRenderPass: () => void; 17 | } 18 | -------------------------------------------------------------------------------- /src/stores/scene.ts: -------------------------------------------------------------------------------- 1 | import create from "zustand"; 2 | import { WebGLRenderer } from "three"; 3 | 4 | interface ILoadedModel { 5 | model: string; 6 | setModel: (name: string) => void; 7 | renderer: WebGLRenderer; 8 | setRenderer: (renderer: WebGLRenderer) => void; 9 | } 10 | 11 | const [useScene] = create((set) => ({ 12 | model: "male", 13 | setModel: (model: string) => 14 | set({ 15 | model, 16 | }), 17 | renderer: null, 18 | setRenderer: (renderer) => 19 | set({ 20 | renderer, 21 | }), 22 | })); 23 | 24 | export { useScene }; 25 | -------------------------------------------------------------------------------- /src/styles/main.scss: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Lato:wght@300;400&display=swap"); 2 | 3 | * { 4 | margin: 0; 5 | padding: 0; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | box-sizing: border-box; 9 | font-family: "Lato", sans-serif; 10 | } 11 | 12 | html, 13 | body { 14 | overflow: hidden; 15 | width: 100vw; 16 | height: 100vh; 17 | background-image: radial-gradient(#2b2b2b, #000000); 18 | } 19 | 20 | .container { 21 | display: flex; 22 | flex: 1; 23 | position: relative; 24 | overflow: hidden; 25 | } 26 | 27 | .container:focus, 28 | .container > div:focus, 29 | .container canvas:focus { 30 | outline: none; 31 | } 32 | 33 | .wrapper { 34 | display: flex; 35 | flex-direction: row; 36 | width: 100vw; 37 | height: 100vh; 38 | flex: 1; 39 | 40 | @media screen and (max-width: 620px) { 41 | flex-direction: column-reverse; 42 | } 43 | } 44 | 45 | .chrome-picker { 46 | background-color: rgb(255 255 255 / 8%) !important; 47 | } 48 | -------------------------------------------------------------------------------- /src/utils/assert.ts: -------------------------------------------------------------------------------- 1 | export function assert(condition: any, msg?: string): asserts condition { 2 | if (!condition) { 3 | throw new Error(msg); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/utils/convertPointerToCoordinate.ts: -------------------------------------------------------------------------------- 1 | export function convertPointerToCoordinate( 2 | event: PointerEvent, 3 | domElement: HTMLCanvasElement 4 | ) { 5 | const SIDEBAR_WIDTH = window.screen.width < 620 ? 0 : 290; 6 | 7 | const x = 8 | ((event.clientX - SIDEBAR_WIDTH) / domElement.parentElement.clientWidth) * 9 | 2 - 10 | 1; 11 | const y = -(event.clientY / domElement.parentElement.clientHeight) * 2 + 1; 12 | 13 | return { x, y }; 14 | } 15 | -------------------------------------------------------------------------------- /src/utils/geometry.ts: -------------------------------------------------------------------------------- 1 | import { Box3, Object3D, Vector3 } from "three"; 2 | 3 | export function getCenter(model: Object3D): Vector3 { 4 | const box = new Box3(); 5 | box.setFromObject(model); 6 | const center = new Vector3(); 7 | box.getCenter(center); 8 | return center; 9 | } 10 | 11 | export function getModelCenter(model: Object3D, modelName: string) { 12 | const _model = 13 | modelName === "male" || modelName === "female" 14 | ? model.children[0].children[0] 15 | : model; 16 | 17 | return getCenter(_model); 18 | } 19 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": false, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "baseUrl": "./src", 17 | "paths": { 18 | "@hooks/*": ["./hooks/*"], 19 | "@components/*": ["./components/*"], 20 | "@utils/*": ["./utils/*"], 21 | "@constants/*": ["./constants/*"], 22 | "@stores/*": ["./stores/*"] 23 | } 24 | }, 25 | "exclude": ["node_modules"], 26 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] 27 | } 28 | -------------------------------------------------------------------------------- /typings.d.ts: -------------------------------------------------------------------------------- 1 | declare const DEV: boolean; 2 | declare const __THREE_DEVTOOLS__: any; 3 | --------------------------------------------------------------------------------