cavi 0.1.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 +84 -0
- package/cavi.d.ts +700 -0
- package/cavi.js +1510 -0
- package/cavi_bg.wasm +0 -0
- package/package.json +18 -0
package/cavi.d.ts
ADDED
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class Node {
|
|
5
|
+
free(): void;
|
|
6
|
+
[Symbol.dispose](): void;
|
|
7
|
+
/**
|
|
8
|
+
* Applies a force to the node (changes velocity)
|
|
9
|
+
*/
|
|
10
|
+
apply_force(fx: number, fy: number): void;
|
|
11
|
+
/**
|
|
12
|
+
* Applies a force from a Point
|
|
13
|
+
*/
|
|
14
|
+
apply_force_point(force: Point): void;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the squared distance to another node (faster)
|
|
17
|
+
*/
|
|
18
|
+
distance_squared_to(other: Node): number;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the distance to another node
|
|
21
|
+
*/
|
|
22
|
+
distance_to(other: Node): number;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the fixed value (0.0 = movable, 1.0 = fixed)
|
|
25
|
+
*/
|
|
26
|
+
get_fixed(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the current position as a Point
|
|
29
|
+
*/
|
|
30
|
+
get_position(): Point;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the speed (magnitude of velocity)
|
|
33
|
+
*/
|
|
34
|
+
get_speed(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the velocity as a Point
|
|
37
|
+
*/
|
|
38
|
+
get_velocity(): Point;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the velocity x component
|
|
41
|
+
*/
|
|
42
|
+
get_velocity_x(): number;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the velocity y component
|
|
45
|
+
*/
|
|
46
|
+
get_velocity_y(): number;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the current x position
|
|
49
|
+
*/
|
|
50
|
+
get_x(): number;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the current y position
|
|
53
|
+
*/
|
|
54
|
+
get_y(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Returns true if the node is fixed
|
|
57
|
+
*/
|
|
58
|
+
is_fixed(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Returns true if the node is movable
|
|
61
|
+
*/
|
|
62
|
+
is_movable(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Makes the node fixed (immovable)
|
|
65
|
+
*/
|
|
66
|
+
make_fixed(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Makes the node movable
|
|
69
|
+
*/
|
|
70
|
+
make_movable(): void;
|
|
71
|
+
constructor(pos: Position, vel: Point, fix: boolean);
|
|
72
|
+
/**
|
|
73
|
+
* Creates a fixed Node at the given position
|
|
74
|
+
*/
|
|
75
|
+
static new_fixed(x: number, y: number): Node;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a Node with no initial velocity
|
|
78
|
+
*/
|
|
79
|
+
static new_no_vel(x: number, y: number, fix: boolean): Node;
|
|
80
|
+
/**
|
|
81
|
+
* Converts to a string representation
|
|
82
|
+
*/
|
|
83
|
+
print(): string;
|
|
84
|
+
/**
|
|
85
|
+
* Resets the velocity to zero
|
|
86
|
+
*/
|
|
87
|
+
reset_velocity(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Sets whether the node is fixed
|
|
90
|
+
*/
|
|
91
|
+
set_fixed(fixed: boolean): void;
|
|
92
|
+
/**
|
|
93
|
+
* Sets the current position
|
|
94
|
+
*/
|
|
95
|
+
set_position(x: number, y: number): void;
|
|
96
|
+
/**
|
|
97
|
+
* Sets the velocity
|
|
98
|
+
*/
|
|
99
|
+
set_velocity(vx: number, vy: number): void;
|
|
100
|
+
/**
|
|
101
|
+
* Moves the node by a delta amount
|
|
102
|
+
*/
|
|
103
|
+
translate(dx: number, dy: number): void;
|
|
104
|
+
/**
|
|
105
|
+
* Updates the position based on velocity and acceleration
|
|
106
|
+
*/
|
|
107
|
+
update_position(dt: number, friction: number, acceleration: Point): void;
|
|
108
|
+
/**
|
|
109
|
+
* Updates position with custom acceleration
|
|
110
|
+
*/
|
|
111
|
+
update_with_acceleration(acceleration: Point, dt: number, friction: number): void;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a Node at origin with no velocity
|
|
114
|
+
*/
|
|
115
|
+
static zero(): Node;
|
|
116
|
+
fixed: boolean;
|
|
117
|
+
position: Position;
|
|
118
|
+
velocity: Point;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export class Point {
|
|
122
|
+
free(): void;
|
|
123
|
+
[Symbol.dispose](): void;
|
|
124
|
+
/**
|
|
125
|
+
* Returns the angle of this vector in radians
|
|
126
|
+
*/
|
|
127
|
+
angle(): number;
|
|
128
|
+
/**
|
|
129
|
+
* Returns the angle to another point in radians
|
|
130
|
+
*/
|
|
131
|
+
angle_to(other: Point): number;
|
|
132
|
+
/**
|
|
133
|
+
* Returns true if this point is approximately equal to another
|
|
134
|
+
*/
|
|
135
|
+
approx_equal(other: Point, epsilon: number): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Clamps the length of the vector to a maximum value
|
|
138
|
+
*/
|
|
139
|
+
clamped(max_length: number): Point;
|
|
140
|
+
/**
|
|
141
|
+
* Returns the cross product (z component) with another point
|
|
142
|
+
*/
|
|
143
|
+
cross(other: Point): number;
|
|
144
|
+
/**
|
|
145
|
+
* Returns the squared distance to another point (avoids sqrt)
|
|
146
|
+
*/
|
|
147
|
+
distance_squared_to(other: Point): number;
|
|
148
|
+
/**
|
|
149
|
+
* Returns the distance to another point
|
|
150
|
+
*/
|
|
151
|
+
distance_to(other: Point): number;
|
|
152
|
+
/**
|
|
153
|
+
* Returns the dot product with another point
|
|
154
|
+
*/
|
|
155
|
+
dot(other: Point): number;
|
|
156
|
+
/**
|
|
157
|
+
* Returns the length (magnitude) of the vector
|
|
158
|
+
*/
|
|
159
|
+
length(): number;
|
|
160
|
+
/**
|
|
161
|
+
* Returns the squared length (avoids sqrt for performance)
|
|
162
|
+
*/
|
|
163
|
+
length_squared(): number;
|
|
164
|
+
/**
|
|
165
|
+
* Linear interpolation between this point and another
|
|
166
|
+
*/
|
|
167
|
+
lerp(other: Point, t: number): Point;
|
|
168
|
+
constructor(x: number, y: number);
|
|
169
|
+
/**
|
|
170
|
+
* Normalizes this point in place
|
|
171
|
+
*/
|
|
172
|
+
normalize(): void;
|
|
173
|
+
/**
|
|
174
|
+
* Returns a normalized version of this point (unit vector)
|
|
175
|
+
*/
|
|
176
|
+
normalized(): Point;
|
|
177
|
+
/**
|
|
178
|
+
* Returns a point with both components set to 1
|
|
179
|
+
*/
|
|
180
|
+
static one(): Point;
|
|
181
|
+
/**
|
|
182
|
+
* Returns a perpendicular vector (rotated 90 degrees CCW)
|
|
183
|
+
*/
|
|
184
|
+
perpendicular(): Point;
|
|
185
|
+
/**
|
|
186
|
+
* Reflects this vector across a normal vector
|
|
187
|
+
*/
|
|
188
|
+
reflect(normal: Point): Point;
|
|
189
|
+
/**
|
|
190
|
+
* Rotates this point in place by the given angle (in radians)
|
|
191
|
+
*/
|
|
192
|
+
rotate(angle: number): void;
|
|
193
|
+
/**
|
|
194
|
+
* Returns a point rotated by the given angle (in radians)
|
|
195
|
+
*/
|
|
196
|
+
rotated(angle: number): Point;
|
|
197
|
+
/**
|
|
198
|
+
* Returns a unit point in the X direction (1, 0)
|
|
199
|
+
*/
|
|
200
|
+
static unit_x(): Point;
|
|
201
|
+
/**
|
|
202
|
+
* Returns a unit point in the Y direction (0, 1)
|
|
203
|
+
*/
|
|
204
|
+
static unit_y(): Point;
|
|
205
|
+
/**
|
|
206
|
+
* Returns a zero point (0, 0)
|
|
207
|
+
*/
|
|
208
|
+
static zero(): Point;
|
|
209
|
+
x: number;
|
|
210
|
+
y: number;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export class Position {
|
|
214
|
+
free(): void;
|
|
215
|
+
[Symbol.dispose](): void;
|
|
216
|
+
/**
|
|
217
|
+
* Applies a constraint by moving the current position
|
|
218
|
+
*/
|
|
219
|
+
constrain(target: Point): void;
|
|
220
|
+
/**
|
|
221
|
+
* Returns the distance between current and old positions
|
|
222
|
+
*/
|
|
223
|
+
displacement(): number;
|
|
224
|
+
/**
|
|
225
|
+
* Creates a Position from two Points
|
|
226
|
+
*/
|
|
227
|
+
static from_points(curr: Point, old: Point): Position;
|
|
228
|
+
/**
|
|
229
|
+
* Returns the current position as a Point
|
|
230
|
+
*/
|
|
231
|
+
get_curr(): Point;
|
|
232
|
+
/**
|
|
233
|
+
* Returns the current x coordinate
|
|
234
|
+
*/
|
|
235
|
+
get_curr_x(): number;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the current y coordinate
|
|
238
|
+
*/
|
|
239
|
+
get_curr_y(): number;
|
|
240
|
+
/**
|
|
241
|
+
* Returns the old position as a Point
|
|
242
|
+
*/
|
|
243
|
+
get_old(): Point;
|
|
244
|
+
/**
|
|
245
|
+
* Returns the old x coordinate
|
|
246
|
+
*/
|
|
247
|
+
get_old_x(): number;
|
|
248
|
+
/**
|
|
249
|
+
* Returns the old y coordinate
|
|
250
|
+
*/
|
|
251
|
+
get_old_y(): number;
|
|
252
|
+
/**
|
|
253
|
+
* Integrates the position using Verlet integration
|
|
254
|
+
* new_pos = curr + (curr - old) * damping + acceleration * dt^2
|
|
255
|
+
*/
|
|
256
|
+
integrate(acceleration: Point, dt: number, damping: number): void;
|
|
257
|
+
constructor(x: number, y: number);
|
|
258
|
+
/**
|
|
259
|
+
* Creates a Position with different current and old positions
|
|
260
|
+
*/
|
|
261
|
+
static new_with_old(curr_x: number, curr_y: number, old_x: number, old_y: number): Position;
|
|
262
|
+
/**
|
|
263
|
+
* Resets old position to match current (stops motion)
|
|
264
|
+
*/
|
|
265
|
+
reset_velocity(): void;
|
|
266
|
+
/**
|
|
267
|
+
* Sets the current position
|
|
268
|
+
*/
|
|
269
|
+
set_curr(x: number, y: number): void;
|
|
270
|
+
/**
|
|
271
|
+
* Sets the current position from a Point
|
|
272
|
+
*/
|
|
273
|
+
set_curr_point(point: Point): void;
|
|
274
|
+
/**
|
|
275
|
+
* Sets the old position
|
|
276
|
+
*/
|
|
277
|
+
set_old(x: number, y: number): void;
|
|
278
|
+
/**
|
|
279
|
+
* Sets the old position from a Point
|
|
280
|
+
*/
|
|
281
|
+
set_old_point(point: Point): void;
|
|
282
|
+
/**
|
|
283
|
+
* Returns the speed (magnitude of velocity)
|
|
284
|
+
*/
|
|
285
|
+
speed(): number;
|
|
286
|
+
/**
|
|
287
|
+
* Updates the position: stores current as old, then sets new current
|
|
288
|
+
*/
|
|
289
|
+
update(x: number, y: number): void;
|
|
290
|
+
/**
|
|
291
|
+
* Updates the position from a Point
|
|
292
|
+
*/
|
|
293
|
+
update_point(point: Point): void;
|
|
294
|
+
/**
|
|
295
|
+
* Returns the velocity (difference between current and old positions)
|
|
296
|
+
*/
|
|
297
|
+
velocity(): Point;
|
|
298
|
+
curr: Point;
|
|
299
|
+
old: Point;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export class Wire {
|
|
303
|
+
free(): void;
|
|
304
|
+
[Symbol.dispose](): void;
|
|
305
|
+
/**
|
|
306
|
+
* Checks collision with a point and adjusts nodes
|
|
307
|
+
*/
|
|
308
|
+
check_collision(point: Point, pointer_radius: number): void;
|
|
309
|
+
/**
|
|
310
|
+
* Checks collision with mouse/pointer position
|
|
311
|
+
*/
|
|
312
|
+
check_mouse_collision(mouse: Point, mouse_radius: number): void;
|
|
313
|
+
/**
|
|
314
|
+
* Checks for collisions between wire elements
|
|
315
|
+
*/
|
|
316
|
+
check_wire_elements_collisions(response_coef: number): void;
|
|
317
|
+
/**
|
|
318
|
+
* Gets the end point of the wire
|
|
319
|
+
*/
|
|
320
|
+
get_end(): Point;
|
|
321
|
+
/**
|
|
322
|
+
* Gets a specific node by index
|
|
323
|
+
*/
|
|
324
|
+
get_node(index: number): Node | undefined;
|
|
325
|
+
/**
|
|
326
|
+
* Gets the x coordinate of a node at the given index
|
|
327
|
+
*/
|
|
328
|
+
get_node_x(index: number): number;
|
|
329
|
+
/**
|
|
330
|
+
* Gets the y coordinate of a node at the given index
|
|
331
|
+
*/
|
|
332
|
+
get_node_y(index: number): number;
|
|
333
|
+
get_radius(): number;
|
|
334
|
+
/**
|
|
335
|
+
* Gets the render type (0 = segments, 1 = bezier)
|
|
336
|
+
*/
|
|
337
|
+
get_render_type(): number;
|
|
338
|
+
/**
|
|
339
|
+
* Gets the start point of the wire
|
|
340
|
+
*/
|
|
341
|
+
get_start(): Point;
|
|
342
|
+
/**
|
|
343
|
+
* Resets the iteration counter
|
|
344
|
+
*/
|
|
345
|
+
invalidate(): void;
|
|
346
|
+
/**
|
|
347
|
+
* Returns the length of the wire (sum of all segment distances)
|
|
348
|
+
*/
|
|
349
|
+
length(): number;
|
|
350
|
+
constructor();
|
|
351
|
+
/**
|
|
352
|
+
* Creates a wire between two points with specified radius
|
|
353
|
+
*/
|
|
354
|
+
static new_wire(xs: number, ys: number, xe: number, ye: number, radius: number): Wire;
|
|
355
|
+
/**
|
|
356
|
+
* Creates a wire with specific node count and link target distance
|
|
357
|
+
*/
|
|
358
|
+
static new_with_count(xs: number, ys: number, xe: number, ye: number, node_count: number, link_target: number, radius: number, render_type: number): Wire;
|
|
359
|
+
/**
|
|
360
|
+
* Returns the number of nodes in the wire
|
|
361
|
+
*/
|
|
362
|
+
node_count(): number;
|
|
363
|
+
static optimal_length(start: Point, end: Point, node_radius: number): number;
|
|
364
|
+
/**
|
|
365
|
+
* Sets the end point position (if it's fixed)
|
|
366
|
+
*/
|
|
367
|
+
set_end(x: number, y: number): void;
|
|
368
|
+
/**
|
|
369
|
+
* Sets the number of nodes in the wire
|
|
370
|
+
* Redistributes nodes evenly between start and end points
|
|
371
|
+
*/
|
|
372
|
+
set_node_count(new_count: number): void;
|
|
373
|
+
/**
|
|
374
|
+
* Sets the fixed state of a specific node
|
|
375
|
+
*/
|
|
376
|
+
set_node_fixed(node_idx: number, fixed: boolean): void;
|
|
377
|
+
/**
|
|
378
|
+
* Sets the radius of the wire
|
|
379
|
+
*/
|
|
380
|
+
set_radius(radius: number): void;
|
|
381
|
+
/**
|
|
382
|
+
* Sets the render type (0 = segments, 1 = bezier)
|
|
383
|
+
*/
|
|
384
|
+
set_render_type(render_type: number): void;
|
|
385
|
+
/**
|
|
386
|
+
* Sets the start point position (if it's fixed)
|
|
387
|
+
*/
|
|
388
|
+
set_start(x: number, y: number): void;
|
|
389
|
+
/**
|
|
390
|
+
* Updates the wire physics simulation
|
|
391
|
+
*/
|
|
392
|
+
update(dt: number, friction: number, acceleration: Point): void;
|
|
393
|
+
iterations: number;
|
|
394
|
+
link_target_distance: number;
|
|
395
|
+
radius: number;
|
|
396
|
+
render_type: number;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export class World {
|
|
400
|
+
free(): void;
|
|
401
|
+
[Symbol.dispose](): void;
|
|
402
|
+
/**
|
|
403
|
+
* Adds a wire between two points with specified radius
|
|
404
|
+
*/
|
|
405
|
+
add_wire(xs: number, ys: number, xe: number, ye: number, radius: number): void;
|
|
406
|
+
/**
|
|
407
|
+
* Adds a default wire to the world
|
|
408
|
+
*/
|
|
409
|
+
add_wire_debug(): void;
|
|
410
|
+
/**
|
|
411
|
+
* Adds a wire with specific node count and link target distance
|
|
412
|
+
*/
|
|
413
|
+
add_wire_with_count(xs: number, ys: number, xe: number, ye: number, node_count: number, link_target: number, radius: number, render_type: number): void;
|
|
414
|
+
/**
|
|
415
|
+
* Gets the acceleration vector
|
|
416
|
+
*/
|
|
417
|
+
get_acceleration(): Point;
|
|
418
|
+
/**
|
|
419
|
+
* Gets the friction coefficient
|
|
420
|
+
*/
|
|
421
|
+
get_friction(): number;
|
|
422
|
+
/**
|
|
423
|
+
* Gets the mouse interaction radius
|
|
424
|
+
*/
|
|
425
|
+
get_mouse_radius(): number;
|
|
426
|
+
/**
|
|
427
|
+
* Gets the pointer collision radius
|
|
428
|
+
*/
|
|
429
|
+
get_pointer_radius(): number;
|
|
430
|
+
/**
|
|
431
|
+
* Gets the collision response coefficient
|
|
432
|
+
*/
|
|
433
|
+
get_response_coef(): number;
|
|
434
|
+
/**
|
|
435
|
+
* Gets a specific wire by index
|
|
436
|
+
*/
|
|
437
|
+
get_wire(index: number): Wire | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* Gets a node from a specific wire
|
|
440
|
+
*/
|
|
441
|
+
get_wire_node(wire_idx: number, node_idx: number): Node | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* Gets the number of nodes in a specific wire
|
|
444
|
+
*/
|
|
445
|
+
get_wire_node_count(wire_idx: number): number;
|
|
446
|
+
/**
|
|
447
|
+
* Gets x coordinate of a node in a wire
|
|
448
|
+
*/
|
|
449
|
+
get_wire_node_x(wire_idx: number, node_idx: number): number;
|
|
450
|
+
/**
|
|
451
|
+
* Gets y coordinate of a node in a wire
|
|
452
|
+
*/
|
|
453
|
+
get_wire_node_y(wire_idx: number, node_idx: number): number;
|
|
454
|
+
get_wire_radius(wire_idx: number): number;
|
|
455
|
+
constructor();
|
|
456
|
+
/**
|
|
457
|
+
* Sets the acceleration vector
|
|
458
|
+
*/
|
|
459
|
+
set_acceleration(x: number, y: number): void;
|
|
460
|
+
/**
|
|
461
|
+
* Sets the friction coefficient
|
|
462
|
+
*/
|
|
463
|
+
set_friction(friction: number): void;
|
|
464
|
+
/**
|
|
465
|
+
* Sets the mouse position
|
|
466
|
+
*/
|
|
467
|
+
set_mouse(x: number, y: number): void;
|
|
468
|
+
/**
|
|
469
|
+
* Sets the mouse interaction radius
|
|
470
|
+
*/
|
|
471
|
+
set_mouse_radius(radius: number): void;
|
|
472
|
+
/**
|
|
473
|
+
* Sets the pointer collision radius
|
|
474
|
+
*/
|
|
475
|
+
set_pointer_radius(radius: number): void;
|
|
476
|
+
/**
|
|
477
|
+
* Sets the collision response coefficient
|
|
478
|
+
*/
|
|
479
|
+
set_response_coef(coef: number): void;
|
|
480
|
+
/**
|
|
481
|
+
* Sets the position of the last node (end) of a wire
|
|
482
|
+
*/
|
|
483
|
+
set_wire_end(wire_idx: number, x: number, y: number): void;
|
|
484
|
+
/**
|
|
485
|
+
* Sets the number of nodes in a specific wire
|
|
486
|
+
*/
|
|
487
|
+
set_wire_node_count(wire_idx: number, node_count: number): void;
|
|
488
|
+
/**
|
|
489
|
+
* Sets the fixed state of a specific node in a wire
|
|
490
|
+
*/
|
|
491
|
+
set_wire_node_fixed(wire_idx: number, node_idx: number, fixed: boolean): void;
|
|
492
|
+
/**
|
|
493
|
+
* Sets the position of the first node (start) of a wire
|
|
494
|
+
*/
|
|
495
|
+
set_wire_start(wire_idx: number, x: number, y: number): void;
|
|
496
|
+
/**
|
|
497
|
+
* Updates all wires in the world
|
|
498
|
+
*/
|
|
499
|
+
update(): void;
|
|
500
|
+
/**
|
|
501
|
+
* Returns the number of wires
|
|
502
|
+
*/
|
|
503
|
+
wire_count(): number;
|
|
504
|
+
/**
|
|
505
|
+
* Returns the length of the wire data buffer
|
|
506
|
+
*/
|
|
507
|
+
wire_data_len(): number;
|
|
508
|
+
/**
|
|
509
|
+
* Returns the pointer to the wire data buffer
|
|
510
|
+
* Buffer format per wire: [node_count, radius, render_type, path_length, ...path_data]
|
|
511
|
+
*/
|
|
512
|
+
wire_data_ptr(): number;
|
|
513
|
+
/**
|
|
514
|
+
* Calculates the default node count for a wire based on distance and link target
|
|
515
|
+
*/
|
|
516
|
+
static wire_optimal_length(start_x: number, start_y: number, end_x: number, end_y: number, radius: number): number;
|
|
517
|
+
}
|
|
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>;
|