math-rust-lib 0.2.0 → 0.2.2

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