@francisdb/vpin-wasm 0.29.0 → 0.31.0
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.
- package/README.md +24 -0
- package/package.json +1 -1
- package/vpin.d.ts +107 -4
- package/vpin.js +113 -37
- package/vpin_bg.wasm +0 -0
- package/vpin_bg.wasm.d.ts +3 -1
package/README.md
CHANGED
|
@@ -62,6 +62,30 @@ const vpxBytes = assemble(files, (message) => {
|
|
|
62
62
|
|
|
63
63
|
**Returns:** `Uint8Array` - VPX file bytes
|
|
64
64
|
|
|
65
|
+
### audit(files, callback?)
|
|
66
|
+
|
|
67
|
+
Checks the expanded table files for consistency problems: references to
|
|
68
|
+
images, materials, surfaces or collection items that do not exist, duplicate
|
|
69
|
+
or over-long names, and storage suggestions. The checks themselves run in a
|
|
70
|
+
few milliseconds even on very large tables, so it is fine to call this after
|
|
71
|
+
every change; the cost is dominated by reading the files into a table.
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const findings = audit(files);
|
|
75
|
+
for (const finding of findings) {
|
|
76
|
+
console.log(`${finding.severity}: ${finding.message}`);
|
|
77
|
+
}
|
|
78
|
+
// warning: Light "L18": placed on missing surface "!l68"
|
|
79
|
+
// suggestion: image "chrome" is stored as a bitmap, consider converting to webp
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Parameters:**
|
|
83
|
+
|
|
84
|
+
- `files: VpxFileMap` (`Record<string, Uint8Array>`) - file paths to contents
|
|
85
|
+
- `callback?: (message: string) => void` - Optional progress callback
|
|
86
|
+
|
|
87
|
+
**Returns:** `{severity: "warning" | "suggestion", message: string}[]` - empty when the table is clean
|
|
88
|
+
|
|
65
89
|
### export_glb(files, options?, callback?)
|
|
66
90
|
|
|
67
91
|
Exports a whole table to a GLB (binary glTF 2.0) file. Takes the same
|
package/package.json
CHANGED
package/vpin.d.ts
CHANGED
|
@@ -8,6 +8,20 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export type VpxFileMap = Record<string, Uint8Array>;
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Progress callback: receives a human readable status message while a
|
|
13
|
+
* long running operation works through a table.
|
|
14
|
+
*/
|
|
15
|
+
export type ProgressCallback = (message: string) => void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* One table consistency finding reported by `audit`.
|
|
19
|
+
*/
|
|
20
|
+
export type AuditFinding = {
|
|
21
|
+
severity: "error" | "warning" | "suggestion";
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
11
25
|
|
|
12
26
|
|
|
13
27
|
/**
|
|
@@ -27,6 +41,47 @@ export interface GlbExportOptions {
|
|
|
27
41
|
|
|
28
42
|
|
|
29
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Options for `export_obj`. Pass a plain object literal; every field
|
|
46
|
+
* is optional.
|
|
47
|
+
*/
|
|
48
|
+
export interface ObjExportOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Axis convention of the written OBJ. Default:
|
|
51
|
+
* `AxisConvention.ZDownRightHanded`, vpinball's own OBJ export
|
|
52
|
+
* layout. Use `AxisConvention.YUpRightHanded` for Blender and most
|
|
53
|
+
* other tools with default import settings.
|
|
54
|
+
*/
|
|
55
|
+
axes?: AxisConvention;
|
|
56
|
+
/**
|
|
57
|
+
* Unit of the written positions. Default: `ExportUnits.M`.
|
|
58
|
+
*/
|
|
59
|
+
units?: ExportUnits;
|
|
60
|
+
/**
|
|
61
|
+
* Emit one `newmtl` block per distinct (material, texture) pair
|
|
62
|
+
* instead of one per `usemtl`. Default: `true`.
|
|
63
|
+
*/
|
|
64
|
+
dedupMtlBlocks?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Write the referenced textures to `images/` and reference them
|
|
67
|
+
* from the MTL. Default: `true`.
|
|
68
|
+
*/
|
|
69
|
+
extractTextures?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Include the plunger mesh. Default: `true`.
|
|
72
|
+
*/
|
|
73
|
+
includePlunger?: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Result of `export_obj`: path relative to the export directory to file
|
|
78
|
+
* contents, e.g. `{ "table.obj": Uint8Array, "table.mtl": Uint8Array,
|
|
79
|
+
* "images/playfield.png": Uint8Array }`.
|
|
80
|
+
*/
|
|
81
|
+
export type ObjExportFileMap = Record<string, Uint8Array>;
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
30
85
|
/**
|
|
31
86
|
* Options for `mesh_to_glb`. Pass a plain object literal; every field
|
|
32
87
|
* is optional.
|
|
@@ -108,6 +163,34 @@ export enum AxisConvention {
|
|
|
108
163
|
YUpRightHanded = 2,
|
|
109
164
|
}
|
|
110
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Output unit for table exports (OBJ, glTF/GLB).
|
|
168
|
+
*
|
|
169
|
+
* VPinball internally uses "VP Units" (VPU): 50 VPU = 1.0625 inches
|
|
170
|
+
* (one pinball diameter), so a standard table around 20 inches wide
|
|
171
|
+
* is roughly 950 VPU. Loaded straight into a tool that treats
|
|
172
|
+
* numbers as metres, that becomes a ~950 m table. Pick a metric
|
|
173
|
+
* variant to scale positions on the way out.
|
|
174
|
+
*/
|
|
175
|
+
export enum ExportUnits {
|
|
176
|
+
/**
|
|
177
|
+
* Raw VPinball Units (no scaling).
|
|
178
|
+
*/
|
|
179
|
+
Vpu = 0,
|
|
180
|
+
/**
|
|
181
|
+
* Millimetres.
|
|
182
|
+
*/
|
|
183
|
+
Mm = 1,
|
|
184
|
+
/**
|
|
185
|
+
* Centimetres.
|
|
186
|
+
*/
|
|
187
|
+
Cm = 2,
|
|
188
|
+
/**
|
|
189
|
+
* Metres.
|
|
190
|
+
*/
|
|
191
|
+
M = 3,
|
|
192
|
+
}
|
|
193
|
+
|
|
111
194
|
/**
|
|
112
195
|
* Mesh data for a single primitive: positions, texture coordinates,
|
|
113
196
|
* normals and triangle indices, packed as flat typed arrays for direct
|
|
@@ -152,7 +235,15 @@ export class PrimitiveMesh {
|
|
|
152
235
|
readonly texCoords: Float32Array;
|
|
153
236
|
}
|
|
154
237
|
|
|
155
|
-
export function assemble(files: VpxFileMap, callback?:
|
|
238
|
+
export function assemble(files: VpxFileMap, callback?: ProgressCallback | null): Uint8Array;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Checks the expanded table files for consistency problems: references to
|
|
242
|
+
* images, materials, surfaces or collection items that do not exist,
|
|
243
|
+
* duplicate or over-long names, and storage suggestions. Returns an array
|
|
244
|
+
* of `{severity, message}` objects, empty when the table is clean.
|
|
245
|
+
*/
|
|
246
|
+
export function audit(files: VpxFileMap, callback?: ProgressCallback | null): AuditFinding[];
|
|
156
247
|
|
|
157
248
|
/**
|
|
158
249
|
* Export a whole table to a GLB (binary glTF 2.0) file.
|
|
@@ -173,9 +264,19 @@ export function assemble(files: VpxFileMap, callback?: Function | null): Uint8Ar
|
|
|
173
264
|
* memory down on sound-heavy tables. Passing a map without them works
|
|
174
265
|
* too.
|
|
175
266
|
*/
|
|
176
|
-
export function export_glb(files: VpxFileMap, options?: GlbExportOptions | null, callback?:
|
|
267
|
+
export function export_glb(files: VpxFileMap, options?: GlbExportOptions | null, callback?: ProgressCallback | null): Uint8Array;
|
|
177
268
|
|
|
178
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Export a whole table as a Wavefront OBJ with its MTL and, by
|
|
271
|
+
* default, the referenced textures. Takes the file map produced by
|
|
272
|
+
* `extract` and returns a file map relative to the export directory:
|
|
273
|
+
* `table.obj`, `table.mtl` and `images/*`.
|
|
274
|
+
*
|
|
275
|
+
* Sound entries are ignored like in `export_glb`.
|
|
276
|
+
*/
|
|
277
|
+
export function export_obj(files: VpxFileMap, options?: ObjExportOptions | null, callback?: ProgressCallback | null): ObjExportFileMap;
|
|
278
|
+
|
|
279
|
+
export function extract(data: Uint8Array, callback?: ProgressCallback | null): VpxFileMap;
|
|
179
280
|
|
|
180
281
|
/**
|
|
181
282
|
* Generate the procedural mesh used by vpinball primitives that
|
|
@@ -292,9 +393,12 @@ export interface InitOutput {
|
|
|
292
393
|
readonly memory: WebAssembly.Memory;
|
|
293
394
|
readonly __wbg_primitivemesh_free: (a: number, b: number) => void;
|
|
294
395
|
readonly assemble: (a: any, b: number) => [number, number, number, number];
|
|
396
|
+
readonly audit: (a: any, b: number) => [number, number, number];
|
|
295
397
|
readonly export_glb: (a: any, b: number, c: number) => [number, number, number, number];
|
|
398
|
+
readonly export_obj: (a: any, b: number, c: number) => [number, number, number];
|
|
296
399
|
readonly extract: (a: number, b: number, c: number) => [number, number, number];
|
|
297
400
|
readonly generate_builtin_primitive: (a: number, b: number) => [number, number, number];
|
|
401
|
+
readonly init: () => void;
|
|
298
402
|
readonly mesh_to_glb: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
299
403
|
readonly mesh_to_obj: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
300
404
|
readonly obj_to_mesh: (a: number, b: number, c: number) => [number, number, number];
|
|
@@ -304,7 +408,6 @@ export interface InitOutput {
|
|
|
304
408
|
readonly primitivemesh_normals: (a: number) => any;
|
|
305
409
|
readonly primitivemesh_positions: (a: number) => any;
|
|
306
410
|
readonly primitivemesh_texCoords: (a: number) => any;
|
|
307
|
-
readonly init: () => void;
|
|
308
411
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
309
412
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
310
413
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/vpin.js
CHANGED
|
@@ -46,6 +46,35 @@ export const AxisConvention = Object.freeze({
|
|
|
46
46
|
YUpRightHanded: 2, "2": "YUpRightHanded",
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Output unit for table exports (OBJ, glTF/GLB).
|
|
51
|
+
*
|
|
52
|
+
* VPinball internally uses "VP Units" (VPU): 50 VPU = 1.0625 inches
|
|
53
|
+
* (one pinball diameter), so a standard table around 20 inches wide
|
|
54
|
+
* is roughly 950 VPU. Loaded straight into a tool that treats
|
|
55
|
+
* numbers as metres, that becomes a ~950 m table. Pick a metric
|
|
56
|
+
* variant to scale positions on the way out.
|
|
57
|
+
* @enum {0 | 1 | 2 | 3}
|
|
58
|
+
*/
|
|
59
|
+
export const ExportUnits = Object.freeze({
|
|
60
|
+
/**
|
|
61
|
+
* Raw VPinball Units (no scaling).
|
|
62
|
+
*/
|
|
63
|
+
Vpu: 0, "0": "Vpu",
|
|
64
|
+
/**
|
|
65
|
+
* Millimetres.
|
|
66
|
+
*/
|
|
67
|
+
Mm: 1, "1": "Mm",
|
|
68
|
+
/**
|
|
69
|
+
* Centimetres.
|
|
70
|
+
*/
|
|
71
|
+
Cm: 2, "2": "Cm",
|
|
72
|
+
/**
|
|
73
|
+
* Metres.
|
|
74
|
+
*/
|
|
75
|
+
M: 3, "3": "M",
|
|
76
|
+
});
|
|
77
|
+
|
|
49
78
|
/**
|
|
50
79
|
* Mesh data for a single primitive: positions, texture coordinates,
|
|
51
80
|
* normals and triangle indices, packed as flat typed arrays for direct
|
|
@@ -148,7 +177,7 @@ if (Symbol.dispose) PrimitiveMesh.prototype[Symbol.dispose] = PrimitiveMesh.prot
|
|
|
148
177
|
|
|
149
178
|
/**
|
|
150
179
|
* @param {VpxFileMap} files
|
|
151
|
-
* @param {
|
|
180
|
+
* @param {ProgressCallback | null} [callback]
|
|
152
181
|
* @returns {Uint8Array}
|
|
153
182
|
*/
|
|
154
183
|
export function assemble(files, callback) {
|
|
@@ -161,6 +190,23 @@ export function assemble(files, callback) {
|
|
|
161
190
|
return v1;
|
|
162
191
|
}
|
|
163
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Checks the expanded table files for consistency problems: references to
|
|
195
|
+
* images, materials, surfaces or collection items that do not exist,
|
|
196
|
+
* duplicate or over-long names, and storage suggestions. Returns an array
|
|
197
|
+
* of `{severity, message}` objects, empty when the table is clean.
|
|
198
|
+
* @param {VpxFileMap} files
|
|
199
|
+
* @param {ProgressCallback | null} [callback]
|
|
200
|
+
* @returns {AuditFinding[]}
|
|
201
|
+
*/
|
|
202
|
+
export function audit(files, callback) {
|
|
203
|
+
const ret = wasm.audit(files, isLikeNone(callback) ? 0 : addToExternrefTable0(callback));
|
|
204
|
+
if (ret[2]) {
|
|
205
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
206
|
+
}
|
|
207
|
+
return takeFromExternrefTable0(ret[0]);
|
|
208
|
+
}
|
|
209
|
+
|
|
164
210
|
/**
|
|
165
211
|
* Export a whole table to a GLB (binary glTF 2.0) file.
|
|
166
212
|
*
|
|
@@ -181,7 +227,7 @@ export function assemble(files, callback) {
|
|
|
181
227
|
* too.
|
|
182
228
|
* @param {VpxFileMap} files
|
|
183
229
|
* @param {GlbExportOptions | null} [options]
|
|
184
|
-
* @param {
|
|
230
|
+
* @param {ProgressCallback | null} [callback]
|
|
185
231
|
* @returns {Uint8Array}
|
|
186
232
|
*/
|
|
187
233
|
export function export_glb(files, options, callback) {
|
|
@@ -194,9 +240,29 @@ export function export_glb(files, options, callback) {
|
|
|
194
240
|
return v1;
|
|
195
241
|
}
|
|
196
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Export a whole table as a Wavefront OBJ with its MTL and, by
|
|
245
|
+
* default, the referenced textures. Takes the file map produced by
|
|
246
|
+
* `extract` and returns a file map relative to the export directory:
|
|
247
|
+
* `table.obj`, `table.mtl` and `images/*`.
|
|
248
|
+
*
|
|
249
|
+
* Sound entries are ignored like in `export_glb`.
|
|
250
|
+
* @param {VpxFileMap} files
|
|
251
|
+
* @param {ObjExportOptions | null} [options]
|
|
252
|
+
* @param {ProgressCallback | null} [callback]
|
|
253
|
+
* @returns {ObjExportFileMap}
|
|
254
|
+
*/
|
|
255
|
+
export function export_obj(files, options, callback) {
|
|
256
|
+
const ret = wasm.export_obj(files, isLikeNone(options) ? 0 : addToExternrefTable0(options), isLikeNone(callback) ? 0 : addToExternrefTable0(callback));
|
|
257
|
+
if (ret[2]) {
|
|
258
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
259
|
+
}
|
|
260
|
+
return takeFromExternrefTable0(ret[0]);
|
|
261
|
+
}
|
|
262
|
+
|
|
197
263
|
/**
|
|
198
264
|
* @param {Uint8Array} data
|
|
199
|
-
* @param {
|
|
265
|
+
* @param {ProgressCallback | null} [callback]
|
|
200
266
|
* @returns {VpxFileMap}
|
|
201
267
|
*/
|
|
202
268
|
export function extract(data, callback) {
|
|
@@ -392,11 +458,11 @@ export function obj_to_mesh(data, options) {
|
|
|
392
458
|
function __wbg_get_imports() {
|
|
393
459
|
const import0 = {
|
|
394
460
|
__proto__: null,
|
|
395
|
-
|
|
461
|
+
__wbg_Error_67e7344beaa85059: function(arg0, arg1) {
|
|
396
462
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
397
463
|
return ret;
|
|
398
464
|
},
|
|
399
|
-
|
|
465
|
+
__wbg_Number_c54e7112a3fa7e3e: function(arg0) {
|
|
400
466
|
const ret = Number(arg0);
|
|
401
467
|
return ret;
|
|
402
468
|
},
|
|
@@ -407,46 +473,46 @@ function __wbg_get_imports() {
|
|
|
407
473
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
408
474
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
409
475
|
},
|
|
410
|
-
|
|
476
|
+
__wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
|
|
411
477
|
const v = arg0;
|
|
412
478
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
413
479
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
414
480
|
},
|
|
415
|
-
|
|
481
|
+
__wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
|
|
416
482
|
const ret = debugString(arg1);
|
|
417
483
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
418
484
|
const len1 = WASM_VECTOR_LEN;
|
|
419
485
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
420
486
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
421
487
|
},
|
|
422
|
-
|
|
488
|
+
__wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
|
|
423
489
|
const ret = arg0 in arg1;
|
|
424
490
|
return ret;
|
|
425
491
|
},
|
|
426
|
-
|
|
492
|
+
__wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
|
|
427
493
|
const ret = arg0 === null;
|
|
428
494
|
return ret;
|
|
429
495
|
},
|
|
430
|
-
|
|
496
|
+
__wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
|
|
431
497
|
const val = arg0;
|
|
432
498
|
const ret = typeof(val) === 'object' && val !== null;
|
|
433
499
|
return ret;
|
|
434
500
|
},
|
|
435
|
-
|
|
501
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
436
502
|
const ret = arg0 === undefined;
|
|
437
503
|
return ret;
|
|
438
504
|
},
|
|
439
|
-
|
|
505
|
+
__wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
|
|
440
506
|
const ret = arg0 == arg1;
|
|
441
507
|
return ret;
|
|
442
508
|
},
|
|
443
|
-
|
|
509
|
+
__wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
|
|
444
510
|
const obj = arg1;
|
|
445
511
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
446
512
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
447
513
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
448
514
|
},
|
|
449
|
-
|
|
515
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
450
516
|
const obj = arg1;
|
|
451
517
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
452
518
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -454,10 +520,10 @@ function __wbg_get_imports() {
|
|
|
454
520
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
455
521
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
456
522
|
},
|
|
457
|
-
|
|
523
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
458
524
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
459
525
|
},
|
|
460
|
-
|
|
526
|
+
__wbg_call_6bcf8d3e20937e46: function() { return handleError(function (arg0, arg1, arg2) {
|
|
461
527
|
const ret = arg0.call(arg1, arg2);
|
|
462
528
|
return ret;
|
|
463
529
|
}, arguments); },
|
|
@@ -472,11 +538,11 @@ function __wbg_get_imports() {
|
|
|
472
538
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
473
539
|
}
|
|
474
540
|
},
|
|
475
|
-
|
|
541
|
+
__wbg_get_989d0a1309644f2b: function() { return handleError(function (arg0, arg1) {
|
|
476
542
|
const ret = Reflect.get(arg0, arg1);
|
|
477
543
|
return ret;
|
|
478
544
|
}, arguments); },
|
|
479
|
-
|
|
545
|
+
__wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
|
|
480
546
|
const ret = arg0[arg1 >>> 0];
|
|
481
547
|
return ret;
|
|
482
548
|
},
|
|
@@ -484,7 +550,7 @@ function __wbg_get_imports() {
|
|
|
484
550
|
const ret = arg0[arg1];
|
|
485
551
|
return ret;
|
|
486
552
|
},
|
|
487
|
-
|
|
553
|
+
__wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
|
|
488
554
|
let result;
|
|
489
555
|
try {
|
|
490
556
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -494,7 +560,7 @@ function __wbg_get_imports() {
|
|
|
494
560
|
const ret = result;
|
|
495
561
|
return ret;
|
|
496
562
|
},
|
|
497
|
-
|
|
563
|
+
__wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
|
|
498
564
|
let result;
|
|
499
565
|
try {
|
|
500
566
|
result = arg0 instanceof Uint8Array;
|
|
@@ -504,54 +570,64 @@ function __wbg_get_imports() {
|
|
|
504
570
|
const ret = result;
|
|
505
571
|
return ret;
|
|
506
572
|
},
|
|
507
|
-
|
|
573
|
+
__wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
|
|
508
574
|
const ret = Number.isSafeInteger(arg0);
|
|
509
575
|
return ret;
|
|
510
576
|
},
|
|
511
|
-
|
|
577
|
+
__wbg_keys_6efc298980178da1: function(arg0) {
|
|
512
578
|
const ret = Object.keys(arg0);
|
|
513
579
|
return ret;
|
|
514
580
|
},
|
|
515
|
-
|
|
581
|
+
__wbg_length_31bdaf014f5fbde2: function(arg0) {
|
|
516
582
|
const ret = arg0.length;
|
|
517
583
|
return ret;
|
|
518
584
|
},
|
|
519
|
-
|
|
585
|
+
__wbg_length_4e1adc0d42e23620: function(arg0) {
|
|
520
586
|
const ret = arg0.length;
|
|
521
587
|
return ret;
|
|
522
588
|
},
|
|
523
|
-
|
|
524
|
-
const ret = new
|
|
589
|
+
__wbg_new_1da3429bc3c4541c: function(arg0) {
|
|
590
|
+
const ret = new Uint8Array(arg0);
|
|
525
591
|
return ret;
|
|
526
592
|
},
|
|
527
|
-
|
|
528
|
-
const ret = new
|
|
593
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
594
|
+
const ret = new Error();
|
|
529
595
|
return ret;
|
|
530
596
|
},
|
|
531
|
-
|
|
597
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
532
598
|
const ret = new Object();
|
|
533
599
|
return ret;
|
|
534
600
|
},
|
|
535
|
-
|
|
536
|
-
const ret = new
|
|
601
|
+
__wbg_new_ffa92086ea89f79c: function() {
|
|
602
|
+
const ret = new Array();
|
|
537
603
|
return ret;
|
|
538
604
|
},
|
|
539
|
-
|
|
605
|
+
__wbg_new_from_slice_2221cabb71753908: function(arg0, arg1) {
|
|
540
606
|
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
541
607
|
return ret;
|
|
542
608
|
},
|
|
543
|
-
|
|
609
|
+
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
610
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
611
|
+
return ret;
|
|
612
|
+
},
|
|
613
|
+
__wbg_new_from_slice_a500ec81601be48f: function(arg0, arg1) {
|
|
544
614
|
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
545
615
|
return ret;
|
|
546
616
|
},
|
|
547
|
-
|
|
617
|
+
__wbg_now_d1fb6650485d7f3e: function() {
|
|
548
618
|
const ret = Date.now();
|
|
549
619
|
return ret;
|
|
550
620
|
},
|
|
551
|
-
|
|
621
|
+
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
552
622
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
553
623
|
},
|
|
554
|
-
|
|
624
|
+
__wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
|
|
625
|
+
arg0[arg1 >>> 0] = arg2;
|
|
626
|
+
},
|
|
627
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
628
|
+
arg0[arg1] = arg2;
|
|
629
|
+
},
|
|
630
|
+
__wbg_set_a377297433dfea63: function() { return handleError(function (arg0, arg1, arg2) {
|
|
555
631
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
556
632
|
return ret;
|
|
557
633
|
}, arguments); },
|
|
@@ -562,7 +638,7 @@ function __wbg_get_imports() {
|
|
|
562
638
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
563
639
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
564
640
|
},
|
|
565
|
-
|
|
641
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
566
642
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
567
643
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
568
644
|
return ret;
|
package/vpin_bg.wasm
CHANGED
|
Binary file
|
package/vpin_bg.wasm.d.ts
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_primitivemesh_free: (a: number, b: number) => void;
|
|
5
5
|
export const assemble: (a: any, b: number) => [number, number, number, number];
|
|
6
|
+
export const audit: (a: any, b: number) => [number, number, number];
|
|
6
7
|
export const export_glb: (a: any, b: number, c: number) => [number, number, number, number];
|
|
8
|
+
export const export_obj: (a: any, b: number, c: number) => [number, number, number];
|
|
7
9
|
export const extract: (a: number, b: number, c: number) => [number, number, number];
|
|
8
10
|
export const generate_builtin_primitive: (a: number, b: number) => [number, number, number];
|
|
11
|
+
export const init: () => void;
|
|
9
12
|
export const mesh_to_glb: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
10
13
|
export const mesh_to_obj: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
|
|
11
14
|
export const obj_to_mesh: (a: number, b: number, c: number) => [number, number, number];
|
|
@@ -15,7 +18,6 @@ export const primitivemesh_name: (a: number) => [number, number];
|
|
|
15
18
|
export const primitivemesh_normals: (a: number) => any;
|
|
16
19
|
export const primitivemesh_positions: (a: number) => any;
|
|
17
20
|
export const primitivemesh_texCoords: (a: number) => any;
|
|
18
|
-
export const init: () => void;
|
|
19
21
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
20
22
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
21
23
|
export const __wbindgen_exn_store: (a: number) => void;
|