cavi 0.1.0 → 0.1.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/cavi.d.ts +106 -241
- package/cavi.js +8 -1509
- package/cavi_bg.js +1517 -0
- package/cavi_bg.wasm +0 -0
- package/package.json +5 -3
package/cavi.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
-
export class
|
|
4
|
+
export class WasmNode {
|
|
5
5
|
free(): void;
|
|
6
6
|
[Symbol.dispose](): void;
|
|
7
7
|
/**
|
|
@@ -11,15 +11,15 @@ export class Node {
|
|
|
11
11
|
/**
|
|
12
12
|
* Applies a force from a Point
|
|
13
13
|
*/
|
|
14
|
-
apply_force_point(force:
|
|
14
|
+
apply_force_point(force: WasmPoint): void;
|
|
15
15
|
/**
|
|
16
16
|
* Returns the squared distance to another node (faster)
|
|
17
17
|
*/
|
|
18
|
-
distance_squared_to(other:
|
|
18
|
+
distance_squared_to(other: WasmNode): number;
|
|
19
19
|
/**
|
|
20
20
|
* Returns the distance to another node
|
|
21
21
|
*/
|
|
22
|
-
distance_to(other:
|
|
22
|
+
distance_to(other: WasmNode): number;
|
|
23
23
|
/**
|
|
24
24
|
* Returns the fixed value (0.0 = movable, 1.0 = fixed)
|
|
25
25
|
*/
|
|
@@ -27,7 +27,7 @@ export class Node {
|
|
|
27
27
|
/**
|
|
28
28
|
* Returns the current position as a Point
|
|
29
29
|
*/
|
|
30
|
-
get_position():
|
|
30
|
+
get_position(): WasmPoint;
|
|
31
31
|
/**
|
|
32
32
|
* Returns the speed (magnitude of velocity)
|
|
33
33
|
*/
|
|
@@ -35,7 +35,7 @@ export class Node {
|
|
|
35
35
|
/**
|
|
36
36
|
* Returns the velocity as a Point
|
|
37
37
|
*/
|
|
38
|
-
get_velocity():
|
|
38
|
+
get_velocity(): WasmPoint;
|
|
39
39
|
/**
|
|
40
40
|
* Returns the velocity x component
|
|
41
41
|
*/
|
|
@@ -68,15 +68,15 @@ export class Node {
|
|
|
68
68
|
* Makes the node movable
|
|
69
69
|
*/
|
|
70
70
|
make_movable(): void;
|
|
71
|
-
constructor(pos:
|
|
71
|
+
constructor(pos: WasmPosition, vel: WasmPoint, fix: boolean);
|
|
72
72
|
/**
|
|
73
73
|
* Creates a fixed Node at the given position
|
|
74
74
|
*/
|
|
75
|
-
static new_fixed(x: number, y: number):
|
|
75
|
+
static new_fixed(x: number, y: number): WasmNode;
|
|
76
76
|
/**
|
|
77
77
|
* Creates a Node with no initial velocity
|
|
78
78
|
*/
|
|
79
|
-
static new_no_vel(x: number, y: number, fix: boolean):
|
|
79
|
+
static new_no_vel(x: number, y: number, fix: boolean): WasmNode;
|
|
80
80
|
/**
|
|
81
81
|
* Converts to a string representation
|
|
82
82
|
*/
|
|
@@ -104,21 +104,21 @@ export class Node {
|
|
|
104
104
|
/**
|
|
105
105
|
* Updates the position based on velocity and acceleration
|
|
106
106
|
*/
|
|
107
|
-
update_position(dt: number, friction: number, acceleration:
|
|
107
|
+
update_position(dt: number, friction: number, acceleration: WasmPoint): void;
|
|
108
108
|
/**
|
|
109
109
|
* Updates position with custom acceleration
|
|
110
110
|
*/
|
|
111
|
-
update_with_acceleration(acceleration:
|
|
111
|
+
update_with_acceleration(acceleration: WasmPoint, dt: number, friction: number): void;
|
|
112
112
|
/**
|
|
113
113
|
* Creates a Node at origin with no velocity
|
|
114
114
|
*/
|
|
115
|
-
static zero():
|
|
115
|
+
static zero(): WasmNode;
|
|
116
116
|
fixed: boolean;
|
|
117
|
-
position:
|
|
118
|
-
velocity:
|
|
117
|
+
position: WasmPosition;
|
|
118
|
+
velocity: WasmPoint;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
export class
|
|
121
|
+
export class WasmPoint {
|
|
122
122
|
free(): void;
|
|
123
123
|
[Symbol.dispose](): void;
|
|
124
124
|
/**
|
|
@@ -128,31 +128,31 @@ export class Point {
|
|
|
128
128
|
/**
|
|
129
129
|
* Returns the angle to another point in radians
|
|
130
130
|
*/
|
|
131
|
-
angle_to(other:
|
|
131
|
+
angle_to(other: WasmPoint): number;
|
|
132
132
|
/**
|
|
133
133
|
* Returns true if this point is approximately equal to another
|
|
134
134
|
*/
|
|
135
|
-
approx_equal(other:
|
|
135
|
+
approx_equal(other: WasmPoint, epsilon: number): boolean;
|
|
136
136
|
/**
|
|
137
137
|
* Clamps the length of the vector to a maximum value
|
|
138
138
|
*/
|
|
139
|
-
clamped(max_length: number):
|
|
139
|
+
clamped(max_length: number): WasmPoint;
|
|
140
140
|
/**
|
|
141
141
|
* Returns the cross product (z component) with another point
|
|
142
142
|
*/
|
|
143
|
-
cross(other:
|
|
143
|
+
cross(other: WasmPoint): number;
|
|
144
144
|
/**
|
|
145
145
|
* Returns the squared distance to another point (avoids sqrt)
|
|
146
146
|
*/
|
|
147
|
-
distance_squared_to(other:
|
|
147
|
+
distance_squared_to(other: WasmPoint): number;
|
|
148
148
|
/**
|
|
149
149
|
* Returns the distance to another point
|
|
150
150
|
*/
|
|
151
|
-
distance_to(other:
|
|
151
|
+
distance_to(other: WasmPoint): number;
|
|
152
152
|
/**
|
|
153
153
|
* Returns the dot product with another point
|
|
154
154
|
*/
|
|
155
|
-
dot(other:
|
|
155
|
+
dot(other: WasmPoint): number;
|
|
156
156
|
/**
|
|
157
157
|
* Returns the length (magnitude) of the vector
|
|
158
158
|
*/
|
|
@@ -164,7 +164,7 @@ export class Point {
|
|
|
164
164
|
/**
|
|
165
165
|
* Linear interpolation between this point and another
|
|
166
166
|
*/
|
|
167
|
-
lerp(other:
|
|
167
|
+
lerp(other: WasmPoint, t: number): WasmPoint;
|
|
168
168
|
constructor(x: number, y: number);
|
|
169
169
|
/**
|
|
170
170
|
* Normalizes this point in place
|
|
@@ -173,19 +173,19 @@ export class Point {
|
|
|
173
173
|
/**
|
|
174
174
|
* Returns a normalized version of this point (unit vector)
|
|
175
175
|
*/
|
|
176
|
-
normalized():
|
|
176
|
+
normalized(): WasmPoint;
|
|
177
177
|
/**
|
|
178
178
|
* Returns a point with both components set to 1
|
|
179
179
|
*/
|
|
180
|
-
static one():
|
|
180
|
+
static one(): WasmPoint;
|
|
181
181
|
/**
|
|
182
182
|
* Returns a perpendicular vector (rotated 90 degrees CCW)
|
|
183
183
|
*/
|
|
184
|
-
perpendicular():
|
|
184
|
+
perpendicular(): WasmPoint;
|
|
185
185
|
/**
|
|
186
186
|
* Reflects this vector across a normal vector
|
|
187
187
|
*/
|
|
188
|
-
reflect(normal:
|
|
188
|
+
reflect(normal: WasmPoint): WasmPoint;
|
|
189
189
|
/**
|
|
190
190
|
* Rotates this point in place by the given angle (in radians)
|
|
191
191
|
*/
|
|
@@ -193,30 +193,30 @@ export class Point {
|
|
|
193
193
|
/**
|
|
194
194
|
* Returns a point rotated by the given angle (in radians)
|
|
195
195
|
*/
|
|
196
|
-
rotated(angle: number):
|
|
196
|
+
rotated(angle: number): WasmPoint;
|
|
197
197
|
/**
|
|
198
198
|
* Returns a unit point in the X direction (1, 0)
|
|
199
199
|
*/
|
|
200
|
-
static unit_x():
|
|
200
|
+
static unit_x(): WasmPoint;
|
|
201
201
|
/**
|
|
202
202
|
* Returns a unit point in the Y direction (0, 1)
|
|
203
203
|
*/
|
|
204
|
-
static unit_y():
|
|
204
|
+
static unit_y(): WasmPoint;
|
|
205
205
|
/**
|
|
206
206
|
* Returns a zero point (0, 0)
|
|
207
207
|
*/
|
|
208
|
-
static zero():
|
|
208
|
+
static zero(): WasmPoint;
|
|
209
209
|
x: number;
|
|
210
210
|
y: number;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
export class
|
|
213
|
+
export class WasmPosition {
|
|
214
214
|
free(): void;
|
|
215
215
|
[Symbol.dispose](): void;
|
|
216
216
|
/**
|
|
217
217
|
* Applies a constraint by moving the current position
|
|
218
218
|
*/
|
|
219
|
-
constrain(target:
|
|
219
|
+
constrain(target: WasmPoint): void;
|
|
220
220
|
/**
|
|
221
221
|
* Returns the distance between current and old positions
|
|
222
222
|
*/
|
|
@@ -224,11 +224,11 @@ export class Position {
|
|
|
224
224
|
/**
|
|
225
225
|
* Creates a Position from two Points
|
|
226
226
|
*/
|
|
227
|
-
static from_points(curr:
|
|
227
|
+
static from_points(curr: WasmPoint, old: WasmPoint): WasmPosition;
|
|
228
228
|
/**
|
|
229
229
|
* Returns the current position as a Point
|
|
230
230
|
*/
|
|
231
|
-
get_curr():
|
|
231
|
+
get_curr(): WasmPoint;
|
|
232
232
|
/**
|
|
233
233
|
* Returns the current x coordinate
|
|
234
234
|
*/
|
|
@@ -240,7 +240,7 @@ export class Position {
|
|
|
240
240
|
/**
|
|
241
241
|
* Returns the old position as a Point
|
|
242
242
|
*/
|
|
243
|
-
get_old():
|
|
243
|
+
get_old(): WasmPoint;
|
|
244
244
|
/**
|
|
245
245
|
* Returns the old x coordinate
|
|
246
246
|
*/
|
|
@@ -253,12 +253,12 @@ export class Position {
|
|
|
253
253
|
* Integrates the position using Verlet integration
|
|
254
254
|
* new_pos = curr + (curr - old) * damping + acceleration * dt^2
|
|
255
255
|
*/
|
|
256
|
-
integrate(acceleration:
|
|
256
|
+
integrate(acceleration: WasmPoint, dt: number, damping: number): void;
|
|
257
257
|
constructor(x: number, y: number);
|
|
258
258
|
/**
|
|
259
259
|
* Creates a Position with different current and old positions
|
|
260
260
|
*/
|
|
261
|
-
static new_with_old(curr_x: number, curr_y: number, old_x: number, old_y: number):
|
|
261
|
+
static new_with_old(curr_x: number, curr_y: number, old_x: number, old_y: number): WasmPosition;
|
|
262
262
|
/**
|
|
263
263
|
* Resets old position to match current (stops motion)
|
|
264
264
|
*/
|
|
@@ -270,7 +270,7 @@ export class Position {
|
|
|
270
270
|
/**
|
|
271
271
|
* Sets the current position from a Point
|
|
272
272
|
*/
|
|
273
|
-
set_curr_point(point:
|
|
273
|
+
set_curr_point(point: WasmPoint): void;
|
|
274
274
|
/**
|
|
275
275
|
* Sets the old position
|
|
276
276
|
*/
|
|
@@ -278,7 +278,7 @@ export class Position {
|
|
|
278
278
|
/**
|
|
279
279
|
* Sets the old position from a Point
|
|
280
280
|
*/
|
|
281
|
-
set_old_point(point:
|
|
281
|
+
set_old_point(point: WasmPoint): void;
|
|
282
282
|
/**
|
|
283
283
|
* Returns the speed (magnitude of velocity)
|
|
284
284
|
*/
|
|
@@ -290,26 +290,34 @@ export class Position {
|
|
|
290
290
|
/**
|
|
291
291
|
* Updates the position from a Point
|
|
292
292
|
*/
|
|
293
|
-
update_point(point:
|
|
293
|
+
update_point(point: WasmPoint): void;
|
|
294
294
|
/**
|
|
295
295
|
* Returns the velocity (difference between current and old positions)
|
|
296
296
|
*/
|
|
297
|
-
velocity():
|
|
298
|
-
curr:
|
|
299
|
-
old:
|
|
297
|
+
velocity(): WasmPoint;
|
|
298
|
+
curr: WasmPoint;
|
|
299
|
+
old: WasmPoint;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
export class
|
|
302
|
+
export class WasmWire {
|
|
303
303
|
free(): void;
|
|
304
304
|
[Symbol.dispose](): void;
|
|
305
|
+
/**
|
|
306
|
+
* Adds a new node at the specified position
|
|
307
|
+
*/
|
|
308
|
+
add_node(x: number, y: number, fixed: boolean): void;
|
|
309
|
+
/**
|
|
310
|
+
* Adds a new node at a specific index
|
|
311
|
+
*/
|
|
312
|
+
add_node_at(index: number, x: number, y: number, fixed: boolean): void;
|
|
305
313
|
/**
|
|
306
314
|
* Checks collision with a point and adjusts nodes
|
|
307
315
|
*/
|
|
308
|
-
check_collision(point:
|
|
316
|
+
check_collision(point: WasmPoint, pointer_radius: number): void;
|
|
309
317
|
/**
|
|
310
318
|
* Checks collision with mouse/pointer position
|
|
311
319
|
*/
|
|
312
|
-
check_mouse_collision(mouse:
|
|
320
|
+
check_mouse_collision(mouse: WasmPoint, mouse_radius: number): void;
|
|
313
321
|
/**
|
|
314
322
|
* Checks for collisions between wire elements
|
|
315
323
|
*/
|
|
@@ -317,11 +325,11 @@ export class Wire {
|
|
|
317
325
|
/**
|
|
318
326
|
* Gets the end point of the wire
|
|
319
327
|
*/
|
|
320
|
-
get_end():
|
|
328
|
+
get_end(): WasmPoint;
|
|
321
329
|
/**
|
|
322
330
|
* Gets a specific node by index
|
|
323
331
|
*/
|
|
324
|
-
get_node(index: number):
|
|
332
|
+
get_node(index: number): WasmNode | undefined;
|
|
325
333
|
/**
|
|
326
334
|
* Gets the x coordinate of a node at the given index
|
|
327
335
|
*/
|
|
@@ -338,7 +346,7 @@ export class Wire {
|
|
|
338
346
|
/**
|
|
339
347
|
* Gets the start point of the wire
|
|
340
348
|
*/
|
|
341
|
-
get_start():
|
|
349
|
+
get_start(): WasmPoint;
|
|
342
350
|
/**
|
|
343
351
|
* Resets the iteration counter
|
|
344
352
|
*/
|
|
@@ -351,16 +359,20 @@ export class Wire {
|
|
|
351
359
|
/**
|
|
352
360
|
* Creates a wire between two points with specified radius
|
|
353
361
|
*/
|
|
354
|
-
static new_wire(xs: number, ys: number, xe: number, ye: number, radius: number):
|
|
362
|
+
static new_wire(xs: number, ys: number, xe: number, ye: number, radius: number): WasmWire;
|
|
355
363
|
/**
|
|
356
364
|
* Creates a wire with specific node count and link target distance
|
|
357
365
|
*/
|
|
358
|
-
static new_with_count(xs: number, ys: number, xe: number, ye: number, node_count: number, link_target: number, radius: number, render_type: number):
|
|
366
|
+
static new_with_count(xs: number, ys: number, xe: number, ye: number, node_count: number, link_target: number, radius: number, render_type: number): WasmWire;
|
|
359
367
|
/**
|
|
360
368
|
* Returns the number of nodes in the wire
|
|
361
369
|
*/
|
|
362
370
|
node_count(): number;
|
|
363
|
-
static optimal_length(start:
|
|
371
|
+
static optimal_length(start: WasmPoint, end: WasmPoint, node_radius: number): number;
|
|
372
|
+
/**
|
|
373
|
+
* Removes a node at the specified index
|
|
374
|
+
*/
|
|
375
|
+
remove_node(index: number): boolean;
|
|
364
376
|
/**
|
|
365
377
|
* Sets the end point position (if it's fixed)
|
|
366
378
|
*/
|
|
@@ -374,6 +386,10 @@ export class Wire {
|
|
|
374
386
|
* Sets the fixed state of a specific node
|
|
375
387
|
*/
|
|
376
388
|
set_node_fixed(node_idx: number, fixed: boolean): void;
|
|
389
|
+
/**
|
|
390
|
+
* Sets the position of a specific node
|
|
391
|
+
*/
|
|
392
|
+
set_node_position(node_idx: number, x: number, y: number): void;
|
|
377
393
|
/**
|
|
378
394
|
* Sets the radius of the wire
|
|
379
395
|
*/
|
|
@@ -389,14 +405,14 @@ export class Wire {
|
|
|
389
405
|
/**
|
|
390
406
|
* Updates the wire physics simulation
|
|
391
407
|
*/
|
|
392
|
-
update(dt: number, friction: number, acceleration:
|
|
408
|
+
update(dt: number, friction: number, acceleration: WasmPoint): void;
|
|
393
409
|
iterations: number;
|
|
394
410
|
link_target_distance: number;
|
|
395
411
|
radius: number;
|
|
396
412
|
render_type: number;
|
|
397
413
|
}
|
|
398
414
|
|
|
399
|
-
export class
|
|
415
|
+
export class WasmWorld {
|
|
400
416
|
free(): void;
|
|
401
417
|
[Symbol.dispose](): void;
|
|
402
418
|
/**
|
|
@@ -407,14 +423,34 @@ export class World {
|
|
|
407
423
|
* Adds a default wire to the world
|
|
408
424
|
*/
|
|
409
425
|
add_wire_debug(): void;
|
|
426
|
+
/**
|
|
427
|
+
* Adds a node to a specific wire
|
|
428
|
+
*/
|
|
429
|
+
add_wire_node(wire_idx: number, x: number, y: number, fixed: boolean): void;
|
|
430
|
+
/**
|
|
431
|
+
* Adds a node to a specific wire at a specific index
|
|
432
|
+
*/
|
|
433
|
+
add_wire_node_at(wire_idx: number, node_idx: number, x: number, y: number, fixed: boolean): void;
|
|
410
434
|
/**
|
|
411
435
|
* Adds a wire with specific node count and link target distance
|
|
412
436
|
*/
|
|
413
437
|
add_wire_with_count(xs: number, ys: number, xe: number, ye: number, node_count: number, link_target: number, radius: number, render_type: number): void;
|
|
438
|
+
/**
|
|
439
|
+
* Deletes a wire by index
|
|
440
|
+
*/
|
|
441
|
+
delete_wire(index: number): boolean;
|
|
414
442
|
/**
|
|
415
443
|
* Gets the acceleration vector
|
|
416
444
|
*/
|
|
417
|
-
get_acceleration():
|
|
445
|
+
get_acceleration(): WasmPoint;
|
|
446
|
+
/**
|
|
447
|
+
* Gets the x component of acceleration
|
|
448
|
+
*/
|
|
449
|
+
get_acceleration_x(): number;
|
|
450
|
+
/**
|
|
451
|
+
* Gets the y component of acceleration
|
|
452
|
+
*/
|
|
453
|
+
get_acceleration_y(): number;
|
|
418
454
|
/**
|
|
419
455
|
* Gets the friction coefficient
|
|
420
456
|
*/
|
|
@@ -434,11 +470,11 @@ export class World {
|
|
|
434
470
|
/**
|
|
435
471
|
* Gets a specific wire by index
|
|
436
472
|
*/
|
|
437
|
-
get_wire(index: number):
|
|
473
|
+
get_wire(index: number): WasmWire | undefined;
|
|
438
474
|
/**
|
|
439
475
|
* Gets a node from a specific wire
|
|
440
476
|
*/
|
|
441
|
-
get_wire_node(wire_idx: number, node_idx: number):
|
|
477
|
+
get_wire_node(wire_idx: number, node_idx: number): WasmNode | undefined;
|
|
442
478
|
/**
|
|
443
479
|
* Gets the number of nodes in a specific wire
|
|
444
480
|
*/
|
|
@@ -453,6 +489,10 @@ export class World {
|
|
|
453
489
|
get_wire_node_y(wire_idx: number, node_idx: number): number;
|
|
454
490
|
get_wire_radius(wire_idx: number): number;
|
|
455
491
|
constructor();
|
|
492
|
+
/**
|
|
493
|
+
* Removes a node from a specific wire
|
|
494
|
+
*/
|
|
495
|
+
remove_wire_node(wire_idx: number, node_idx: number): boolean;
|
|
456
496
|
/**
|
|
457
497
|
* Sets the acceleration vector
|
|
458
498
|
*/
|
|
@@ -489,6 +529,14 @@ export class World {
|
|
|
489
529
|
* Sets the fixed state of a specific node in a wire
|
|
490
530
|
*/
|
|
491
531
|
set_wire_node_fixed(wire_idx: number, node_idx: number, fixed: boolean): void;
|
|
532
|
+
/**
|
|
533
|
+
* Sets the position of a specific node in a wire
|
|
534
|
+
*/
|
|
535
|
+
set_wire_node_position(wire_idx: number, node_idx: number, x: number, y: number): void;
|
|
536
|
+
/**
|
|
537
|
+
* Sets the radius of a specific wire
|
|
538
|
+
*/
|
|
539
|
+
set_wire_radius(wire_idx: number, radius: number): void;
|
|
492
540
|
/**
|
|
493
541
|
* Sets the position of the first node (start) of a wire
|
|
494
542
|
*/
|
|
@@ -515,186 +563,3 @@ export class World {
|
|
|
515
563
|
*/
|
|
516
564
|
static wire_optimal_length(start_x: number, start_y: number, end_x: number, end_y: number, radius: number): number;
|
|
517
565
|
}
|
|
518
|
-
|
|
519
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
520
|
-
|
|
521
|
-
export interface InitOutput {
|
|
522
|
-
readonly memory: WebAssembly.Memory;
|
|
523
|
-
readonly __wbg_get_wire_iterations: (a: number) => number;
|
|
524
|
-
readonly __wbg_get_wire_link_target_distance: (a: number) => number;
|
|
525
|
-
readonly __wbg_get_wire_radius: (a: number) => number;
|
|
526
|
-
readonly __wbg_get_wire_render_type: (a: number) => number;
|
|
527
|
-
readonly __wbg_set_wire_iterations: (a: number, b: number) => void;
|
|
528
|
-
readonly __wbg_set_wire_link_target_distance: (a: number, b: number) => void;
|
|
529
|
-
readonly __wbg_set_wire_radius: (a: number, b: number) => void;
|
|
530
|
-
readonly __wbg_set_wire_render_type: (a: number, b: number) => void;
|
|
531
|
-
readonly __wbg_wire_free: (a: number, b: number) => void;
|
|
532
|
-
readonly wire_check_collision: (a: number, b: number, c: number) => void;
|
|
533
|
-
readonly wire_check_mouse_collision: (a: number, b: number, c: number) => void;
|
|
534
|
-
readonly wire_check_wire_elements_collisions: (a: number, b: number) => void;
|
|
535
|
-
readonly wire_get_end: (a: number) => number;
|
|
536
|
-
readonly wire_get_node: (a: number, b: number) => number;
|
|
537
|
-
readonly wire_get_node_x: (a: number, b: number) => number;
|
|
538
|
-
readonly wire_get_node_y: (a: number, b: number) => number;
|
|
539
|
-
readonly wire_get_radius: (a: number) => number;
|
|
540
|
-
readonly wire_get_render_type: (a: number) => number;
|
|
541
|
-
readonly wire_get_start: (a: number) => number;
|
|
542
|
-
readonly wire_invalidate: (a: number) => void;
|
|
543
|
-
readonly wire_length: (a: number) => number;
|
|
544
|
-
readonly wire_new: () => number;
|
|
545
|
-
readonly wire_new_wire: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
546
|
-
readonly wire_new_with_count: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
547
|
-
readonly wire_node_count: (a: number) => number;
|
|
548
|
-
readonly wire_optimal_length: (a: number, b: number, c: number) => number;
|
|
549
|
-
readonly wire_set_end: (a: number, b: number, c: number) => void;
|
|
550
|
-
readonly wire_set_node_count: (a: number, b: number) => void;
|
|
551
|
-
readonly wire_set_node_fixed: (a: number, b: number, c: number) => void;
|
|
552
|
-
readonly wire_set_radius: (a: number, b: number) => void;
|
|
553
|
-
readonly wire_set_render_type: (a: number, b: number) => void;
|
|
554
|
-
readonly wire_set_start: (a: number, b: number, c: number) => void;
|
|
555
|
-
readonly wire_update: (a: number, b: number, c: number, d: number) => void;
|
|
556
|
-
readonly __wbg_get_point_x: (a: number) => number;
|
|
557
|
-
readonly __wbg_get_point_y: (a: number) => number;
|
|
558
|
-
readonly __wbg_point_free: (a: number, b: number) => void;
|
|
559
|
-
readonly __wbg_set_point_x: (a: number, b: number) => void;
|
|
560
|
-
readonly __wbg_set_point_y: (a: number, b: number) => void;
|
|
561
|
-
readonly point_angle: (a: number) => number;
|
|
562
|
-
readonly point_angle_to: (a: number, b: number) => number;
|
|
563
|
-
readonly point_approx_equal: (a: number, b: number, c: number) => number;
|
|
564
|
-
readonly point_clamped: (a: number, b: number) => number;
|
|
565
|
-
readonly point_cross: (a: number, b: number) => number;
|
|
566
|
-
readonly point_distance_squared_to: (a: number, b: number) => number;
|
|
567
|
-
readonly point_distance_to: (a: number, b: number) => number;
|
|
568
|
-
readonly point_dot: (a: number, b: number) => number;
|
|
569
|
-
readonly point_length: (a: number) => number;
|
|
570
|
-
readonly point_length_squared: (a: number) => number;
|
|
571
|
-
readonly point_lerp: (a: number, b: number, c: number) => number;
|
|
572
|
-
readonly point_new: (a: number, b: number) => number;
|
|
573
|
-
readonly point_normalize: (a: number) => void;
|
|
574
|
-
readonly point_normalized: (a: number) => number;
|
|
575
|
-
readonly point_one: () => number;
|
|
576
|
-
readonly point_perpendicular: (a: number) => number;
|
|
577
|
-
readonly point_reflect: (a: number, b: number) => number;
|
|
578
|
-
readonly point_rotate: (a: number, b: number) => void;
|
|
579
|
-
readonly point_rotated: (a: number, b: number) => number;
|
|
580
|
-
readonly point_unit_x: () => number;
|
|
581
|
-
readonly point_unit_y: () => number;
|
|
582
|
-
readonly point_zero: () => number;
|
|
583
|
-
readonly __wbg_world_free: (a: number, b: number) => void;
|
|
584
|
-
readonly world_add_wire: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
585
|
-
readonly world_add_wire_debug: (a: number) => void;
|
|
586
|
-
readonly world_add_wire_with_count: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
587
|
-
readonly world_get_acceleration: (a: number) => number;
|
|
588
|
-
readonly world_get_friction: (a: number) => number;
|
|
589
|
-
readonly world_get_mouse_radius: (a: number) => number;
|
|
590
|
-
readonly world_get_pointer_radius: (a: number) => number;
|
|
591
|
-
readonly world_get_response_coef: (a: number) => number;
|
|
592
|
-
readonly world_get_wire: (a: number, b: number) => number;
|
|
593
|
-
readonly world_get_wire_node: (a: number, b: number, c: number) => number;
|
|
594
|
-
readonly world_get_wire_node_count: (a: number, b: number) => number;
|
|
595
|
-
readonly world_get_wire_node_x: (a: number, b: number, c: number) => number;
|
|
596
|
-
readonly world_get_wire_node_y: (a: number, b: number, c: number) => number;
|
|
597
|
-
readonly world_get_wire_radius: (a: number, b: number) => number;
|
|
598
|
-
readonly world_new: () => number;
|
|
599
|
-
readonly world_set_acceleration: (a: number, b: number, c: number) => void;
|
|
600
|
-
readonly world_set_friction: (a: number, b: number) => void;
|
|
601
|
-
readonly world_set_mouse: (a: number, b: number, c: number) => void;
|
|
602
|
-
readonly world_set_mouse_radius: (a: number, b: number) => void;
|
|
603
|
-
readonly world_set_pointer_radius: (a: number, b: number) => void;
|
|
604
|
-
readonly world_set_response_coef: (a: number, b: number) => void;
|
|
605
|
-
readonly world_set_wire_end: (a: number, b: number, c: number, d: number) => void;
|
|
606
|
-
readonly world_set_wire_node_count: (a: number, b: number, c: number) => void;
|
|
607
|
-
readonly world_set_wire_node_fixed: (a: number, b: number, c: number, d: number) => void;
|
|
608
|
-
readonly world_set_wire_start: (a: number, b: number, c: number, d: number) => void;
|
|
609
|
-
readonly world_update: (a: number) => void;
|
|
610
|
-
readonly world_wire_count: (a: number) => number;
|
|
611
|
-
readonly world_wire_data_len: (a: number) => number;
|
|
612
|
-
readonly world_wire_data_ptr: (a: number) => number;
|
|
613
|
-
readonly world_wire_optimal_length: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
614
|
-
readonly __wbg_get_position_curr: (a: number) => number;
|
|
615
|
-
readonly __wbg_get_position_old: (a: number) => number;
|
|
616
|
-
readonly __wbg_position_free: (a: number, b: number) => void;
|
|
617
|
-
readonly __wbg_set_position_curr: (a: number, b: number) => void;
|
|
618
|
-
readonly __wbg_set_position_old: (a: number, b: number) => void;
|
|
619
|
-
readonly position_constrain: (a: number, b: number) => void;
|
|
620
|
-
readonly position_displacement: (a: number) => number;
|
|
621
|
-
readonly position_from_points: (a: number, b: number) => number;
|
|
622
|
-
readonly position_get_curr: (a: number) => number;
|
|
623
|
-
readonly position_get_curr_x: (a: number) => number;
|
|
624
|
-
readonly position_get_curr_y: (a: number) => number;
|
|
625
|
-
readonly position_get_old: (a: number) => number;
|
|
626
|
-
readonly position_get_old_x: (a: number) => number;
|
|
627
|
-
readonly position_get_old_y: (a: number) => number;
|
|
628
|
-
readonly position_integrate: (a: number, b: number, c: number, d: number) => void;
|
|
629
|
-
readonly position_new: (a: number, b: number) => number;
|
|
630
|
-
readonly position_new_with_old: (a: number, b: number, c: number, d: number) => number;
|
|
631
|
-
readonly position_reset_velocity: (a: number) => void;
|
|
632
|
-
readonly position_set_curr: (a: number, b: number, c: number) => void;
|
|
633
|
-
readonly position_set_curr_point: (a: number, b: number) => void;
|
|
634
|
-
readonly position_set_old: (a: number, b: number, c: number) => void;
|
|
635
|
-
readonly position_set_old_point: (a: number, b: number) => void;
|
|
636
|
-
readonly position_speed: (a: number) => number;
|
|
637
|
-
readonly position_update: (a: number, b: number, c: number) => void;
|
|
638
|
-
readonly position_update_point: (a: number, b: number) => void;
|
|
639
|
-
readonly position_velocity: (a: number) => number;
|
|
640
|
-
readonly __wbg_get_node_fixed: (a: number) => number;
|
|
641
|
-
readonly __wbg_get_node_position: (a: number) => number;
|
|
642
|
-
readonly __wbg_get_node_velocity: (a: number) => number;
|
|
643
|
-
readonly __wbg_node_free: (a: number, b: number) => void;
|
|
644
|
-
readonly __wbg_set_node_fixed: (a: number, b: number) => void;
|
|
645
|
-
readonly __wbg_set_node_position: (a: number, b: number) => void;
|
|
646
|
-
readonly __wbg_set_node_velocity: (a: number, b: number) => void;
|
|
647
|
-
readonly node_apply_force: (a: number, b: number, c: number) => void;
|
|
648
|
-
readonly node_apply_force_point: (a: number, b: number) => void;
|
|
649
|
-
readonly node_distance_squared_to: (a: number, b: number) => number;
|
|
650
|
-
readonly node_distance_to: (a: number, b: number) => number;
|
|
651
|
-
readonly node_get_fixed: (a: number) => number;
|
|
652
|
-
readonly node_get_position: (a: number) => number;
|
|
653
|
-
readonly node_get_speed: (a: number) => number;
|
|
654
|
-
readonly node_get_velocity: (a: number) => number;
|
|
655
|
-
readonly node_get_velocity_x: (a: number) => number;
|
|
656
|
-
readonly node_get_velocity_y: (a: number) => number;
|
|
657
|
-
readonly node_get_x: (a: number) => number;
|
|
658
|
-
readonly node_get_y: (a: number) => number;
|
|
659
|
-
readonly node_is_movable: (a: number) => number;
|
|
660
|
-
readonly node_make_fixed: (a: number) => void;
|
|
661
|
-
readonly node_make_movable: (a: number) => void;
|
|
662
|
-
readonly node_new: (a: number, b: number, c: number) => number;
|
|
663
|
-
readonly node_new_fixed: (a: number, b: number) => number;
|
|
664
|
-
readonly node_new_no_vel: (a: number, b: number, c: number) => number;
|
|
665
|
-
readonly node_print: (a: number) => [number, number];
|
|
666
|
-
readonly node_reset_velocity: (a: number) => void;
|
|
667
|
-
readonly node_set_fixed: (a: number, b: number) => void;
|
|
668
|
-
readonly node_set_position: (a: number, b: number, c: number) => void;
|
|
669
|
-
readonly node_set_velocity: (a: number, b: number, c: number) => void;
|
|
670
|
-
readonly node_translate: (a: number, b: number, c: number) => void;
|
|
671
|
-
readonly node_update_position: (a: number, b: number, c: number, d: number) => void;
|
|
672
|
-
readonly node_update_with_acceleration: (a: number, b: number, c: number, d: number) => void;
|
|
673
|
-
readonly node_zero: () => number;
|
|
674
|
-
readonly node_is_fixed: (a: number) => number;
|
|
675
|
-
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
676
|
-
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
677
|
-
readonly __wbindgen_start: () => void;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
684
|
-
* a precompiled `WebAssembly.Module`.
|
|
685
|
-
*
|
|
686
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
687
|
-
*
|
|
688
|
-
* @returns {InitOutput}
|
|
689
|
-
*/
|
|
690
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
694
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
695
|
-
*
|
|
696
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
697
|
-
*
|
|
698
|
-
* @returns {Promise<InitOutput>}
|
|
699
|
-
*/
|
|
700
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|