math-rust-lib 0.1.3 → 0.2.1

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/math_rust_lib.js CHANGED
@@ -1,719 +1,5 @@
1
-
2
- let imports = {};
3
- imports['__wbindgen_placeholder__'] = module.exports;
4
-
5
- function _assertClass(instance, klass) {
6
- if (!(instance instanceof klass)) {
7
- throw new Error(`expected instance of ${klass.name}`);
8
- }
9
- }
10
-
11
- function getArrayF32FromWasm0(ptr, len) {
12
- ptr = ptr >>> 0;
13
- return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
14
- }
15
-
16
- let cachedFloat32ArrayMemory0 = null;
17
- function getFloat32ArrayMemory0() {
18
- if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
19
- cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
20
- }
21
- return cachedFloat32ArrayMemory0;
22
- }
23
-
24
- function getStringFromWasm0(ptr, len) {
25
- ptr = ptr >>> 0;
26
- return decodeText(ptr, len);
27
- }
28
-
29
- let cachedUint8ArrayMemory0 = null;
30
- function getUint8ArrayMemory0() {
31
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
32
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
33
- }
34
- return cachedUint8ArrayMemory0;
35
- }
36
-
37
- function passArrayF32ToWasm0(arg, malloc) {
38
- const ptr = malloc(arg.length * 4, 4) >>> 0;
39
- getFloat32ArrayMemory0().set(arg, ptr / 4);
40
- WASM_VECTOR_LEN = arg.length;
41
- return ptr;
42
- }
43
-
44
- function takeFromExternrefTable0(idx) {
45
- const value = wasm.__wbindgen_externrefs.get(idx);
46
- wasm.__externref_table_dealloc(idx);
47
- return value;
48
- }
49
-
50
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
51
- cachedTextDecoder.decode();
52
- function decodeText(ptr, len) {
53
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
54
- }
55
-
56
- let WASM_VECTOR_LEN = 0;
57
-
58
- const Mat4Finalization = (typeof FinalizationRegistry === 'undefined')
59
- ? { register: () => {}, unregister: () => {} }
60
- : new FinalizationRegistry(ptr => wasm.__wbg_mat4_free(ptr >>> 0, 1));
61
-
62
- const QuatFinalization = (typeof FinalizationRegistry === 'undefined')
63
- ? { register: () => {}, unregister: () => {} }
64
- : new FinalizationRegistry(ptr => wasm.__wbg_quat_free(ptr >>> 0, 1));
65
-
66
- const Vec3Finalization = (typeof FinalizationRegistry === 'undefined')
67
- ? { register: () => {}, unregister: () => {} }
68
- : new FinalizationRegistry(ptr => wasm.__wbg_vec3_free(ptr >>> 0, 1));
69
-
70
- class Mat4 {
71
- static __wrap(ptr) {
72
- ptr = ptr >>> 0;
73
- const obj = Object.create(Mat4.prototype);
74
- obj.__wbg_ptr = ptr;
75
- Mat4Finalization.register(obj, obj.__wbg_ptr, obj);
76
- return obj;
77
- }
78
- __destroy_into_raw() {
79
- const ptr = this.__wbg_ptr;
80
- this.__wbg_ptr = 0;
81
- Mat4Finalization.unregister(this);
82
- return ptr;
83
- }
84
- free() {
85
- const ptr = this.__destroy_into_raw();
86
- wasm.__wbg_mat4_free(ptr, 0);
87
- }
88
- /**
89
- * @param {Float32Array} val
90
- * @returns {Mat4}
91
- */
92
- static from_values(val) {
93
- const ptr0 = passArrayF32ToWasm0(val, wasm.__wbindgen_malloc);
94
- const len0 = WASM_VECTOR_LEN;
95
- const ret = wasm.mat4_from_values(ptr0, len0);
96
- if (ret[2]) {
97
- throw takeFromExternrefTable0(ret[1]);
98
- }
99
- return Mat4.__wrap(ret[0]);
100
- }
101
- /**
102
- * @param {number} fov
103
- * @param {number} aspect
104
- * @param {number} near
105
- * @param {number} far
106
- * @returns {Mat4}
107
- */
108
- static perspective(fov, aspect, near, far) {
109
- const ret = wasm.mat4_perspective(fov, aspect, near, far);
110
- return Mat4.__wrap(ret);
111
- }
112
- /**
113
- * @returns {Mat4}
114
- */
115
- set_identity() {
116
- const ptr = this.__destroy_into_raw();
117
- const ret = wasm.mat4_set_identity(ptr);
118
- return Mat4.__wrap(ret);
119
- }
120
- /**
121
- * @param {number} sx
122
- * @param {number} sy
123
- * @param {number} sz
124
- * @returns {Mat4}
125
- */
126
- scale_in_place(sx, sy, sz) {
127
- const ret = wasm.mat4_scale_in_place(this.__wbg_ptr, sx, sy, sz);
128
- return Mat4.__wrap(ret);
129
- }
130
- /**
131
- * @param {Float32Array} m
132
- * @param {number} offset
133
- * @returns {Quat}
134
- */
135
- static to_quat_from_array(m, offset) {
136
- const ptr0 = passArrayF32ToWasm0(m, wasm.__wbindgen_malloc);
137
- const len0 = WASM_VECTOR_LEN;
138
- const ret = wasm.mat4_to_quat_from_array(ptr0, len0, offset);
139
- return Quat.__wrap(ret);
140
- }
141
- /**
142
- * @param {number} tx
143
- * @param {number} ty
144
- * @param {number} tz
145
- * @returns {Mat4}
146
- */
147
- translate_in_place(tx, ty, tz) {
148
- const ptr = this.__destroy_into_raw();
149
- const ret = wasm.mat4_translate_in_place(ptr, tx, ty, tz);
150
- return Mat4.__wrap(ret);
151
- }
152
- /**
153
- * @param {Vec3} position
154
- * @param {Quat} rotation
155
- * @returns {Mat4}
156
- */
157
- static from_position_rotation(position, rotation) {
158
- _assertClass(position, Vec3);
159
- _assertClass(rotation, Quat);
160
- const ret = wasm.mat4_from_position_rotation(position.__wbg_ptr, rotation.__wbg_ptr);
161
- return Mat4.__wrap(ret);
162
- }
163
- /**
164
- * @param {Vec3} scale
165
- * @returns {Mat4}
166
- */
167
- scale_in_place_by_vec3(scale) {
168
- _assertClass(scale, Vec3);
169
- var ptr0 = scale.__destroy_into_raw();
170
- const ret = wasm.mat4_scale_in_place_by_vec3(this.__wbg_ptr, ptr0);
171
- return Mat4.__wrap(ret);
172
- }
173
- /**
174
- * @param {Vec3} position
175
- * @param {Quat} rotation
176
- * @param {Mat4} result
177
- */
178
- static from_position_rotation_to_ref(position, rotation, result) {
179
- _assertClass(position, Vec3);
180
- _assertClass(rotation, Quat);
181
- _assertClass(result, Mat4);
182
- wasm.mat4_from_position_rotation_to_ref(position.__wbg_ptr, rotation.__wbg_ptr, result.__wbg_ptr);
183
- }
184
- /**
185
- * @param {Float32Array} val
186
- */
187
- constructor(val) {
188
- const ptr0 = passArrayF32ToWasm0(val, wasm.__wbindgen_malloc);
189
- const len0 = WASM_VECTOR_LEN;
190
- const ret = wasm.mat4_new(ptr0, len0);
191
- this.__wbg_ptr = ret >>> 0;
192
- Mat4Finalization.register(this, this.__wbg_ptr, this);
193
- return this;
194
- }
195
- /**
196
- * @param {Float32Array} val
197
- */
198
- set(val) {
199
- const ptr = this.__destroy_into_raw();
200
- const ptr0 = passArrayF32ToWasm0(val, wasm.__wbindgen_malloc);
201
- const len0 = WASM_VECTOR_LEN;
202
- wasm.mat4_set(ptr, ptr0, len0);
203
- }
204
- /**
205
- * @returns {Float32Array}
206
- */
207
- get values() {
208
- const ret = wasm.mat4_values(this.__wbg_ptr);
209
- return ret;
210
- }
211
- /**
212
- * @param {Vec3} eye
213
- * @param {Vec3} target
214
- * @param {Vec3} up
215
- * @returns {Mat4}
216
- */
217
- static look_at(eye, target, up) {
218
- _assertClass(eye, Vec3);
219
- var ptr0 = eye.__destroy_into_raw();
220
- _assertClass(target, Vec3);
221
- var ptr1 = target.__destroy_into_raw();
222
- _assertClass(up, Vec3);
223
- var ptr2 = up.__destroy_into_raw();
224
- const ret = wasm.mat4_look_at(ptr0, ptr1, ptr2);
225
- return Mat4.__wrap(ret);
226
- }
227
- /**
228
- * @returns {Quat}
229
- */
230
- to_quat() {
231
- const ptr = this.__destroy_into_raw();
232
- const ret = wasm.mat4_to_quat(ptr);
233
- return Quat.__wrap(ret);
234
- }
235
- /**
236
- * @returns {Mat4}
237
- */
238
- static identity() {
239
- const ret = wasm.mat4_identity();
240
- return Mat4.__wrap(ret);
241
- }
242
- /**
243
- * @param {Mat4} other
244
- * @returns {Mat4}
245
- */
246
- multiply(other) {
247
- _assertClass(other, Mat4);
248
- var ptr0 = other.__destroy_into_raw();
249
- const ret = wasm.mat4_multiply(this.__wbg_ptr, ptr0);
250
- return Mat4.__wrap(ret);
251
- }
252
- /**
253
- * @param {number} x
254
- * @param {number} y
255
- * @param {number} z
256
- * @param {number} w
257
- * @returns {Mat4}
258
- */
259
- static from_quat(x, y, z, w) {
260
- const ret = wasm.mat4_from_quat(x, y, z, w);
261
- return Mat4.__wrap(ret);
262
- }
263
- }
264
- if (Symbol.dispose) Mat4.prototype[Symbol.dispose] = Mat4.prototype.free;
265
- exports.Mat4 = Mat4;
266
-
267
- class Quat {
268
- static __wrap(ptr) {
269
- ptr = ptr >>> 0;
270
- const obj = Object.create(Quat.prototype);
271
- obj.__wbg_ptr = ptr;
272
- QuatFinalization.register(obj, obj.__wbg_ptr, obj);
273
- return obj;
274
- }
275
- __destroy_into_raw() {
276
- const ptr = this.__wbg_ptr;
277
- this.__wbg_ptr = 0;
278
- QuatFinalization.unregister(this);
279
- return ptr;
280
- }
281
- free() {
282
- const ptr = this.__destroy_into_raw();
283
- wasm.__wbg_quat_free(ptr, 0);
284
- }
285
- /**
286
- * @returns {number}
287
- */
288
- get x() {
289
- const ret = wasm.__wbg_get_quat_x(this.__wbg_ptr);
290
- return ret;
291
- }
292
- /**
293
- * @param {number} arg0
294
- */
295
- set x(arg0) {
296
- wasm.__wbg_set_quat_x(this.__wbg_ptr, arg0);
297
- }
298
- /**
299
- * @returns {number}
300
- */
301
- get y() {
302
- const ret = wasm.__wbg_get_quat_y(this.__wbg_ptr);
303
- return ret;
304
- }
305
- /**
306
- * @param {number} arg0
307
- */
308
- set y(arg0) {
309
- wasm.__wbg_set_quat_y(this.__wbg_ptr, arg0);
310
- }
311
- /**
312
- * @returns {number}
313
- */
314
- get z() {
315
- const ret = wasm.__wbg_get_quat_z(this.__wbg_ptr);
316
- return ret;
317
- }
318
- /**
319
- * @param {number} arg0
320
- */
321
- set z(arg0) {
322
- wasm.__wbg_set_quat_z(this.__wbg_ptr, arg0);
323
- }
324
- /**
325
- * @returns {number}
326
- */
327
- get w() {
328
- const ret = wasm.__wbg_get_quat_w(this.__wbg_ptr);
329
- return ret;
330
- }
331
- /**
332
- * @param {number} arg0
333
- */
334
- set w(arg0) {
335
- wasm.__wbg_set_quat_w(this.__wbg_ptr, arg0);
336
- }
337
- /**
338
- * @param {number} rot_x
339
- * @param {number} rot_y
340
- * @param {number} rot_z
341
- * @returns {Quat}
342
- */
343
- static from_euler(rot_x, rot_y, rot_z) {
344
- const ret = wasm.quat_from_euler(rot_x, rot_y, rot_z);
345
- return Quat.__wrap(ret);
346
- }
347
- /**
348
- * @param {Vec3} v
349
- * @returns {Vec3}
350
- */
351
- rotate_vec(v) {
352
- _assertClass(v, Vec3);
353
- var ptr0 = v.__destroy_into_raw();
354
- const ret = wasm.quat_rotate_vec(this.__wbg_ptr, ptr0);
355
- return Vec3.__wrap(ret);
356
- }
357
- /**
358
- * @returns {Vec3}
359
- */
360
- to_euler_angles() {
361
- const ret = wasm.quat_to_euler_angles(this.__wbg_ptr);
362
- return Vec3.__wrap(ret);
363
- }
364
- /**
365
- * @param {Vec3} vec_from
366
- * @param {Vec3} vec_to
367
- * @param {number} epsilon
368
- * @returns {Quat}
369
- */
370
- static from_unit_vectors(vec_from, vec_to, epsilon) {
371
- _assertClass(vec_from, Vec3);
372
- _assertClass(vec_to, Vec3);
373
- const ret = wasm.quat_from_unit_vectors(vec_from.__wbg_ptr, vec_to.__wbg_ptr, epsilon);
374
- return Quat.__wrap(ret);
375
- }
376
- /**
377
- * @param {number} yaw
378
- * @param {number} pitch
379
- * @param {number} roll
380
- * @returns {Quat}
381
- */
382
- static rotation_yaw_pitch_roll(yaw, pitch, roll) {
383
- const ret = wasm.quat_rotation_yaw_pitch_roll(yaw, pitch, roll);
384
- return Quat.__wrap(ret);
385
- }
386
- /**
387
- * @param {Vec3} vec_from
388
- * @param {Vec3} vec_to
389
- * @param {Quat} result
390
- * @param {number} epsilon
391
- * @returns {Quat}
392
- */
393
- static from_unit_vectors_to_ref(vec_from, vec_to, result, epsilon) {
394
- _assertClass(vec_from, Vec3);
395
- _assertClass(vec_to, Vec3);
396
- _assertClass(result, Quat);
397
- const ret = wasm.quat_from_unit_vectors_to_ref(vec_from.__wbg_ptr, vec_to.__wbg_ptr, result.__wbg_ptr, epsilon);
398
- return Quat.__wrap(ret);
399
- }
400
- /**
401
- * @param {number} x
402
- * @param {number} y
403
- * @param {number} z
404
- * @param {number} w
405
- */
406
- constructor(x, y, z, w) {
407
- const ret = wasm.quat_new(x, y, z, w);
408
- this.__wbg_ptr = ret >>> 0;
409
- QuatFinalization.register(this, this.__wbg_ptr, this);
410
- return this;
411
- }
412
- /**
413
- * @param {number} x
414
- * @param {number} y
415
- * @param {number} z
416
- * @param {number} w
417
- * @returns {Quat}
418
- */
419
- set(x, y, z, w) {
420
- const ptr = this.__destroy_into_raw();
421
- const ret = wasm.quat_set(ptr, x, y, z, w);
422
- return Quat.__wrap(ret);
423
- }
424
- /**
425
- * @returns {Quat}
426
- */
427
- clone() {
428
- const ret = wasm.quat_clone(this.__wbg_ptr);
429
- return Quat.__wrap(ret);
430
- }
431
- /**
432
- * @param {Quat} a
433
- * @param {Quat} b
434
- * @param {number} t
435
- * @returns {Quat}
436
- */
437
- static slerp(a, b, t) {
438
- _assertClass(a, Quat);
439
- _assertClass(b, Quat);
440
- const ret = wasm.quat_slerp(a.__wbg_ptr, b.__wbg_ptr, t);
441
- return Quat.__wrap(ret);
442
- }
443
- /**
444
- * @returns {Quat}
445
- */
446
- static identity() {
447
- const ret = wasm.quat_identity();
448
- return Quat.__wrap(ret);
449
- }
450
- /**
451
- * @param {Quat} other
452
- * @returns {Quat}
453
- */
454
- multiply(other) {
455
- _assertClass(other, Quat);
456
- var ptr0 = other.__destroy_into_raw();
457
- const ret = wasm.quat_multiply(this.__wbg_ptr, ptr0);
458
- return Quat.__wrap(ret);
459
- }
460
- /**
461
- * @returns {Float32Array}
462
- */
463
- to_array() {
464
- const ret = wasm.quat_to_array(this.__wbg_ptr);
465
- var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
466
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
467
- return v1;
468
- }
469
- /**
470
- * @returns {Quat}
471
- */
472
- normalize() {
473
- const ptr = this.__destroy_into_raw();
474
- const ret = wasm.quat_normalize(ptr);
475
- return Quat.__wrap(ret);
476
- }
477
- }
478
- if (Symbol.dispose) Quat.prototype[Symbol.dispose] = Quat.prototype.free;
479
- exports.Quat = Quat;
480
-
481
- class Vec3 {
482
- static __wrap(ptr) {
483
- ptr = ptr >>> 0;
484
- const obj = Object.create(Vec3.prototype);
485
- obj.__wbg_ptr = ptr;
486
- Vec3Finalization.register(obj, obj.__wbg_ptr, obj);
487
- return obj;
488
- }
489
- __destroy_into_raw() {
490
- const ptr = this.__wbg_ptr;
491
- this.__wbg_ptr = 0;
492
- Vec3Finalization.unregister(this);
493
- return ptr;
494
- }
495
- free() {
496
- const ptr = this.__destroy_into_raw();
497
- wasm.__wbg_vec3_free(ptr, 0);
498
- }
499
- /**
500
- * @returns {number}
501
- */
502
- get x() {
503
- const ret = wasm.__wbg_get_vec3_x(this.__wbg_ptr);
504
- return ret;
505
- }
506
- /**
507
- * @param {number} arg0
508
- */
509
- set x(arg0) {
510
- wasm.__wbg_set_vec3_x(this.__wbg_ptr, arg0);
511
- }
512
- /**
513
- * @returns {number}
514
- */
515
- get y() {
516
- const ret = wasm.__wbg_get_vec3_y(this.__wbg_ptr);
517
- return ret;
518
- }
519
- /**
520
- * @param {number} arg0
521
- */
522
- set y(arg0) {
523
- wasm.__wbg_set_vec3_y(this.__wbg_ptr, arg0);
524
- }
525
- /**
526
- * @returns {number}
527
- */
528
- get z() {
529
- const ret = wasm.__wbg_get_vec3_z(this.__wbg_ptr);
530
- return ret;
531
- }
532
- /**
533
- * @param {number} arg0
534
- */
535
- set z(arg0) {
536
- wasm.__wbg_set_vec3_z(this.__wbg_ptr, arg0);
537
- }
538
- /**
539
- * @returns {number}
540
- */
541
- length_squared() {
542
- const ret = wasm.vec3_length_squared(this.__wbg_ptr);
543
- return ret;
544
- }
545
- /**
546
- * @param {Vec3} other
547
- * @returns {Vec3}
548
- */
549
- add(other) {
550
- _assertClass(other, Vec3);
551
- var ptr0 = other.__destroy_into_raw();
552
- const ret = wasm.vec3_add(this.__wbg_ptr, ptr0);
553
- return Vec3.__wrap(ret);
554
- }
555
- /**
556
- * @param {Vec3} other
557
- * @returns {number}
558
- */
559
- dot(other) {
560
- _assertClass(other, Vec3);
561
- var ptr0 = other.__destroy_into_raw();
562
- const ret = wasm.vec3_dot(this.__wbg_ptr, ptr0);
563
- return ret;
564
- }
565
- /**
566
- * @param {number} x
567
- * @param {number} y
568
- * @param {number} z
569
- */
570
- constructor(x, y, z) {
571
- const ret = wasm.vec3_new(x, y, z);
572
- this.__wbg_ptr = ret >>> 0;
573
- Vec3Finalization.register(this, this.__wbg_ptr, this);
574
- return this;
575
- }
576
- /**
577
- * @param {number} x
578
- * @param {number} y
579
- * @param {number} z
580
- * @returns {Vec3}
581
- */
582
- set(x, y, z) {
583
- const ret = wasm.vec3_set(this.__wbg_ptr, x, y, z);
584
- return Vec3.__wrap(ret);
585
- }
586
- /**
587
- * @returns {Vec3}
588
- */
589
- clone() {
590
- const ret = wasm.vec3_clone(this.__wbg_ptr);
591
- return Vec3.__wrap(ret);
592
- }
593
- /**
594
- * @param {Vec3} other
595
- * @returns {Vec3}
596
- */
597
- cross(other) {
598
- _assertClass(other, Vec3);
599
- var ptr0 = other.__destroy_into_raw();
600
- const ret = wasm.vec3_cross(this.__wbg_ptr, ptr0);
601
- return Vec3.__wrap(ret);
602
- }
603
- /**
604
- * @param {number} scalar
605
- * @returns {Vec3}
606
- */
607
- scale(scalar) {
608
- const ret = wasm.vec3_scale(this.__wbg_ptr, scalar);
609
- return Vec3.__wrap(ret);
610
- }
611
- /**
612
- * @returns {number}
613
- */
614
- length() {
615
- const ret = wasm.vec3_length(this.__wbg_ptr);
616
- return ret;
617
- }
618
- /**
619
- * @param {Vec3} other
620
- * @returns {Vec3}
621
- */
622
- subtract(other) {
623
- _assertClass(other, Vec3);
624
- var ptr0 = other.__destroy_into_raw();
625
- const ret = wasm.vec3_subtract(this.__wbg_ptr, ptr0);
626
- return Vec3.__wrap(ret);
627
- }
628
- /**
629
- * @returns {Float32Array}
630
- */
631
- to_array() {
632
- const ret = wasm.vec3_to_array(this.__wbg_ptr);
633
- var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
634
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
635
- return v1;
636
- }
637
- /**
638
- * @returns {Vec3}
639
- */
640
- normalize() {
641
- const ret = wasm.vec3_normalize(this.__wbg_ptr);
642
- return Vec3.__wrap(ret);
643
- }
644
- }
645
- if (Symbol.dispose) Vec3.prototype[Symbol.dispose] = Vec3.prototype.free;
646
- exports.Vec3 = Vec3;
647
-
648
- /**
649
- * @param {Vec3} a
650
- * @param {Vec3} b
651
- * @returns {Vec3}
652
- */
653
- function cross(a, b) {
654
- _assertClass(a, Vec3);
655
- var ptr0 = a.__destroy_into_raw();
656
- _assertClass(b, Vec3);
657
- var ptr1 = b.__destroy_into_raw();
658
- const ret = wasm.cross(ptr0, ptr1);
659
- return Vec3.__wrap(ret);
660
- }
661
- exports.cross = cross;
662
-
663
- /**
664
- * @param {number} t
665
- * @returns {number}
666
- */
667
- function ease_in_out(t) {
668
- const ret = wasm.ease_in_out(t);
669
- return ret;
670
- }
671
- exports.ease_in_out = ease_in_out;
672
-
673
- /**
674
- * @param {Vec3} start
675
- * @param {Vec3} end
676
- * @param {number} t
677
- * @returns {Vec3}
678
- */
679
- function lerp(start, end, t) {
680
- _assertClass(start, Vec3);
681
- var ptr0 = start.__destroy_into_raw();
682
- _assertClass(end, Vec3);
683
- var ptr1 = end.__destroy_into_raw();
684
- const ret = wasm.lerp(ptr0, ptr1, t);
685
- return Vec3.__wrap(ret);
686
- }
687
- exports.lerp = lerp;
688
-
689
- exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
690
- throw new Error(getStringFromWasm0(arg0, arg1));
691
- };
692
-
693
- exports.__wbg_new_from_slice_41e2764a343e3cb1 = function(arg0, arg1) {
694
- const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
695
- return ret;
696
- };
697
-
698
- exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
699
- // Cast intrinsic for `Ref(String) -> Externref`.
700
- const ret = getStringFromWasm0(arg0, arg1);
701
- return ret;
702
- };
703
-
704
- exports.__wbindgen_init_externref_table = function() {
705
- const table = wasm.__wbindgen_externrefs;
706
- const offset = table.grow(4);
707
- table.set(0, undefined);
708
- table.set(offset + 0, undefined);
709
- table.set(offset + 1, null);
710
- table.set(offset + 2, true);
711
- table.set(offset + 3, false);
712
- };
713
-
714
- const wasmPath = `${__dirname}/math_rust_lib_bg.wasm`;
715
- const wasmBytes = require('fs').readFileSync(wasmPath);
716
- const wasmModule = new WebAssembly.Module(wasmBytes);
717
- const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
718
-
1
+ import * as wasm from "./math_rust_lib_bg.wasm";
2
+ export * from "./math_rust_lib_bg.js";
3
+ import { __wbg_set_wasm } from "./math_rust_lib_bg.js";
4
+ __wbg_set_wasm(wasm);
719
5
  wasm.__wbindgen_start();