minecraft-renderer 0.1.39 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/mesher.js +8 -8
  2. package/dist/mesher.js.map +4 -4
  3. package/dist/mesherWasm.js +94 -94
  4. package/dist/minecraft-renderer.js +57 -57
  5. package/dist/minecraft-renderer.js.meta.json +1 -1
  6. package/dist/threeWorker.js +66 -66
  7. package/package.json +3 -4
  8. package/src/bundler/bundlePrepare.ts +56 -0
  9. package/src/graphicsBackend/appViewer.ts +10 -0
  10. package/src/graphicsBackend/config.ts +5 -1
  11. package/src/graphicsBackend/preloadWorkers.ts +187 -0
  12. package/src/lib/worldrendererCommon.ts +26 -2
  13. package/src/{mesher → mesher-legacy}/mesher.ts +14 -4
  14. package/src/{mesher → mesher-legacy}/test/mesherTester.ts +2 -2
  15. package/src/{mesher → mesher-legacy}/test/run/test-js.ts +1 -1
  16. package/src/{mesher → mesher-legacy}/test/test-perf.ts +1 -1
  17. package/src/{mesher → mesher-legacy}/test/tests.test.ts +1 -1
  18. package/src/{mesher → mesher-shared}/shared.ts +2 -0
  19. package/src/playground/allEntitiesDebug.ts +1 -1
  20. package/src/three/chunkMeshManager.ts +1 -1
  21. package/src/three/entities.ts +19 -6
  22. package/src/three/entity/EntityMesh.ts +123 -140
  23. package/src/three/graphicsBackendBase.ts +13 -0
  24. package/src/three/holdingBlock.ts +1 -1
  25. package/src/three/holdingBlockLegacy.ts +1 -1
  26. package/src/three/modules/sciFiWorldReveal.ts +1 -1
  27. package/src/three/worldRendererThree.ts +2 -2
  28. package/src/wasm-mesher/README.md +90 -0
  29. package/src/{wasm-lib → wasm-mesher/bridge}/convertChunk.ts +2 -2
  30. package/src/{wasm-lib → wasm-mesher/bridge}/render-from-wasm.ts +4 -4
  31. package/src/wasm-mesher/runtime-build/wasm_mesher.d.ts +210 -0
  32. package/src/wasm-mesher/runtime-build/wasm_mesher.js +881 -0
  33. package/src/wasm-mesher/runtime-build/wasm_mesher_bg.wasm +0 -0
  34. package/src/wasm-mesher/runtime-build/wasm_mesher_bg.wasm.d.ts +24 -0
  35. package/src/{mesher/test → wasm-mesher/tests}/heightmapParity.test.ts +4 -4
  36. package/src/{mesher/test → wasm-mesher/tests}/mesherWasmConversionCache.test.ts +2 -2
  37. package/src/{mesher/test → wasm-mesher/tests}/splitColumnWasmOutput.test.ts +1 -1
  38. package/src/wasm-mesher/worker/mesherWasm.ts +1247 -0
  39. package/src/{mesher → wasm-mesher/worker}/mesherWasmConversionCache.ts +1 -1
  40. package/src/worldView/types.ts +90 -0
  41. package/src/mesher/mesherWasm.ts +0 -696
  42. package/wasm/wasm_mesher.d.ts +0 -46
  43. package/wasm/wasm_mesher.js +0 -443
  44. package/wasm/wasm_mesher_bg.wasm +0 -0
  45. package/wasm/wasm_mesher_bg.wasm.d.ts +0 -9
  46. /package/src/{mesher → mesher-legacy}/test/a.ts +0 -0
  47. /package/src/{mesher → mesher-legacy}/test/playground.ts +0 -0
  48. /package/src/{mesher → mesher-legacy}/test/run/chunk.ts +0 -0
  49. /package/src/{mesher → mesher-legacy}/test/snapshotUtils.ts +0 -0
  50. /package/src/{mesher → mesher-shared}/blockEntityMetadata.ts +0 -0
  51. /package/src/{mesher → mesher-shared}/computeHeightmap.ts +0 -0
  52. /package/src/{mesher → mesher-shared}/models.ts +0 -0
  53. /package/src/{mesher → mesher-shared}/modelsGeometryCommon.ts +0 -0
  54. /package/src/{mesher → mesher-shared}/standaloneRenderer.ts +0 -0
  55. /package/src/{mesher → mesher-shared}/world.ts +0 -0
  56. /package/src/{mesher → mesher-shared}/worldConstants.ts +0 -0
  57. /package/src/{mesher → wasm-mesher/worker}/mesherWasmRequestTracker.ts +0 -0
@@ -1,46 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
-
4
- /**
5
- * Main entry point for generating geometry
6
- *
7
- * Input: Serialized chunk data as TypedArrays
8
- * Output: Geometry data (positions, normals, colors, uvs, indices)
9
- */
10
- export function generate_geometry(section_x: number, section_y: number, section_z: number, section_height: number, world_min_y: number, world_max_y: number, section_data_start_y: number, block_states: Uint16Array, block_light: Uint8Array, sky_light: Uint8Array, biomes: Uint8Array, invisible_blocks: Uint16Array, transparent_blocks: Uint16Array, no_ao_blocks: Uint16Array, cull_identical_blocks: Uint16Array, occluding_blocks: Uint16Array, enable_lighting: boolean, smooth_lighting: boolean, sky_light_value: number): any;
11
-
12
- export function generate_geometry_multi(section_x: number, section_y: number, section_z: number, section_height: number, world_min_y: number, world_max_y: number, section_data_start_y: number, chunk_xs: Int32Array, chunk_zs: Int32Array, block_states: Uint16Array, block_light: Uint8Array, sky_light: Uint8Array, biomes: Uint8Array, invisible_blocks: Uint16Array, transparent_blocks: Uint16Array, no_ao_blocks: Uint16Array, cull_identical_blocks: Uint16Array, occluding_blocks: Uint16Array, enable_lighting: boolean, smooth_lighting: boolean, sky_light_value: number): any;
13
-
14
- export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
15
-
16
- export interface InitOutput {
17
- readonly memory: WebAssembly.Memory;
18
- readonly generate_geometry: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number) => any;
19
- readonly generate_geometry_multi: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number) => any;
20
- readonly __wbindgen_malloc: (a: number, b: number) => number;
21
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
22
- readonly __wbindgen_externrefs: WebAssembly.Table;
23
- readonly __wbindgen_start: () => void;
24
- }
25
-
26
- export type SyncInitInput = BufferSource | WebAssembly.Module;
27
-
28
- /**
29
- * Instantiates the given `module`, which can either be bytes or
30
- * a precompiled `WebAssembly.Module`.
31
- *
32
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
33
- *
34
- * @returns {InitOutput}
35
- */
36
- export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
37
-
38
- /**
39
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
40
- * for everything else, calls `WebAssembly.instantiate` directly.
41
- *
42
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
43
- *
44
- * @returns {Promise<InitOutput>}
45
- */
46
- export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -1,443 +0,0 @@
1
- let wasm;
2
-
3
- function debugString(val) {
4
- // primitive types
5
- const type = typeof val;
6
- if (type == 'number' || type == 'boolean' || val == null) {
7
- return `${val}`;
8
- }
9
- if (type == 'string') {
10
- return `"${val}"`;
11
- }
12
- if (type == 'symbol') {
13
- const description = val.description;
14
- if (description == null) {
15
- return 'Symbol';
16
- } else {
17
- return `Symbol(${description})`;
18
- }
19
- }
20
- if (type == 'function') {
21
- const name = val.name;
22
- if (typeof name == 'string' && name.length > 0) {
23
- return `Function(${name})`;
24
- } else {
25
- return 'Function';
26
- }
27
- }
28
- // objects
29
- if (Array.isArray(val)) {
30
- const length = val.length;
31
- let debug = '[';
32
- if (length > 0) {
33
- debug += debugString(val[0]);
34
- }
35
- for(let i = 1; i < length; i++) {
36
- debug += ', ' + debugString(val[i]);
37
- }
38
- debug += ']';
39
- return debug;
40
- }
41
- // Test for built-in
42
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
43
- let className;
44
- if (builtInMatches && builtInMatches.length > 1) {
45
- className = builtInMatches[1];
46
- } else {
47
- // Failed to match the standard '[object ClassName]'
48
- return toString.call(val);
49
- }
50
- if (className == 'Object') {
51
- // we're a user defined class or Object
52
- // JSON.stringify avoids problems with cycles, and is generally much
53
- // easier than looping through ownProperties of `val`.
54
- try {
55
- return 'Object(' + JSON.stringify(val) + ')';
56
- } catch (_) {
57
- return 'Object';
58
- }
59
- }
60
- // errors
61
- if (val instanceof Error) {
62
- return `${val.name}: ${val.message}\n${val.stack}`;
63
- }
64
- // TODO we could test for more things here, like `Set`s and `Map`s.
65
- return className;
66
- }
67
-
68
- let cachedDataViewMemory0 = null;
69
- function getDataViewMemory0() {
70
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
71
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
72
- }
73
- return cachedDataViewMemory0;
74
- }
75
-
76
- function getStringFromWasm0(ptr, len) {
77
- ptr = ptr >>> 0;
78
- return decodeText(ptr, len);
79
- }
80
-
81
- let cachedUint16ArrayMemory0 = null;
82
- function getUint16ArrayMemory0() {
83
- if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) {
84
- cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
85
- }
86
- return cachedUint16ArrayMemory0;
87
- }
88
-
89
- let cachedUint32ArrayMemory0 = null;
90
- function getUint32ArrayMemory0() {
91
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
92
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
93
- }
94
- return cachedUint32ArrayMemory0;
95
- }
96
-
97
- let cachedUint8ArrayMemory0 = null;
98
- function getUint8ArrayMemory0() {
99
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
100
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
101
- }
102
- return cachedUint8ArrayMemory0;
103
- }
104
-
105
- function passArray16ToWasm0(arg, malloc) {
106
- const ptr = malloc(arg.length * 2, 2) >>> 0;
107
- getUint16ArrayMemory0().set(arg, ptr / 2);
108
- WASM_VECTOR_LEN = arg.length;
109
- return ptr;
110
- }
111
-
112
- function passArray32ToWasm0(arg, malloc) {
113
- const ptr = malloc(arg.length * 4, 4) >>> 0;
114
- getUint32ArrayMemory0().set(arg, ptr / 4);
115
- WASM_VECTOR_LEN = arg.length;
116
- return ptr;
117
- }
118
-
119
- function passArray8ToWasm0(arg, malloc) {
120
- const ptr = malloc(arg.length * 1, 1) >>> 0;
121
- getUint8ArrayMemory0().set(arg, ptr / 1);
122
- WASM_VECTOR_LEN = arg.length;
123
- return ptr;
124
- }
125
-
126
- function passStringToWasm0(arg, malloc, realloc) {
127
- if (realloc === undefined) {
128
- const buf = cachedTextEncoder.encode(arg);
129
- const ptr = malloc(buf.length, 1) >>> 0;
130
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
131
- WASM_VECTOR_LEN = buf.length;
132
- return ptr;
133
- }
134
-
135
- let len = arg.length;
136
- let ptr = malloc(len, 1) >>> 0;
137
-
138
- const mem = getUint8ArrayMemory0();
139
-
140
- let offset = 0;
141
-
142
- for (; offset < len; offset++) {
143
- const code = arg.charCodeAt(offset);
144
- if (code > 0x7F) break;
145
- mem[ptr + offset] = code;
146
- }
147
- if (offset !== len) {
148
- if (offset !== 0) {
149
- arg = arg.slice(offset);
150
- }
151
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
152
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
153
- const ret = cachedTextEncoder.encodeInto(arg, view);
154
-
155
- offset += ret.written;
156
- ptr = realloc(ptr, len, offset, 1) >>> 0;
157
- }
158
-
159
- WASM_VECTOR_LEN = offset;
160
- return ptr;
161
- }
162
-
163
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
164
- cachedTextDecoder.decode();
165
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
166
- let numBytesDecoded = 0;
167
- function decodeText(ptr, len) {
168
- numBytesDecoded += len;
169
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
170
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
171
- cachedTextDecoder.decode();
172
- numBytesDecoded = len;
173
- }
174
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
175
- }
176
-
177
- const cachedTextEncoder = new TextEncoder();
178
-
179
- if (!('encodeInto' in cachedTextEncoder)) {
180
- cachedTextEncoder.encodeInto = function (arg, view) {
181
- const buf = cachedTextEncoder.encode(arg);
182
- view.set(buf);
183
- return {
184
- read: arg.length,
185
- written: buf.length
186
- };
187
- }
188
- }
189
-
190
- let WASM_VECTOR_LEN = 0;
191
-
192
- /**
193
- * Main entry point for generating geometry
194
- *
195
- * Input: Serialized chunk data as TypedArrays
196
- * Output: Geometry data (positions, normals, colors, uvs, indices)
197
- * @param {number} section_x
198
- * @param {number} section_y
199
- * @param {number} section_z
200
- * @param {number} section_height
201
- * @param {number} world_min_y
202
- * @param {number} world_max_y
203
- * @param {number} section_data_start_y
204
- * @param {Uint16Array} block_states
205
- * @param {Uint8Array} block_light
206
- * @param {Uint8Array} sky_light
207
- * @param {Uint8Array} biomes
208
- * @param {Uint16Array} invisible_blocks
209
- * @param {Uint16Array} transparent_blocks
210
- * @param {Uint16Array} no_ao_blocks
211
- * @param {Uint16Array} cull_identical_blocks
212
- * @param {Uint16Array} occluding_blocks
213
- * @param {boolean} enable_lighting
214
- * @param {boolean} smooth_lighting
215
- * @param {number} sky_light_value
216
- * @returns {any}
217
- */
218
- export function generate_geometry(section_x, section_y, section_z, section_height, world_min_y, world_max_y, section_data_start_y, block_states, block_light, sky_light, biomes, invisible_blocks, transparent_blocks, no_ao_blocks, cull_identical_blocks, occluding_blocks, enable_lighting, smooth_lighting, sky_light_value) {
219
- const ptr0 = passArray16ToWasm0(block_states, wasm.__wbindgen_malloc);
220
- const len0 = WASM_VECTOR_LEN;
221
- const ptr1 = passArray8ToWasm0(block_light, wasm.__wbindgen_malloc);
222
- const len1 = WASM_VECTOR_LEN;
223
- const ptr2 = passArray8ToWasm0(sky_light, wasm.__wbindgen_malloc);
224
- const len2 = WASM_VECTOR_LEN;
225
- const ptr3 = passArray8ToWasm0(biomes, wasm.__wbindgen_malloc);
226
- const len3 = WASM_VECTOR_LEN;
227
- const ptr4 = passArray16ToWasm0(invisible_blocks, wasm.__wbindgen_malloc);
228
- const len4 = WASM_VECTOR_LEN;
229
- const ptr5 = passArray16ToWasm0(transparent_blocks, wasm.__wbindgen_malloc);
230
- const len5 = WASM_VECTOR_LEN;
231
- const ptr6 = passArray16ToWasm0(no_ao_blocks, wasm.__wbindgen_malloc);
232
- const len6 = WASM_VECTOR_LEN;
233
- const ptr7 = passArray16ToWasm0(cull_identical_blocks, wasm.__wbindgen_malloc);
234
- const len7 = WASM_VECTOR_LEN;
235
- const ptr8 = passArray16ToWasm0(occluding_blocks, wasm.__wbindgen_malloc);
236
- const len8 = WASM_VECTOR_LEN;
237
- const ret = wasm.generate_geometry(section_x, section_y, section_z, section_height, world_min_y, world_max_y, section_data_start_y, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, enable_lighting, smooth_lighting, sky_light_value);
238
- return ret;
239
- }
240
-
241
- /**
242
- * @param {number} section_x
243
- * @param {number} section_y
244
- * @param {number} section_z
245
- * @param {number} section_height
246
- * @param {number} world_min_y
247
- * @param {number} world_max_y
248
- * @param {number} section_data_start_y
249
- * @param {Int32Array} chunk_xs
250
- * @param {Int32Array} chunk_zs
251
- * @param {Uint16Array} block_states
252
- * @param {Uint8Array} block_light
253
- * @param {Uint8Array} sky_light
254
- * @param {Uint8Array} biomes
255
- * @param {Uint16Array} invisible_blocks
256
- * @param {Uint16Array} transparent_blocks
257
- * @param {Uint16Array} no_ao_blocks
258
- * @param {Uint16Array} cull_identical_blocks
259
- * @param {Uint16Array} occluding_blocks
260
- * @param {boolean} enable_lighting
261
- * @param {boolean} smooth_lighting
262
- * @param {number} sky_light_value
263
- * @returns {any}
264
- */
265
- export function generate_geometry_multi(section_x, section_y, section_z, section_height, world_min_y, world_max_y, section_data_start_y, chunk_xs, chunk_zs, block_states, block_light, sky_light, biomes, invisible_blocks, transparent_blocks, no_ao_blocks, cull_identical_blocks, occluding_blocks, enable_lighting, smooth_lighting, sky_light_value) {
266
- const ptr0 = passArray32ToWasm0(chunk_xs, wasm.__wbindgen_malloc);
267
- const len0 = WASM_VECTOR_LEN;
268
- const ptr1 = passArray32ToWasm0(chunk_zs, wasm.__wbindgen_malloc);
269
- const len1 = WASM_VECTOR_LEN;
270
- const ptr2 = passArray16ToWasm0(block_states, wasm.__wbindgen_malloc);
271
- const len2 = WASM_VECTOR_LEN;
272
- const ptr3 = passArray8ToWasm0(block_light, wasm.__wbindgen_malloc);
273
- const len3 = WASM_VECTOR_LEN;
274
- const ptr4 = passArray8ToWasm0(sky_light, wasm.__wbindgen_malloc);
275
- const len4 = WASM_VECTOR_LEN;
276
- const ptr5 = passArray8ToWasm0(biomes, wasm.__wbindgen_malloc);
277
- const len5 = WASM_VECTOR_LEN;
278
- const ptr6 = passArray16ToWasm0(invisible_blocks, wasm.__wbindgen_malloc);
279
- const len6 = WASM_VECTOR_LEN;
280
- const ptr7 = passArray16ToWasm0(transparent_blocks, wasm.__wbindgen_malloc);
281
- const len7 = WASM_VECTOR_LEN;
282
- const ptr8 = passArray16ToWasm0(no_ao_blocks, wasm.__wbindgen_malloc);
283
- const len8 = WASM_VECTOR_LEN;
284
- const ptr9 = passArray16ToWasm0(cull_identical_blocks, wasm.__wbindgen_malloc);
285
- const len9 = WASM_VECTOR_LEN;
286
- const ptr10 = passArray16ToWasm0(occluding_blocks, wasm.__wbindgen_malloc);
287
- const len10 = WASM_VECTOR_LEN;
288
- const ret = wasm.generate_geometry_multi(section_x, section_y, section_z, section_height, world_min_y, world_max_y, section_data_start_y, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, ptr8, len8, ptr9, len9, ptr10, len10, enable_lighting, smooth_lighting, sky_light_value);
289
- return ret;
290
- }
291
-
292
- const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
293
-
294
- async function __wbg_load(module, imports) {
295
- if (typeof Response === 'function' && module instanceof Response) {
296
- if (typeof WebAssembly.instantiateStreaming === 'function') {
297
- try {
298
- return await WebAssembly.instantiateStreaming(module, imports);
299
- } catch (e) {
300
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
301
-
302
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
303
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
304
-
305
- } else {
306
- throw e;
307
- }
308
- }
309
- }
310
-
311
- const bytes = await module.arrayBuffer();
312
- return await WebAssembly.instantiate(bytes, imports);
313
- } else {
314
- const instance = await WebAssembly.instantiate(module, imports);
315
-
316
- if (instance instanceof WebAssembly.Instance) {
317
- return { instance, module };
318
- } else {
319
- return instance;
320
- }
321
- }
322
- }
323
-
324
- function __wbg_get_imports() {
325
- const imports = {};
326
- imports.wbg = {};
327
- imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
328
- const ret = Error(getStringFromWasm0(arg0, arg1));
329
- return ret;
330
- };
331
- imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
332
- const ret = debugString(arg1);
333
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
- const len1 = WASM_VECTOR_LEN;
335
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
336
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
337
- };
338
- imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
339
- throw new Error(getStringFromWasm0(arg0, arg1));
340
- };
341
- imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
342
- const ret = new Object();
343
- return ret;
344
- };
345
- imports.wbg.__wbg_new_25f239778d6112b9 = function() {
346
- const ret = new Array();
347
- return ret;
348
- };
349
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
350
- arg0[arg1] = arg2;
351
- };
352
- imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
353
- arg0[arg1 >>> 0] = arg2;
354
- };
355
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
356
- // Cast intrinsic for `Ref(String) -> Externref`.
357
- const ret = getStringFromWasm0(arg0, arg1);
358
- return ret;
359
- };
360
- imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
361
- // Cast intrinsic for `U64 -> Externref`.
362
- const ret = BigInt.asUintN(64, arg0);
363
- return ret;
364
- };
365
- imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
366
- // Cast intrinsic for `F64 -> Externref`.
367
- const ret = arg0;
368
- return ret;
369
- };
370
- imports.wbg.__wbindgen_init_externref_table = function() {
371
- const table = wasm.__wbindgen_externrefs;
372
- const offset = table.grow(4);
373
- table.set(0, undefined);
374
- table.set(offset + 0, undefined);
375
- table.set(offset + 1, null);
376
- table.set(offset + 2, true);
377
- table.set(offset + 3, false);
378
- };
379
-
380
- return imports;
381
- }
382
-
383
- function __wbg_finalize_init(instance, module) {
384
- wasm = instance.exports;
385
- __wbg_init.__wbindgen_wasm_module = module;
386
- cachedDataViewMemory0 = null;
387
- cachedUint16ArrayMemory0 = null;
388
- cachedUint32ArrayMemory0 = null;
389
- cachedUint8ArrayMemory0 = null;
390
-
391
-
392
- wasm.__wbindgen_start();
393
- return wasm;
394
- }
395
-
396
- function initSync(module) {
397
- if (wasm !== undefined) return wasm;
398
-
399
-
400
- if (typeof module !== 'undefined') {
401
- if (Object.getPrototypeOf(module) === Object.prototype) {
402
- ({module} = module)
403
- } else {
404
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
405
- }
406
- }
407
-
408
- const imports = __wbg_get_imports();
409
- if (!(module instanceof WebAssembly.Module)) {
410
- module = new WebAssembly.Module(module);
411
- }
412
- const instance = new WebAssembly.Instance(module, imports);
413
- return __wbg_finalize_init(instance, module);
414
- }
415
-
416
- async function __wbg_init(module_or_path) {
417
- if (wasm !== undefined) return wasm;
418
-
419
-
420
- if (typeof module_or_path !== 'undefined') {
421
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
422
- ({module_or_path} = module_or_path)
423
- } else {
424
- console.warn('using deprecated parameters for the initialization function; pass a single object instead')
425
- }
426
- }
427
-
428
- if (typeof module_or_path === 'undefined') {
429
- module_or_path = new URL('wasm_mesher_bg.wasm', import.meta.url);
430
- }
431
- const imports = __wbg_get_imports();
432
-
433
- if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
434
- module_or_path = fetch(module_or_path);
435
- }
436
-
437
- const { instance, module } = await __wbg_load(await module_or_path, imports);
438
-
439
- return __wbg_finalize_init(instance, module);
440
- }
441
-
442
- export { initSync };
443
- export default __wbg_init;
Binary file
@@ -1,9 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- export const memory: WebAssembly.Memory;
4
- export const generate_geometry: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number) => any;
5
- export const generate_geometry_multi: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number) => any;
6
- export const __wbindgen_malloc: (a: number, b: number) => number;
7
- export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
8
- export const __wbindgen_externrefs: WebAssembly.Table;
9
- export const __wbindgen_start: () => void;
File without changes
File without changes
File without changes
File without changes
File without changes