@newkrok/nape-js 3.3.14 → 3.3.16
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/dist/index.cjs +10827 -12605
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +726 -174
- package/dist/index.d.ts +726 -174
- package/dist/index.js +10823 -12605
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,13 +25,13 @@ declare function getNape(): any;
|
|
|
25
25
|
*
|
|
26
26
|
* Converted from nape-compiled.js lines 83820–84273, 134996.
|
|
27
27
|
*/
|
|
28
|
-
type Any$
|
|
28
|
+
type Any$H = any;
|
|
29
29
|
declare class ZPP_Vec2 {
|
|
30
30
|
static zpp_pool: ZPP_Vec2 | null;
|
|
31
31
|
static __name__: string[];
|
|
32
|
-
static _nape: Any$
|
|
33
|
-
static _zpp: Any$
|
|
34
|
-
static _wrapFn: ((zpp: ZPP_Vec2) => Any$
|
|
32
|
+
static _nape: Any$H;
|
|
33
|
+
static _zpp: Any$H;
|
|
34
|
+
static _wrapFn: ((zpp: ZPP_Vec2) => Any$H) | null;
|
|
35
35
|
x: number;
|
|
36
36
|
y: number;
|
|
37
37
|
next: ZPP_Vec2 | null;
|
|
@@ -40,18 +40,18 @@ declare class ZPP_Vec2 {
|
|
|
40
40
|
pushmod: boolean;
|
|
41
41
|
_inuse: boolean;
|
|
42
42
|
weak: boolean;
|
|
43
|
-
outer: Any$
|
|
43
|
+
outer: Any$H;
|
|
44
44
|
_immutable: boolean;
|
|
45
45
|
_isimmutable: (() => void) | null;
|
|
46
46
|
_validate: (() => void) | null;
|
|
47
47
|
_invalidate: ((self: ZPP_Vec2) => void) | null;
|
|
48
|
-
__class__: Any$
|
|
48
|
+
__class__: Any$H;
|
|
49
49
|
/** Static factory with optional pooling and immutability. */
|
|
50
50
|
static get(x: number, y: number, immutable?: boolean): ZPP_Vec2;
|
|
51
51
|
validate(): void;
|
|
52
52
|
invalidate(): void;
|
|
53
53
|
immutable(): void;
|
|
54
|
-
wrapper(): Any$
|
|
54
|
+
wrapper(): Any$H;
|
|
55
55
|
free(): void;
|
|
56
56
|
alloc(): void;
|
|
57
57
|
elem(): ZPP_Vec2;
|
|
@@ -203,20 +203,20 @@ type NapeInner = any;
|
|
|
203
203
|
*
|
|
204
204
|
* Converted from nape-compiled.js lines 83412–83434.
|
|
205
205
|
*/
|
|
206
|
-
type Any$
|
|
206
|
+
type Any$G = any;
|
|
207
207
|
declare class ZPP_Vec3 {
|
|
208
208
|
static __name__: string[];
|
|
209
|
-
static _zpp: Any$
|
|
210
|
-
static _wrapFn: ((zpp: ZPP_Vec3) => Any$
|
|
211
|
-
outer: Any$
|
|
209
|
+
static _zpp: Any$G;
|
|
210
|
+
static _wrapFn: ((zpp: ZPP_Vec3) => Any$G) | null;
|
|
211
|
+
outer: Any$G;
|
|
212
212
|
x: number;
|
|
213
213
|
y: number;
|
|
214
214
|
z: number;
|
|
215
215
|
immutable: boolean;
|
|
216
216
|
_validate: (() => void) | null;
|
|
217
|
-
__class__: Any$
|
|
217
|
+
__class__: Any$G;
|
|
218
218
|
validate(): void;
|
|
219
|
-
wrapper(): Any$
|
|
219
|
+
wrapper(): Any$G;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/**
|
|
@@ -280,13 +280,13 @@ declare class Vec3 {
|
|
|
280
280
|
*
|
|
281
281
|
* Converted from nape-compiled.js lines 73495–73561, 133826.
|
|
282
282
|
*/
|
|
283
|
-
type Any$
|
|
283
|
+
type Any$F = any;
|
|
284
284
|
declare class ZPP_Mat23 {
|
|
285
285
|
static __name__: string[];
|
|
286
|
-
static _nape: Any$
|
|
287
|
-
static _wrapFn: ((zpp: ZPP_Mat23) => Any$
|
|
286
|
+
static _nape: Any$F;
|
|
287
|
+
static _wrapFn: ((zpp: ZPP_Mat23) => Any$F) | null;
|
|
288
288
|
static zpp_pool: ZPP_Mat23 | null;
|
|
289
|
-
outer: Any$
|
|
289
|
+
outer: Any$F;
|
|
290
290
|
a: number;
|
|
291
291
|
b: number;
|
|
292
292
|
c: number;
|
|
@@ -295,13 +295,13 @@ declare class ZPP_Mat23 {
|
|
|
295
295
|
ty: number;
|
|
296
296
|
_invalidate: (() => void) | null;
|
|
297
297
|
next: ZPP_Mat23 | null;
|
|
298
|
-
__class__: Any$
|
|
298
|
+
__class__: Any$F;
|
|
299
299
|
/** Static factory with pooling. */
|
|
300
300
|
static get(): ZPP_Mat23;
|
|
301
301
|
/** Create an identity matrix from pool. */
|
|
302
302
|
static identity(): ZPP_Mat23;
|
|
303
303
|
/** Create a public wrapper, recycling any existing inner. */
|
|
304
|
-
wrapper(): Any$
|
|
304
|
+
wrapper(): Any$F;
|
|
305
305
|
invalidate(): void;
|
|
306
306
|
set(m: ZPP_Mat23): void;
|
|
307
307
|
setas(a: number, b: number, c: number, d: number, tx: number, ty: number): void;
|
|
@@ -362,13 +362,13 @@ declare class Mat23 {
|
|
|
362
362
|
*
|
|
363
363
|
* Converted from nape-compiled.js lines 69554–69563.
|
|
364
364
|
*/
|
|
365
|
-
type Any$
|
|
365
|
+
type Any$E = any;
|
|
366
366
|
declare class ZPP_GeomPoly {
|
|
367
367
|
static __name__: string[];
|
|
368
|
-
outer: Any$
|
|
369
|
-
vertices: Any$
|
|
370
|
-
__class__: Any$
|
|
371
|
-
constructor(outer?: Any$
|
|
368
|
+
outer: Any$E;
|
|
369
|
+
vertices: Any$E;
|
|
370
|
+
__class__: Any$E;
|
|
371
|
+
constructor(outer?: Any$E);
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
/**
|
|
@@ -392,7 +392,7 @@ declare class Winding {
|
|
|
392
392
|
toString(): string;
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
-
type Any$
|
|
395
|
+
type Any$D = any;
|
|
396
396
|
/**
|
|
397
397
|
* A polygon represented as a circular doubly-linked list of vertices.
|
|
398
398
|
*
|
|
@@ -407,8 +407,8 @@ declare class GeomPoly {
|
|
|
407
407
|
zpp_inner: ZPP_GeomPoly;
|
|
408
408
|
zpp_pool: GeomPoly | null;
|
|
409
409
|
zpp_disp: boolean;
|
|
410
|
-
get _inner(): Any$
|
|
411
|
-
constructor(vertices?: Any$
|
|
410
|
+
get _inner(): Any$D;
|
|
411
|
+
constructor(vertices?: Any$D);
|
|
412
412
|
private _checkDisposed;
|
|
413
413
|
/** @internal Get compiled ZPP_GeomVert class */
|
|
414
414
|
private static _gvClass;
|
|
@@ -434,12 +434,12 @@ declare class GeomPoly {
|
|
|
434
434
|
private static _addVertices;
|
|
435
435
|
/** @internal After copying, dispose weak Vec2 inputs */
|
|
436
436
|
private static _disposeWeakInputs;
|
|
437
|
-
static get(vertices?: Any$
|
|
437
|
+
static get(vertices?: Any$D): GeomPoly;
|
|
438
438
|
empty(): boolean;
|
|
439
439
|
size(): number;
|
|
440
|
-
iterator(): Any$
|
|
441
|
-
forwardIterator(): Any$
|
|
442
|
-
backwardsIterator(): Any$
|
|
440
|
+
iterator(): Any$D;
|
|
441
|
+
forwardIterator(): Any$D;
|
|
442
|
+
backwardsIterator(): Any$D;
|
|
443
443
|
current(): Vec2;
|
|
444
444
|
push(vertex: Vec2): this;
|
|
445
445
|
pop(): this;
|
|
@@ -452,7 +452,7 @@ declare class GeomPoly {
|
|
|
452
452
|
copy(): GeomPoly;
|
|
453
453
|
dispose(): void;
|
|
454
454
|
area(): number;
|
|
455
|
-
winding(): Any$
|
|
455
|
+
winding(): Any$D;
|
|
456
456
|
contains(point: Vec2): boolean;
|
|
457
457
|
isClockwise(): boolean;
|
|
458
458
|
isConvex(): boolean;
|
|
@@ -460,14 +460,14 @@ declare class GeomPoly {
|
|
|
460
460
|
isMonotone(): boolean;
|
|
461
461
|
isDegenerate(): boolean;
|
|
462
462
|
simplify(epsilon: number): GeomPoly;
|
|
463
|
-
simpleDecomposition(output?: Any$
|
|
464
|
-
monotoneDecomposition(output?: Any$
|
|
465
|
-
convexDecomposition(delaunay?: boolean, output?: Any$
|
|
466
|
-
triangularDecomposition(delaunay?: boolean, output?: Any$
|
|
463
|
+
simpleDecomposition(output?: Any$D): Any$D;
|
|
464
|
+
monotoneDecomposition(output?: Any$D): Any$D;
|
|
465
|
+
convexDecomposition(delaunay?: boolean, output?: Any$D): Any$D;
|
|
466
|
+
triangularDecomposition(delaunay?: boolean, output?: Any$D): Any$D;
|
|
467
467
|
inflate(inflation: number): GeomPoly;
|
|
468
|
-
cut(start: Vec2, end: Vec2, boundedStart?: boolean, boundedEnd?: boolean, output?: Any$
|
|
469
|
-
transform(matrix: Any$
|
|
470
|
-
bounds(): Any$
|
|
468
|
+
cut(start: Vec2, end: Vec2, boundedStart?: boolean, boundedEnd?: boolean, output?: Any$D): Any$D;
|
|
469
|
+
transform(matrix: Any$D): this;
|
|
470
|
+
bounds(): Any$D;
|
|
471
471
|
top(): Vec2;
|
|
472
472
|
bottom(): Vec2;
|
|
473
473
|
left(): Vec2;
|
|
@@ -483,30 +483,30 @@ declare class GeomPoly {
|
|
|
483
483
|
*
|
|
484
484
|
* Converted from nape-compiled.js lines 63546–63965, 134951.
|
|
485
485
|
*/
|
|
486
|
-
type Any$
|
|
486
|
+
type Any$C = any;
|
|
487
487
|
declare class ZPP_AABB {
|
|
488
488
|
static zpp_pool: ZPP_AABB | null;
|
|
489
489
|
static __name__: string[];
|
|
490
|
-
static _nape: Any$
|
|
491
|
-
static _zpp: Any$
|
|
492
|
-
static _wrapFn: ((zpp: ZPP_AABB) => Any$
|
|
490
|
+
static _nape: Any$C;
|
|
491
|
+
static _zpp: Any$C;
|
|
492
|
+
static _wrapFn: ((zpp: ZPP_AABB) => Any$C) | null;
|
|
493
493
|
_invalidate: ((self: ZPP_AABB) => void) | null;
|
|
494
494
|
_validate: (() => void) | null;
|
|
495
495
|
_immutable: boolean;
|
|
496
|
-
outer: Any$
|
|
496
|
+
outer: Any$C;
|
|
497
497
|
next: ZPP_AABB | null;
|
|
498
498
|
minx: number;
|
|
499
499
|
miny: number;
|
|
500
500
|
maxx: number;
|
|
501
501
|
maxy: number;
|
|
502
|
-
wrap_min: Any$
|
|
503
|
-
wrap_max: Any$
|
|
504
|
-
__class__: Any$
|
|
502
|
+
wrap_min: Any$C;
|
|
503
|
+
wrap_max: Any$C;
|
|
504
|
+
__class__: Any$C;
|
|
505
505
|
/** Static factory with pooling. */
|
|
506
506
|
static get(minx: number, miny: number, maxx: number, maxy: number): ZPP_AABB;
|
|
507
507
|
validate(): void;
|
|
508
508
|
invalidate(): void;
|
|
509
|
-
wrapper(): Any$
|
|
509
|
+
wrapper(): Any$C;
|
|
510
510
|
alloc(): void;
|
|
511
511
|
free(): void;
|
|
512
512
|
copy(): ZPP_AABB;
|
|
@@ -517,10 +517,10 @@ declare class ZPP_AABB {
|
|
|
517
517
|
private static _makeVec2Wrapper;
|
|
518
518
|
getmin(): void;
|
|
519
519
|
dom_min(): void;
|
|
520
|
-
mod_min(min: Any$
|
|
520
|
+
mod_min(min: Any$C): void;
|
|
521
521
|
getmax(): void;
|
|
522
522
|
dom_max(): void;
|
|
523
|
-
mod_max(max: Any$
|
|
523
|
+
mod_max(max: Any$C): void;
|
|
524
524
|
intersectX(x: ZPP_AABB): boolean;
|
|
525
525
|
intersectY(x: ZPP_AABB): boolean;
|
|
526
526
|
intersect(x: ZPP_AABB): boolean;
|
|
@@ -584,18 +584,18 @@ declare class AABB {
|
|
|
584
584
|
*
|
|
585
585
|
* Converted from nape-compiled.js lines 72949–72972.
|
|
586
586
|
*/
|
|
587
|
-
type Any$
|
|
587
|
+
type Any$B = any;
|
|
588
588
|
declare class ZPP_MatMN {
|
|
589
589
|
static __name__: string[];
|
|
590
|
-
outer: Any$
|
|
590
|
+
outer: Any$B;
|
|
591
591
|
m: number;
|
|
592
592
|
n: number;
|
|
593
593
|
x: number[];
|
|
594
|
-
__class__: Any$
|
|
594
|
+
__class__: Any$B;
|
|
595
595
|
constructor(m: number, n: number);
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
-
type Any$
|
|
598
|
+
type Any$A = any;
|
|
599
599
|
/**
|
|
600
600
|
* Variable-sized M×N matrix.
|
|
601
601
|
*
|
|
@@ -606,7 +606,7 @@ declare class MatMN {
|
|
|
606
606
|
zpp_inner: ZPP_MatMN;
|
|
607
607
|
get _inner(): NapeInner;
|
|
608
608
|
constructor(rows: number, cols: number);
|
|
609
|
-
static _wrap(inner: Any$
|
|
609
|
+
static _wrap(inner: Any$A): MatMN;
|
|
610
610
|
get rows(): number;
|
|
611
611
|
get cols(): number;
|
|
612
612
|
x(row: number, col: number): number;
|
|
@@ -616,7 +616,7 @@ declare class MatMN {
|
|
|
616
616
|
mul(matrix: MatMN): MatMN;
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
-
type Any$
|
|
619
|
+
type Any$z = any;
|
|
620
620
|
/**
|
|
621
621
|
* Isosurface extraction using the marching squares algorithm.
|
|
622
622
|
*
|
|
@@ -639,7 +639,7 @@ declare class MarchingSquares {
|
|
|
639
639
|
* @param output - Optional GeomPolyList to populate. If null, a new one is created.
|
|
640
640
|
* @returns The populated GeomPolyList.
|
|
641
641
|
*/
|
|
642
|
-
static run(iso: (x: number, y: number) => number, bounds: AABB, cellsize: Vec2, quality?: number, subgrid?: Vec2 | null, combine?: boolean, output?: Any$
|
|
642
|
+
static run(iso: (x: number, y: number) => number, bounds: AABB, cellsize: Vec2, quality?: number, subgrid?: Vec2 | null, combine?: boolean, output?: Any$z): Any$z;
|
|
643
643
|
}
|
|
644
644
|
|
|
645
645
|
/**
|
|
@@ -675,31 +675,31 @@ declare class Ray {
|
|
|
675
675
|
*
|
|
676
676
|
* Converted from nape-compiled.js lines 38897–39076, 86860–86862.
|
|
677
677
|
*/
|
|
678
|
-
type Any$
|
|
678
|
+
type Any$y = any;
|
|
679
679
|
declare class ZPP_ConvexRayResult {
|
|
680
680
|
static __name__: string[];
|
|
681
681
|
static rayPool: ZPP_ConvexRayResult | null;
|
|
682
682
|
static convexPool: ZPP_ConvexRayResult | null;
|
|
683
683
|
static internal: boolean;
|
|
684
|
-
static _createRayResult: (() => Any$
|
|
685
|
-
static _createConvexResult: (() => Any$
|
|
686
|
-
normal: Any$
|
|
687
|
-
shape: Any$
|
|
688
|
-
convex: Any$
|
|
689
|
-
position: Any$
|
|
690
|
-
ray: Any$
|
|
684
|
+
static _createRayResult: (() => Any$y) | null;
|
|
685
|
+
static _createConvexResult: (() => Any$y) | null;
|
|
686
|
+
normal: Any$y;
|
|
687
|
+
shape: Any$y;
|
|
688
|
+
convex: Any$y;
|
|
689
|
+
position: Any$y;
|
|
690
|
+
ray: Any$y;
|
|
691
691
|
inner: boolean;
|
|
692
692
|
next: ZPP_ConvexRayResult | null;
|
|
693
693
|
toiDistance: number;
|
|
694
|
-
__class__: Any$
|
|
695
|
-
static getRay(normal: Any$
|
|
696
|
-
static getConvex(normal: Any$
|
|
694
|
+
__class__: Any$y;
|
|
695
|
+
static getRay(normal: Any$y, time: number, inner: boolean, shape: Any$y): Any$y;
|
|
696
|
+
static getConvex(normal: Any$y, position: Any$y, toiDistance: number, shape: Any$y): Any$y;
|
|
697
697
|
disposed(): void;
|
|
698
698
|
free(): void;
|
|
699
699
|
private static _disposeVec2;
|
|
700
700
|
}
|
|
701
701
|
|
|
702
|
-
type Any$
|
|
702
|
+
type Any$x = any;
|
|
703
703
|
/**
|
|
704
704
|
* Result from a convex-cast query.
|
|
705
705
|
*
|
|
@@ -714,18 +714,18 @@ declare class ConvexResult {
|
|
|
714
714
|
get _inner(): NapeInner;
|
|
715
715
|
constructor();
|
|
716
716
|
/** @internal */
|
|
717
|
-
static _wrap(inner: Any$
|
|
717
|
+
static _wrap(inner: Any$x): ConvexResult;
|
|
718
718
|
get normal(): Vec2;
|
|
719
719
|
get position(): Vec2;
|
|
720
720
|
get toi(): number;
|
|
721
|
-
get shape(): Any$
|
|
721
|
+
get shape(): Any$x;
|
|
722
722
|
dispose(): void;
|
|
723
723
|
toString(): string;
|
|
724
724
|
/** @internal */
|
|
725
725
|
private _disposed;
|
|
726
726
|
}
|
|
727
727
|
|
|
728
|
-
type Any$
|
|
728
|
+
type Any$w = any;
|
|
729
729
|
/**
|
|
730
730
|
* Result from a raycast query.
|
|
731
731
|
*
|
|
@@ -740,17 +740,68 @@ declare class RayResult {
|
|
|
740
740
|
get _inner(): NapeInner;
|
|
741
741
|
constructor();
|
|
742
742
|
/** @internal */
|
|
743
|
-
static _wrap(inner: Any$
|
|
743
|
+
static _wrap(inner: Any$w): RayResult;
|
|
744
744
|
get normal(): Vec2;
|
|
745
745
|
get distance(): number;
|
|
746
746
|
get inner(): boolean;
|
|
747
|
-
get shape(): Any$
|
|
747
|
+
get shape(): Any$w;
|
|
748
748
|
dispose(): void;
|
|
749
749
|
toString(): string;
|
|
750
750
|
/** @internal */
|
|
751
751
|
private _disposed;
|
|
752
752
|
}
|
|
753
753
|
|
|
754
|
+
type Any$v = any;
|
|
755
|
+
/**
|
|
756
|
+
* Static utility class for geometric queries between shapes and bodies.
|
|
757
|
+
*
|
|
758
|
+
* All methods are static. This class cannot be instantiated.
|
|
759
|
+
*
|
|
760
|
+
* Thin wrapper — delegates to compiled nape.geom.Geom methods.
|
|
761
|
+
*/
|
|
762
|
+
declare class Geom {
|
|
763
|
+
static __name__: string[];
|
|
764
|
+
/**
|
|
765
|
+
* Calculate minimum distance between two bodies and return closest points.
|
|
766
|
+
* @param body1 - First body (must have shapes).
|
|
767
|
+
* @param body2 - Second body (must have shapes).
|
|
768
|
+
* @param out1 - Output Vec2 for closest point on body1.
|
|
769
|
+
* @param out2 - Output Vec2 for closest point on body2.
|
|
770
|
+
* @returns The distance between the two bodies.
|
|
771
|
+
*/
|
|
772
|
+
static distanceBody(body1: Any$v, body2: Any$v, out1: Vec2, out2: Vec2): number;
|
|
773
|
+
/**
|
|
774
|
+
* Calculate minimum distance between two shapes and return closest points.
|
|
775
|
+
* @param shape1 - First shape (must be part of a body).
|
|
776
|
+
* @param shape2 - Second shape (must be part of a body).
|
|
777
|
+
* @param out1 - Output Vec2 for closest point on shape1.
|
|
778
|
+
* @param out2 - Output Vec2 for closest point on shape2.
|
|
779
|
+
* @returns The distance between the two shapes.
|
|
780
|
+
*/
|
|
781
|
+
static distance(shape1: Any$v, shape2: Any$v, out1: Vec2, out2: Vec2): number;
|
|
782
|
+
/**
|
|
783
|
+
* Test if two bodies intersect (any of their shapes overlap).
|
|
784
|
+
* @param body1 - First body (must have shapes).
|
|
785
|
+
* @param body2 - Second body (must have shapes).
|
|
786
|
+
* @returns True if the bodies intersect.
|
|
787
|
+
*/
|
|
788
|
+
static intersectsBody(body1: Any$v, body2: Any$v): boolean;
|
|
789
|
+
/**
|
|
790
|
+
* Test if two shapes intersect.
|
|
791
|
+
* @param shape1 - First shape (must be part of a body).
|
|
792
|
+
* @param shape2 - Second shape (must be part of a body).
|
|
793
|
+
* @returns True if the shapes intersect.
|
|
794
|
+
*/
|
|
795
|
+
static intersects(shape1: Any$v, shape2: Any$v): boolean;
|
|
796
|
+
/**
|
|
797
|
+
* Test if shape1 fully contains shape2.
|
|
798
|
+
* @param shape1 - Containing shape (must be part of a body).
|
|
799
|
+
* @param shape2 - Contained shape (must be part of a body).
|
|
800
|
+
* @returns True if shape1 contains shape2.
|
|
801
|
+
*/
|
|
802
|
+
static contains(shape1: Any$v, shape2: Any$v): boolean;
|
|
803
|
+
}
|
|
804
|
+
|
|
754
805
|
/**
|
|
755
806
|
* Generic typed wrapper around Haxe list objects (BodyList, ShapeList, etc.).
|
|
756
807
|
*
|
|
@@ -769,15 +820,15 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
769
820
|
at(index: number): T;
|
|
770
821
|
/** Add an element to the list. */
|
|
771
822
|
add(item: T & {
|
|
772
|
-
_inner
|
|
823
|
+
_inner?: NapeInner;
|
|
773
824
|
}): void;
|
|
774
825
|
/** Remove an element from the list. */
|
|
775
826
|
remove(item: T & {
|
|
776
|
-
_inner
|
|
827
|
+
_inner?: NapeInner;
|
|
777
828
|
}): void;
|
|
778
829
|
/** Check if the list contains an element. */
|
|
779
830
|
has(item: T & {
|
|
780
|
-
_inner
|
|
831
|
+
_inner?: NapeInner;
|
|
781
832
|
}): boolean;
|
|
782
833
|
/** Remove all elements. */
|
|
783
834
|
clear(): void;
|
|
@@ -785,7 +836,7 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
785
836
|
get empty(): boolean;
|
|
786
837
|
/** Push an element to the end. */
|
|
787
838
|
push(item: T & {
|
|
788
|
-
_inner
|
|
839
|
+
_inner?: NapeInner;
|
|
789
840
|
}): void;
|
|
790
841
|
/** Pop the last element. */
|
|
791
842
|
pop(): T;
|
|
@@ -793,7 +844,7 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
793
844
|
shift(): T;
|
|
794
845
|
/** Unshift an element to the front. */
|
|
795
846
|
unshift(item: T & {
|
|
796
|
-
_inner
|
|
847
|
+
_inner?: NapeInner;
|
|
797
848
|
}): void;
|
|
798
849
|
/** Iterate over all elements. */
|
|
799
850
|
[Symbol.iterator](): Iterator<T>;
|
|
@@ -812,7 +863,7 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
812
863
|
*
|
|
813
864
|
* Converted from nape-compiled.js lines 87523–87601, 135477–135481.
|
|
814
865
|
*/
|
|
815
|
-
type Any$
|
|
866
|
+
type Any$u = any;
|
|
816
867
|
declare class ZPP_Material {
|
|
817
868
|
static zpp_pool: ZPP_Material | null;
|
|
818
869
|
static WAKE: number;
|
|
@@ -825,27 +876,27 @@ declare class ZPP_Material {
|
|
|
825
876
|
* _nape = the `nape` public namespace (for wrapper creation)
|
|
826
877
|
* _zpp = the `zpp_nape` internal namespace (for ZNPList_ZPP_Shape)
|
|
827
878
|
*/
|
|
828
|
-
static _nape: Any$
|
|
829
|
-
static _zpp: Any$
|
|
879
|
+
static _nape: Any$u;
|
|
880
|
+
static _zpp: Any$u;
|
|
830
881
|
/**
|
|
831
882
|
* Wrapper factory callback, registered by the modernized Material class.
|
|
832
883
|
* When set, wrapper() uses this instead of creating a compiled Material.
|
|
833
884
|
*/
|
|
834
|
-
static _wrapFn: ((zpp: ZPP_Material) => Any$
|
|
885
|
+
static _wrapFn: ((zpp: ZPP_Material) => Any$u) | null;
|
|
835
886
|
elasticity: number;
|
|
836
887
|
dynamicFriction: number;
|
|
837
888
|
staticFriction: number;
|
|
838
889
|
density: number;
|
|
839
890
|
rollingFriction: number;
|
|
840
|
-
shapes: Any$
|
|
841
|
-
wrap_shapes: Any$
|
|
842
|
-
outer: Any$
|
|
843
|
-
userData: Any$
|
|
891
|
+
shapes: Any$u;
|
|
892
|
+
wrap_shapes: Any$u;
|
|
893
|
+
outer: Any$u;
|
|
894
|
+
userData: Any$u;
|
|
844
895
|
next: ZPP_Material | null;
|
|
845
|
-
__class__: Any$
|
|
896
|
+
__class__: Any$u;
|
|
846
897
|
constructor();
|
|
847
898
|
/** Create/return the public nape.phys.Material wrapper for this internal object. */
|
|
848
|
-
wrapper(): Any$
|
|
899
|
+
wrapper(): Any$u;
|
|
849
900
|
/** Called when this object is returned to the pool. */
|
|
850
901
|
free(): void;
|
|
851
902
|
/** Called when this object is taken from the pool. */
|
|
@@ -853,9 +904,9 @@ declare class ZPP_Material {
|
|
|
853
904
|
/** Initialize the shapes list (called during feature construction). */
|
|
854
905
|
feature_cons(): void;
|
|
855
906
|
/** Register a shape that uses this material. */
|
|
856
|
-
addShape(shape: Any$
|
|
907
|
+
addShape(shape: Any$u): void;
|
|
857
908
|
/** Unregister a shape that no longer uses this material. */
|
|
858
|
-
remShape(shape: Any$
|
|
909
|
+
remShape(shape: Any$u): void;
|
|
859
910
|
/** Create a copy with the same property values. */
|
|
860
911
|
copy(): ZPP_Material;
|
|
861
912
|
/** Copy all property values from another ZPP_Material. */
|
|
@@ -915,36 +966,36 @@ declare class Material {
|
|
|
915
966
|
*
|
|
916
967
|
* Converted from nape-compiled.js lines 87335–87523, 135403.
|
|
917
968
|
*/
|
|
918
|
-
type Any$
|
|
969
|
+
type Any$t = any;
|
|
919
970
|
declare class ZPP_FluidProperties {
|
|
920
971
|
static zpp_pool: ZPP_FluidProperties | null;
|
|
921
972
|
static __name__: string[];
|
|
922
|
-
static _nape: Any$
|
|
923
|
-
static _zpp: Any$
|
|
924
|
-
static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$
|
|
973
|
+
static _nape: Any$t;
|
|
974
|
+
static _zpp: Any$t;
|
|
975
|
+
static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$t) | null;
|
|
925
976
|
viscosity: number;
|
|
926
977
|
density: number;
|
|
927
978
|
gravityx: number;
|
|
928
979
|
gravityy: number;
|
|
929
|
-
wrap_gravity: Any$
|
|
930
|
-
shapes: Any$
|
|
931
|
-
wrap_shapes: Any$
|
|
932
|
-
outer: Any$
|
|
933
|
-
userData: Any$
|
|
980
|
+
wrap_gravity: Any$t;
|
|
981
|
+
shapes: Any$t;
|
|
982
|
+
wrap_shapes: Any$t;
|
|
983
|
+
outer: Any$t;
|
|
984
|
+
userData: Any$t;
|
|
934
985
|
next: ZPP_FluidProperties | null;
|
|
935
|
-
__class__: Any$
|
|
986
|
+
__class__: Any$t;
|
|
936
987
|
constructor();
|
|
937
988
|
/** Create/return the public nape.phys.FluidProperties wrapper. */
|
|
938
|
-
wrapper(): Any$
|
|
989
|
+
wrapper(): Any$t;
|
|
939
990
|
free(): void;
|
|
940
991
|
alloc(): void;
|
|
941
992
|
feature_cons(): void;
|
|
942
|
-
addShape(shape: Any$
|
|
943
|
-
remShape(shape: Any$
|
|
993
|
+
addShape(shape: Any$t): void;
|
|
994
|
+
remShape(shape: Any$t): void;
|
|
944
995
|
/** Copy with object pooling. */
|
|
945
996
|
copy(): ZPP_FluidProperties;
|
|
946
997
|
/** Called when gravity Vec2 wrapper is invalidated (user set new gravity). */
|
|
947
|
-
gravity_invalidate(x: Any$
|
|
998
|
+
gravity_invalidate(x: Any$t): void;
|
|
948
999
|
/** Sync the gravity Vec2 wrapper with internal values. */
|
|
949
1000
|
gravity_validate(): void;
|
|
950
1001
|
/** Lazily create and return the gravity Vec2 wrapper. */
|
|
@@ -995,33 +1046,33 @@ declare class FluidProperties {
|
|
|
995
1046
|
*
|
|
996
1047
|
* Converted from nape-compiled.js lines 63255–63366, 135329.
|
|
997
1048
|
*/
|
|
998
|
-
type Any$
|
|
1049
|
+
type Any$s = any;
|
|
999
1050
|
declare class ZPP_InteractionFilter {
|
|
1000
1051
|
static zpp_pool: ZPP_InteractionFilter | null;
|
|
1001
1052
|
static __name__: string[];
|
|
1002
|
-
static _nape: Any$
|
|
1003
|
-
static _zpp: Any$
|
|
1004
|
-
static _wrapFn: ((zpp: ZPP_InteractionFilter) => Any$
|
|
1053
|
+
static _nape: Any$s;
|
|
1054
|
+
static _zpp: Any$s;
|
|
1055
|
+
static _wrapFn: ((zpp: ZPP_InteractionFilter) => Any$s) | null;
|
|
1005
1056
|
collisionGroup: number;
|
|
1006
1057
|
collisionMask: number;
|
|
1007
1058
|
sensorGroup: number;
|
|
1008
1059
|
sensorMask: number;
|
|
1009
1060
|
fluidGroup: number;
|
|
1010
1061
|
fluidMask: number;
|
|
1011
|
-
shapes: Any$
|
|
1012
|
-
wrap_shapes: Any$
|
|
1013
|
-
outer: Any$
|
|
1014
|
-
userData: Any$
|
|
1062
|
+
shapes: Any$s;
|
|
1063
|
+
wrap_shapes: Any$s;
|
|
1064
|
+
outer: Any$s;
|
|
1065
|
+
userData: Any$s;
|
|
1015
1066
|
next: ZPP_InteractionFilter | null;
|
|
1016
|
-
__class__: Any$
|
|
1067
|
+
__class__: Any$s;
|
|
1017
1068
|
constructor();
|
|
1018
1069
|
/** Create/return the public nape.dynamics.InteractionFilter wrapper. */
|
|
1019
|
-
wrapper(): Any$
|
|
1070
|
+
wrapper(): Any$s;
|
|
1020
1071
|
free(): void;
|
|
1021
1072
|
alloc(): void;
|
|
1022
1073
|
feature_cons(): void;
|
|
1023
|
-
addShape(shape: Any$
|
|
1024
|
-
remShape(shape: Any$
|
|
1074
|
+
addShape(shape: Any$s): void;
|
|
1075
|
+
remShape(shape: Any$s): void;
|
|
1025
1076
|
/** Create a copy with object pooling. */
|
|
1026
1077
|
copy(): ZPP_InteractionFilter;
|
|
1027
1078
|
/** Test whether two filters allow collision between their shapes. */
|
|
@@ -1085,22 +1136,22 @@ declare class InteractionFilter {
|
|
|
1085
1136
|
*
|
|
1086
1137
|
* Converted from nape-compiled.js lines 63367–63463, 135330–135331.
|
|
1087
1138
|
*/
|
|
1088
|
-
type Any$
|
|
1139
|
+
type Any$r = any;
|
|
1089
1140
|
declare class ZPP_InteractionGroup {
|
|
1090
1141
|
static SHAPE: number;
|
|
1091
1142
|
static BODY: number;
|
|
1092
1143
|
static __name__: string[];
|
|
1093
|
-
static _zpp: Any$
|
|
1094
|
-
static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$
|
|
1095
|
-
outer: Any$
|
|
1144
|
+
static _zpp: Any$r;
|
|
1145
|
+
static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$r) | null;
|
|
1146
|
+
outer: Any$r;
|
|
1096
1147
|
ignore: boolean;
|
|
1097
1148
|
group: ZPP_InteractionGroup | null;
|
|
1098
|
-
groups: Any$
|
|
1099
|
-
wrap_groups: Any$
|
|
1100
|
-
interactors: Any$
|
|
1101
|
-
wrap_interactors: Any$
|
|
1149
|
+
groups: Any$r;
|
|
1150
|
+
wrap_groups: Any$r;
|
|
1151
|
+
interactors: Any$r;
|
|
1152
|
+
wrap_interactors: Any$r;
|
|
1102
1153
|
depth: number;
|
|
1103
|
-
__class__: Any$
|
|
1154
|
+
__class__: Any$r;
|
|
1104
1155
|
constructor();
|
|
1105
1156
|
/** Set or change the parent group. */
|
|
1106
1157
|
setGroup(group: ZPP_InteractionGroup | null): void;
|
|
@@ -1111,9 +1162,9 @@ declare class ZPP_InteractionGroup {
|
|
|
1111
1162
|
/** Remove a child group. */
|
|
1112
1163
|
remGroup(group: ZPP_InteractionGroup): void;
|
|
1113
1164
|
/** Register an interactor in this group. */
|
|
1114
|
-
addInteractor(intx: Any$
|
|
1165
|
+
addInteractor(intx: Any$r): void;
|
|
1115
1166
|
/** Unregister an interactor from this group. */
|
|
1116
|
-
remInteractor(intx: Any$
|
|
1167
|
+
remInteractor(intx: Any$r, flag?: number): void;
|
|
1117
1168
|
}
|
|
1118
1169
|
|
|
1119
1170
|
/**
|
|
@@ -1320,24 +1371,24 @@ declare class Constraint {
|
|
|
1320
1371
|
*
|
|
1321
1372
|
* Converted from nape-compiled.js lines 27259–27304, 112053–112139.
|
|
1322
1373
|
*/
|
|
1323
|
-
type Any$
|
|
1374
|
+
type Any$q = any;
|
|
1324
1375
|
declare class ZPP_Listener {
|
|
1325
1376
|
static __name__: string[];
|
|
1326
|
-
static _nape: Any$
|
|
1327
|
-
static _zpp: Any$
|
|
1377
|
+
static _nape: Any$q;
|
|
1378
|
+
static _zpp: Any$q;
|
|
1328
1379
|
static internal: boolean;
|
|
1329
|
-
static types: Any$
|
|
1330
|
-
static events: Any$
|
|
1331
|
-
space: Any$
|
|
1332
|
-
interaction: Any$
|
|
1333
|
-
constraint: Any$
|
|
1334
|
-
body: Any$
|
|
1380
|
+
static types: Any$q[];
|
|
1381
|
+
static events: Any$q[];
|
|
1382
|
+
space: Any$q;
|
|
1383
|
+
interaction: Any$q;
|
|
1384
|
+
constraint: Any$q;
|
|
1385
|
+
body: Any$q;
|
|
1335
1386
|
precedence: number;
|
|
1336
1387
|
event: number;
|
|
1337
1388
|
type: number;
|
|
1338
1389
|
id: number;
|
|
1339
|
-
outer: Any$
|
|
1340
|
-
__class__: Any$
|
|
1390
|
+
outer: Any$q;
|
|
1391
|
+
__class__: Any$q;
|
|
1341
1392
|
constructor();
|
|
1342
1393
|
/** Sort comparator: higher precedence first, then by id descending. */
|
|
1343
1394
|
static setlt(a: ZPP_Listener, b: ZPP_Listener): boolean;
|
|
@@ -1413,20 +1464,20 @@ declare class ListenerType {
|
|
|
1413
1464
|
* Fully modernized from nape-compiled.js lines 231–433.
|
|
1414
1465
|
*/
|
|
1415
1466
|
|
|
1416
|
-
type Any$
|
|
1467
|
+
type Any$p = any;
|
|
1417
1468
|
declare class Listener {
|
|
1418
1469
|
static __name__: string[];
|
|
1419
1470
|
zpp_inner: ZPP_Listener;
|
|
1420
|
-
get _inner(): Any$
|
|
1471
|
+
get _inner(): Any$p;
|
|
1421
1472
|
constructor();
|
|
1422
|
-
static _wrap(inner: Any$
|
|
1473
|
+
static _wrap(inner: Any$p): Listener;
|
|
1423
1474
|
get type(): ListenerType;
|
|
1424
1475
|
get event(): CbEvent;
|
|
1425
1476
|
set event(event: CbEvent);
|
|
1426
1477
|
get precedence(): number;
|
|
1427
1478
|
set precedence(precedence: number);
|
|
1428
1479
|
get space(): Space | null;
|
|
1429
|
-
set space(space: Space | Any$
|
|
1480
|
+
set space(space: Space | Any$p | null);
|
|
1430
1481
|
toString(): string;
|
|
1431
1482
|
}
|
|
1432
1483
|
|
|
@@ -1503,10 +1554,274 @@ declare class BodyType {
|
|
|
1503
1554
|
toString(): string;
|
|
1504
1555
|
}
|
|
1505
1556
|
|
|
1557
|
+
/**
|
|
1558
|
+
* ZPP_Body — Internal body representation for the nape physics engine.
|
|
1559
|
+
*
|
|
1560
|
+
* Core physics body managing position, velocity, mass, inertia, shapes, and
|
|
1561
|
+
* CCD (continuous collision detection) sweep integration.
|
|
1562
|
+
* Extends ZPP_Interactor (still in compiled code — methods copied at init time).
|
|
1563
|
+
*
|
|
1564
|
+
* Converted from nape-compiled.js lines 52431–54547.
|
|
1565
|
+
*/
|
|
1566
|
+
|
|
1567
|
+
type Any$o = any;
|
|
1568
|
+
declare class ZPP_Body {
|
|
1569
|
+
static __name__: string[];
|
|
1570
|
+
static __super__: Any$o;
|
|
1571
|
+
/**
|
|
1572
|
+
* Namespace references, set by the compiled module after import.
|
|
1573
|
+
* _nape = the `nape` public namespace
|
|
1574
|
+
* _zpp = the `zpp_nape` internal namespace
|
|
1575
|
+
*/
|
|
1576
|
+
static _nape: Any$o;
|
|
1577
|
+
static _zpp: Any$o;
|
|
1578
|
+
static types: Any$o[];
|
|
1579
|
+
static bodystack: Any$o;
|
|
1580
|
+
static bodyset: Any$o;
|
|
1581
|
+
static cur_graph_depth: number;
|
|
1582
|
+
static bodysetlt(a: Any$o, b: Any$o): boolean;
|
|
1583
|
+
static __static(): Any$o;
|
|
1584
|
+
outer_i: Any$o;
|
|
1585
|
+
id: number;
|
|
1586
|
+
userData: Any$o;
|
|
1587
|
+
ishape: Any$o;
|
|
1588
|
+
ibody: Any$o;
|
|
1589
|
+
icompound: Any$o;
|
|
1590
|
+
wrap_cbTypes: Any$o;
|
|
1591
|
+
cbSet: Any$o;
|
|
1592
|
+
cbTypes: Any$o;
|
|
1593
|
+
group: Any$o;
|
|
1594
|
+
cbsets: Any$o;
|
|
1595
|
+
outer: Any$o;
|
|
1596
|
+
world: boolean;
|
|
1597
|
+
type: number;
|
|
1598
|
+
compound: Any$o;
|
|
1599
|
+
shapes: Any$o;
|
|
1600
|
+
wrap_shapes: Any$o;
|
|
1601
|
+
space: Any$o;
|
|
1602
|
+
arbiters: Any$o;
|
|
1603
|
+
wrap_arbiters: Any$o;
|
|
1604
|
+
constraints: Any$o;
|
|
1605
|
+
wrap_constraints: Any$o;
|
|
1606
|
+
component: Any$o;
|
|
1607
|
+
graph_depth: number;
|
|
1608
|
+
sweepTime: number;
|
|
1609
|
+
sweep_angvel: number;
|
|
1610
|
+
sweepFrozen: boolean;
|
|
1611
|
+
sweepRadius: number;
|
|
1612
|
+
bullet: boolean;
|
|
1613
|
+
bulletEnabled: boolean;
|
|
1614
|
+
disableCCD: boolean;
|
|
1615
|
+
pre_posx: number;
|
|
1616
|
+
pre_posy: number;
|
|
1617
|
+
posx: number;
|
|
1618
|
+
posy: number;
|
|
1619
|
+
wrap_pos: Any$o;
|
|
1620
|
+
velx: number;
|
|
1621
|
+
vely: number;
|
|
1622
|
+
wrap_vel: Any$o;
|
|
1623
|
+
forcex: number;
|
|
1624
|
+
forcey: number;
|
|
1625
|
+
wrap_force: Any$o;
|
|
1626
|
+
kinvelx: number;
|
|
1627
|
+
kinvely: number;
|
|
1628
|
+
wrap_kinvel: Any$o;
|
|
1629
|
+
svelx: number;
|
|
1630
|
+
svely: number;
|
|
1631
|
+
wrap_svel: Any$o;
|
|
1632
|
+
wrapcvel: Any$o;
|
|
1633
|
+
angvel: number;
|
|
1634
|
+
torque: number;
|
|
1635
|
+
kinangvel: number;
|
|
1636
|
+
pre_rot: number;
|
|
1637
|
+
rot: number;
|
|
1638
|
+
axisx: number;
|
|
1639
|
+
axisy: number;
|
|
1640
|
+
zip_axis: boolean;
|
|
1641
|
+
kinematicDelaySleep: boolean;
|
|
1642
|
+
mass: number;
|
|
1643
|
+
zip_mass: boolean;
|
|
1644
|
+
massMode: number;
|
|
1645
|
+
imass: number;
|
|
1646
|
+
smass: number;
|
|
1647
|
+
cmass: number;
|
|
1648
|
+
nomove: boolean;
|
|
1649
|
+
gravMass: number;
|
|
1650
|
+
zip_gravMass: boolean;
|
|
1651
|
+
gravMassMode: number;
|
|
1652
|
+
gravMassScale: number;
|
|
1653
|
+
zip_gravMassScale: boolean;
|
|
1654
|
+
inertiaMode: number;
|
|
1655
|
+
inertia: number;
|
|
1656
|
+
zip_inertia: boolean;
|
|
1657
|
+
cinertia: number;
|
|
1658
|
+
iinertia: number;
|
|
1659
|
+
sinertia: number;
|
|
1660
|
+
norotate: boolean;
|
|
1661
|
+
aabb: ZPP_AABB;
|
|
1662
|
+
zip_aabb: boolean;
|
|
1663
|
+
localCOMx: number;
|
|
1664
|
+
localCOMy: number;
|
|
1665
|
+
zip_localCOM: boolean;
|
|
1666
|
+
worldCOMx: number;
|
|
1667
|
+
worldCOMy: number;
|
|
1668
|
+
zip_worldCOM: boolean;
|
|
1669
|
+
wrap_localCOM: Any$o;
|
|
1670
|
+
wrap_worldCOM: Any$o;
|
|
1671
|
+
__class__: Any$o;
|
|
1672
|
+
constructor();
|
|
1673
|
+
isStatic(): boolean;
|
|
1674
|
+
isDynamic(): boolean;
|
|
1675
|
+
isKinematic(): boolean;
|
|
1676
|
+
invalidate_type(): void;
|
|
1677
|
+
invalidate_shapes(): void;
|
|
1678
|
+
init_bodysetlist(): void;
|
|
1679
|
+
connectedBodies_cont(b: Any$o): void;
|
|
1680
|
+
connectedBodies(depth: number, output: Any$o): Any$o;
|
|
1681
|
+
interactingBodies(type: number, output: Any$o): Any$o;
|
|
1682
|
+
atRest(dt: number): boolean;
|
|
1683
|
+
refreshArbiters(): void;
|
|
1684
|
+
sweepIntegrate(dt: number): void;
|
|
1685
|
+
sweepValidate(s: Any$o): void;
|
|
1686
|
+
invalidate_pos(): void;
|
|
1687
|
+
pos_invalidate(pos: Any$o): void;
|
|
1688
|
+
pos_validate(): void;
|
|
1689
|
+
vel_invalidate(vel: Any$o): void;
|
|
1690
|
+
vel_validate(): void;
|
|
1691
|
+
kinvel_invalidate(vel: Any$o): void;
|
|
1692
|
+
kinvel_validate(): void;
|
|
1693
|
+
svel_invalidate(vel: Any$o): void;
|
|
1694
|
+
svel_validate(): void;
|
|
1695
|
+
force_invalidate(force: Any$o): void;
|
|
1696
|
+
force_validate(): void;
|
|
1697
|
+
private _setupVec2Wrapper;
|
|
1698
|
+
setupPosition(): void;
|
|
1699
|
+
setupVelocity(): void;
|
|
1700
|
+
setupkinvel(): void;
|
|
1701
|
+
setupsvel(): void;
|
|
1702
|
+
setupForce(): void;
|
|
1703
|
+
cvel_validate(): void;
|
|
1704
|
+
setup_cvel(): void;
|
|
1705
|
+
invalidate_rot(): void;
|
|
1706
|
+
validate_axis(): void;
|
|
1707
|
+
quick_validate_axis(): void;
|
|
1708
|
+
delta_rot(dr: number): void;
|
|
1709
|
+
invalidate_mass(): void;
|
|
1710
|
+
validate_mass(): void;
|
|
1711
|
+
invalidate_gravMass(): void;
|
|
1712
|
+
validate_gravMass(): void;
|
|
1713
|
+
invalidate_gravMassScale(): void;
|
|
1714
|
+
validate_gravMassScale(): void;
|
|
1715
|
+
invalidate_inertia(): void;
|
|
1716
|
+
validate_inertia(): void;
|
|
1717
|
+
invalidate_wake(): void;
|
|
1718
|
+
invalidate_aabb(): void;
|
|
1719
|
+
validate_aabb(): void;
|
|
1720
|
+
private _validateCircleAABB;
|
|
1721
|
+
private _validatePolygonAABB;
|
|
1722
|
+
aabb_validate(): void;
|
|
1723
|
+
invalidate_localCOM(): void;
|
|
1724
|
+
invalidate_worldCOM(): void;
|
|
1725
|
+
private _computePolygonLocalCOM;
|
|
1726
|
+
validate_localCOM(): void;
|
|
1727
|
+
validate_worldCOM(): void;
|
|
1728
|
+
getlocalCOM(): void;
|
|
1729
|
+
getworldCOM(): void;
|
|
1730
|
+
__immutable_midstep(): void;
|
|
1731
|
+
clear(): void;
|
|
1732
|
+
shapes_adder(s: Any$o): boolean;
|
|
1733
|
+
shapes_subber(s: Any$o): void;
|
|
1734
|
+
shapes_invalidate(_: Any$o): void;
|
|
1735
|
+
shapes_modifiable(): void;
|
|
1736
|
+
addedToSpace(): void;
|
|
1737
|
+
removedFromSpace(): void;
|
|
1738
|
+
private _removeArbiterFromList;
|
|
1739
|
+
copy(): Any$o;
|
|
1740
|
+
wake: () => void;
|
|
1741
|
+
__iaddedToSpace: () => void;
|
|
1742
|
+
__iremovedFromSpace: () => void;
|
|
1743
|
+
immutable_midstep: (name: string) => void;
|
|
1744
|
+
copyto: (ret: Any$o) => void;
|
|
1745
|
+
insert_cbtype: (cb: Any$o) => void;
|
|
1746
|
+
alloc_cbSet: () => void;
|
|
1747
|
+
dealloc_cbSet: () => void;
|
|
1748
|
+
setupcbTypes: () => void;
|
|
1749
|
+
immutable_cbTypes: () => void;
|
|
1750
|
+
wrap_cbTypes_subber: (pcb: Any$o) => void;
|
|
1751
|
+
wrap_cbTypes_adder: (cb: Any$o) => void;
|
|
1752
|
+
setGroup: (group: Any$o) => void;
|
|
1753
|
+
lookup_group: () => Any$o;
|
|
1754
|
+
getSpace: () => Any$o;
|
|
1755
|
+
isShape: () => boolean;
|
|
1756
|
+
isBody: () => boolean;
|
|
1757
|
+
isCompound: () => boolean;
|
|
1758
|
+
static _initialized: boolean;
|
|
1759
|
+
static _init(zpp: Any$o, nape: Any$o): void;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
type Any$n = any;
|
|
1506
1763
|
/**
|
|
1507
1764
|
* A rigid body in the physics simulation.
|
|
1765
|
+
*
|
|
1766
|
+
* Fully modernized — uses ZPP_Body directly (extracted to TypeScript).
|
|
1508
1767
|
*/
|
|
1509
1768
|
declare class Body extends Interactor {
|
|
1769
|
+
static __name__: string[];
|
|
1770
|
+
static __super__: Any$n;
|
|
1771
|
+
/** Direct access to the extracted internal ZPP_Body. */
|
|
1772
|
+
zpp_inner: ZPP_Body;
|
|
1773
|
+
debugDraw: boolean;
|
|
1774
|
+
/** @internal */ set_type: (type: Any$n) => Any$n;
|
|
1775
|
+
/** @internal */ set_position: (position: Any$n) => Any$n;
|
|
1776
|
+
/** @internal */ set_rotation: (rotation: number) => number;
|
|
1777
|
+
/** @internal */ set_velocity: (velocity: Any$n) => Any$n;
|
|
1778
|
+
/** @internal */ set_angularVel: (angularVel: number) => number;
|
|
1779
|
+
/** @internal */ set_kinematicVel: (kinematicVel: Any$n) => Any$n;
|
|
1780
|
+
/** @internal */ set_kinAngVel: (kinAngVel: number) => number;
|
|
1781
|
+
/** @internal */ set_surfaceVel: (surfaceVel: Any$n) => Any$n;
|
|
1782
|
+
/** @internal */ set_force: (force: Any$n) => Any$n;
|
|
1783
|
+
/** @internal */ set_torque: (torque: number) => number;
|
|
1784
|
+
/** @internal */ get_mass: () => number;
|
|
1785
|
+
/** @internal */ set_mass: (mass: number) => number;
|
|
1786
|
+
/** @internal */ get_inertia: () => number;
|
|
1787
|
+
/** @internal */ set_inertia: (inertia: number) => number;
|
|
1788
|
+
/** @internal */ get_gravMass: () => number;
|
|
1789
|
+
/** @internal */ set_gravMass: (gravMass: number) => number;
|
|
1790
|
+
/** @internal */ get_gravMassScale: () => number;
|
|
1791
|
+
/** @internal */ set_gravMassScale: (gravMassScale: number) => number;
|
|
1792
|
+
/** @internal */ set_allowMovement: (v: boolean) => boolean;
|
|
1793
|
+
/** @internal */ set_allowRotation: (v: boolean) => boolean;
|
|
1794
|
+
/** @internal */ set_space: (space: Any$n) => Any$n;
|
|
1795
|
+
/** @internal */ set_compound: (compound: Any$n) => Any$n;
|
|
1796
|
+
/** @internal */ get_localCOM: () => Any$n;
|
|
1797
|
+
/** @internal */ get_worldCOM: () => Any$n;
|
|
1798
|
+
/** @internal */ integrate: (deltaTime: number) => Any$n;
|
|
1799
|
+
/** @internal */ applyImpulse: (impulse: Any$n, pos?: Any$n, sleepable?: boolean) => void;
|
|
1800
|
+
/** @internal */ applyAngularImpulse: (impulse: number, sleepable?: boolean) => void;
|
|
1801
|
+
/** @internal */ setVelocityFromTarget: (targetPosition: Any$n, targetRotation: number, deltaTime: number) => Any$n;
|
|
1802
|
+
/** @internal */ localPointToWorld: (point: Any$n, weak?: boolean) => Any$n;
|
|
1803
|
+
/** @internal */ worldPointToLocal: (point: Any$n, weak?: boolean) => Any$n;
|
|
1804
|
+
/** @internal */ localVectorToWorld: (vector: Any$n, weak?: boolean) => Any$n;
|
|
1805
|
+
/** @internal */ worldVectorToLocal: (vector: Any$n, weak?: boolean) => Any$n;
|
|
1806
|
+
/** @internal */ translateShapes: (translation: Any$n) => void;
|
|
1807
|
+
/** @internal */ rotateShapes: (angle: number) => void;
|
|
1808
|
+
/** @internal */ scaleShapes: (scaleX: number, scaleY: number) => void;
|
|
1809
|
+
/** @internal */ align: () => void;
|
|
1810
|
+
/** @internal */ rotate: (centre: Any$n, angle: number) => void;
|
|
1811
|
+
/** @internal */ setShapeMaterials: (material: Any$n) => void;
|
|
1812
|
+
/** @internal */ setShapeFilters: (filter: Any$n) => void;
|
|
1813
|
+
/** @internal */ setShapeFluidProperties: (fluidProperties: Any$n) => void;
|
|
1814
|
+
/** @internal */ contains: (point: Any$n) => boolean;
|
|
1815
|
+
/** @internal */ crushFactor: () => number;
|
|
1816
|
+
/** @internal */ connectedBodies: (depth?: number, output?: Any$n) => Any$n;
|
|
1817
|
+
/** @internal */ interactingBodies: (type?: Any$n, depth?: number, output?: Any$n) => Any$n;
|
|
1818
|
+
/** @internal */ get_massMode: () => Any$n;
|
|
1819
|
+
/** @internal */ set_massMode: (mode: Any$n) => Any$n;
|
|
1820
|
+
/** @internal */ get_inertiaMode: () => Any$n;
|
|
1821
|
+
/** @internal */ set_inertiaMode: (mode: Any$n) => Any$n;
|
|
1822
|
+
/** @internal */ get_gravMassMode: () => Any$n;
|
|
1823
|
+
/** @internal */ set_gravMassMode: (mode: Any$n) => Any$n;
|
|
1824
|
+
/** @internal */ _toString: () => string;
|
|
1510
1825
|
constructor(type?: BodyType, position?: Vec2);
|
|
1511
1826
|
/** @internal */
|
|
1512
1827
|
static _wrap(inner: NapeInner): Body;
|
|
@@ -1555,53 +1870,149 @@ declare class Body extends Interactor {
|
|
|
1555
1870
|
get shapes(): NapeList<Shape>;
|
|
1556
1871
|
get space(): Space;
|
|
1557
1872
|
set space(value: Space | null);
|
|
1558
|
-
get compound():
|
|
1559
|
-
set compound(value:
|
|
1560
|
-
_inner: NapeInner;
|
|
1561
|
-
} | null);
|
|
1873
|
+
get compound(): Any$n;
|
|
1874
|
+
set compound(value: Any$n);
|
|
1562
1875
|
get bounds(): AABB;
|
|
1563
1876
|
get constraintVelocity(): Vec2;
|
|
1564
1877
|
get localCOM(): Vec2;
|
|
1565
1878
|
get worldCOM(): Vec2;
|
|
1566
|
-
integrate(deltaTime: number): void;
|
|
1567
|
-
applyImpulse(impulse: Vec2, pos?: Vec2, sleepable?: boolean): void;
|
|
1568
|
-
applyAngularImpulse(impulse: number, sleepable?: boolean): void;
|
|
1569
|
-
setVelocityFromTarget(targetPosition: Vec2, targetRotation: number, deltaTime: number): void;
|
|
1570
|
-
localPointToWorld(point: Vec2, weak?: boolean): Vec2;
|
|
1571
|
-
worldPointToLocal(point: Vec2, weak?: boolean): Vec2;
|
|
1572
|
-
localVectorToWorld(vector: Vec2, weak?: boolean): Vec2;
|
|
1573
|
-
worldVectorToLocal(vector: Vec2, weak?: boolean): Vec2;
|
|
1574
|
-
translateShapes(translation: Vec2): void;
|
|
1575
|
-
rotateShapes(angle: number): void;
|
|
1576
|
-
scaleShapes(scaleX: number, scaleY: number): void;
|
|
1577
|
-
align(): void;
|
|
1578
|
-
rotate(centre: Vec2, angle: number): void;
|
|
1579
|
-
setShapeMaterials(material: Material): void;
|
|
1580
|
-
setShapeFilters(filter: InteractionFilter): void;
|
|
1581
|
-
setShapeFluidProperties(fluidProperties: FluidProperties): void;
|
|
1582
|
-
contains(point: Vec2): boolean;
|
|
1583
|
-
crushFactor(): number;
|
|
1584
1879
|
copy(): Body;
|
|
1585
1880
|
toString(): string;
|
|
1881
|
+
get_type(): Any$n;
|
|
1882
|
+
get_shapes(): Any$n;
|
|
1883
|
+
get_isBullet(): boolean;
|
|
1884
|
+
set_isBullet(v: boolean): boolean;
|
|
1885
|
+
get_disableCCD(): boolean;
|
|
1886
|
+
set_disableCCD(v: boolean): boolean;
|
|
1887
|
+
get_position(): Any$n;
|
|
1888
|
+
get_velocity(): Any$n;
|
|
1889
|
+
get_rotation(): number;
|
|
1890
|
+
get_angularVel(): number;
|
|
1891
|
+
get_kinematicVel(): Any$n;
|
|
1892
|
+
get_kinAngVel(): number;
|
|
1893
|
+
get_surfaceVel(): Any$n;
|
|
1894
|
+
get_force(): Any$n;
|
|
1895
|
+
get_torque(): number;
|
|
1896
|
+
get_bounds(): Any$n;
|
|
1897
|
+
get_constraintVelocity(): Any$n;
|
|
1898
|
+
get_constraintMass(): number;
|
|
1899
|
+
get_constraintInertia(): number;
|
|
1900
|
+
get_allowMovement(): boolean;
|
|
1901
|
+
get_allowRotation(): boolean;
|
|
1902
|
+
get_isSleeping(): boolean;
|
|
1903
|
+
get_compound(): Any$n;
|
|
1904
|
+
get_space(): Any$n;
|
|
1905
|
+
get_arbiters(): Any$n;
|
|
1906
|
+
get_constraints(): Any$n;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* ZPP_Compound — Internal compound representation for the nape physics engine.
|
|
1911
|
+
*
|
|
1912
|
+
* Hierarchical grouping of bodies, constraints, and other compounds.
|
|
1913
|
+
* Extends ZPP_Interactor (still in compiled code — methods copied at init time).
|
|
1914
|
+
*
|
|
1915
|
+
* Converted from nape-compiled.js lines 55195–55521.
|
|
1916
|
+
*/
|
|
1917
|
+
type Any$m = any;
|
|
1918
|
+
declare class ZPP_Compound {
|
|
1919
|
+
static __name__: string[];
|
|
1920
|
+
static __super__: Any$m;
|
|
1921
|
+
/**
|
|
1922
|
+
* Namespace references, set by the compiled module after import.
|
|
1923
|
+
* _nape = the `nape` public namespace (for wrapper creation in copy())
|
|
1924
|
+
* _zpp = the `zpp_nape` internal namespace (for ZNPList_*, ZPP_BodyList, etc.)
|
|
1925
|
+
*/
|
|
1926
|
+
static _nape: Any$m;
|
|
1927
|
+
static _zpp: Any$m;
|
|
1928
|
+
/**
|
|
1929
|
+
* Wrapper factory callback, registered by the modernized Compound class.
|
|
1930
|
+
* When set, wrapper() uses this instead of the compiled Compound constructor.
|
|
1931
|
+
*/
|
|
1932
|
+
static _wrapFn: ((zpp: ZPP_Compound) => Any$m) | null;
|
|
1933
|
+
outer_i: Any$m;
|
|
1934
|
+
id: number;
|
|
1935
|
+
userData: Any$m;
|
|
1936
|
+
ishape: Any$m;
|
|
1937
|
+
ibody: Any$m;
|
|
1938
|
+
icompound: Any$m;
|
|
1939
|
+
wrap_cbTypes: Any$m;
|
|
1940
|
+
cbSet: Any$m;
|
|
1941
|
+
cbTypes: Any$m;
|
|
1942
|
+
group: Any$m;
|
|
1943
|
+
cbsets: Any$m;
|
|
1944
|
+
outer: Any$m;
|
|
1945
|
+
bodies: Any$m;
|
|
1946
|
+
constraints: Any$m;
|
|
1947
|
+
compounds: Any$m;
|
|
1948
|
+
wrap_bodies: Any$m;
|
|
1949
|
+
wrap_constraints: Any$m;
|
|
1950
|
+
wrap_compounds: Any$m;
|
|
1951
|
+
depth: number;
|
|
1952
|
+
compound: Any$m;
|
|
1953
|
+
space: Any$m;
|
|
1954
|
+
__class__: Any$m;
|
|
1955
|
+
constructor();
|
|
1956
|
+
__imutable_midstep(name: string): void;
|
|
1957
|
+
addedToSpace(): void;
|
|
1958
|
+
removedFromSpace(): void;
|
|
1959
|
+
breakApart(): void;
|
|
1960
|
+
private static _zppOf;
|
|
1961
|
+
bodies_adder(x: Any$m): boolean;
|
|
1962
|
+
bodies_subber(x: Any$m): void;
|
|
1963
|
+
bodies_modifiable(): void;
|
|
1964
|
+
constraints_adder(x: Any$m): boolean;
|
|
1965
|
+
constraints_subber(x: Any$m): void;
|
|
1966
|
+
constraints_modifiable(): void;
|
|
1967
|
+
compounds_adder(x: Any$m): boolean;
|
|
1968
|
+
compounds_subber(x: Any$m): void;
|
|
1969
|
+
compounds_modifiable(): void;
|
|
1970
|
+
copy(dict?: Any$m[], todo?: Any$m[]): Any$m;
|
|
1971
|
+
isShape: () => boolean;
|
|
1972
|
+
isBody: () => boolean;
|
|
1973
|
+
isCompound: () => boolean;
|
|
1974
|
+
__iaddedToSpace: () => void;
|
|
1975
|
+
__iremovedFromSpace: () => void;
|
|
1976
|
+
wake: () => void;
|
|
1977
|
+
getSpace: () => Any$m;
|
|
1978
|
+
setupcbTypes: () => void;
|
|
1979
|
+
immutable_cbTypes: () => void;
|
|
1980
|
+
wrap_cbTypes_subber: (pcb: Any$m) => void;
|
|
1981
|
+
wrap_cbTypes_adder: (cb: Any$m) => boolean;
|
|
1982
|
+
insert_cbtype: (cb: Any$m) => void;
|
|
1983
|
+
alloc_cbSet: () => void;
|
|
1984
|
+
dealloc_cbSet: () => void;
|
|
1985
|
+
immutable_midstep: (name: string) => void;
|
|
1986
|
+
copyto: (ret: Any$m) => void;
|
|
1987
|
+
lookup_group: () => Any$m;
|
|
1988
|
+
/**
|
|
1989
|
+
* Initialize prototype by copying ZPP_Interactor methods.
|
|
1990
|
+
* Must be called after _zpp is set (during compiled module init).
|
|
1991
|
+
*/
|
|
1992
|
+
static _init(): void;
|
|
1586
1993
|
}
|
|
1587
1994
|
|
|
1588
|
-
type Any$
|
|
1995
|
+
type Any$l = any;
|
|
1589
1996
|
/**
|
|
1590
1997
|
* A compound physics object — a hierarchical grouping of Bodies, Constraints,
|
|
1591
1998
|
* and other Compounds.
|
|
1592
1999
|
*
|
|
1593
|
-
*
|
|
2000
|
+
* Fully modernized — uses ZPP_Compound directly (extracted to TypeScript).
|
|
1594
2001
|
*/
|
|
1595
2002
|
declare class Compound extends Interactor {
|
|
2003
|
+
static __name__: string[];
|
|
2004
|
+
static __super__: Any$l;
|
|
2005
|
+
/** Direct access to the extracted internal ZPP_Compound. */
|
|
2006
|
+
zpp_inner: ZPP_Compound;
|
|
1596
2007
|
constructor();
|
|
1597
2008
|
/** @internal */
|
|
1598
2009
|
static _wrap(inner: NapeInner): Compound;
|
|
1599
2010
|
/** Bodies in this compound. */
|
|
1600
|
-
get bodies(): Any$
|
|
2011
|
+
get bodies(): Any$l;
|
|
1601
2012
|
/** Constraints in this compound. */
|
|
1602
|
-
get constraints(): Any$
|
|
2013
|
+
get constraints(): Any$l;
|
|
1603
2014
|
/** Child compounds in this compound. */
|
|
1604
|
-
get compounds(): Any$
|
|
2015
|
+
get compounds(): Any$l;
|
|
1605
2016
|
/** Parent compound, or null if this is a root compound. */
|
|
1606
2017
|
get compound(): Compound | null;
|
|
1607
2018
|
set compound(value: Compound | null);
|
|
@@ -1610,12 +2021,12 @@ declare class Compound extends Interactor {
|
|
|
1610
2021
|
set space(value: Space | null);
|
|
1611
2022
|
/** Deep copy of this compound and all its children. */
|
|
1612
2023
|
copy(): Compound;
|
|
1613
|
-
/** Distribute all children to the parent compound or space, then remove
|
|
2024
|
+
/** Distribute all children to the parent compound or space, then remove. */
|
|
1614
2025
|
breakApart(): void;
|
|
1615
2026
|
/** Recursively visit all bodies in this compound and its sub-compounds. */
|
|
1616
2027
|
visitBodies(lambda: (body: Body) => void): void;
|
|
1617
2028
|
/** Recursively visit all constraints in this compound and its sub-compounds. */
|
|
1618
|
-
visitConstraints(lambda: (constraint: Any$
|
|
2029
|
+
visitConstraints(lambda: (constraint: Any$l) => void): void;
|
|
1619
2030
|
/** Recursively visit all sub-compounds in this compound. */
|
|
1620
2031
|
visitCompounds(lambda: (compound: Compound) => void): void;
|
|
1621
2032
|
/** Calculate the center of mass of all bodies in this compound. */
|
|
@@ -1625,6 +2036,13 @@ declare class Compound extends Interactor {
|
|
|
1625
2036
|
/** Rotate all bodies in this compound around the given centre point. */
|
|
1626
2037
|
rotate(centre: Vec2, angle: number): Compound;
|
|
1627
2038
|
toString(): string;
|
|
2039
|
+
get_bodies(): Any$l;
|
|
2040
|
+
get_constraints(): Any$l;
|
|
2041
|
+
get_compounds(): Any$l;
|
|
2042
|
+
get_compound(): Any$l;
|
|
2043
|
+
set_compound(compound: Any$l): Any$l;
|
|
2044
|
+
get_space(): Any$l;
|
|
2045
|
+
set_space(space: Any$l): Any$l;
|
|
1628
2046
|
}
|
|
1629
2047
|
|
|
1630
2048
|
/**
|
|
@@ -1780,6 +2198,140 @@ declare class ArbiterType {
|
|
|
1780
2198
|
toString(): string;
|
|
1781
2199
|
}
|
|
1782
2200
|
|
|
2201
|
+
type Any$k = any;
|
|
2202
|
+
/**
|
|
2203
|
+
* Represents an interaction arbiter between two shapes.
|
|
2204
|
+
*
|
|
2205
|
+
* Arbiters are pooled internally by the engine — they cannot be created directly.
|
|
2206
|
+
* Access arbiters via `Space.arbiters`, `Body.arbiters`, or callback handlers.
|
|
2207
|
+
*
|
|
2208
|
+
* Thin wrapper — delegates to compiled ZPP_Arbiter (not yet extracted).
|
|
2209
|
+
*/
|
|
2210
|
+
declare class Arbiter {
|
|
2211
|
+
static __name__: string[];
|
|
2212
|
+
/** @internal */
|
|
2213
|
+
zpp_inner: Any$k;
|
|
2214
|
+
/** @internal Backward-compat: compiled code accesses `obj.zpp_inner`. */
|
|
2215
|
+
get _inner(): NapeInner;
|
|
2216
|
+
constructor();
|
|
2217
|
+
/** Whether this arbiter is currently sleeping. */
|
|
2218
|
+
get isSleeping(): boolean;
|
|
2219
|
+
/** The type of this arbiter (COLLISION, SENSOR, or FLUID). */
|
|
2220
|
+
get type(): Any$k;
|
|
2221
|
+
/** Cast to CollisionArbiter if this is a collision, else null. */
|
|
2222
|
+
get collisionArbiter(): Any$k;
|
|
2223
|
+
/** Cast to FluidArbiter if this is a fluid interaction, else null. */
|
|
2224
|
+
get fluidArbiter(): Any$k;
|
|
2225
|
+
/** First shape (lower id). */
|
|
2226
|
+
get shape1(): Any$k;
|
|
2227
|
+
/** Second shape (higher id). */
|
|
2228
|
+
get shape2(): Any$k;
|
|
2229
|
+
/** Body of shape1. */
|
|
2230
|
+
get body1(): Any$k;
|
|
2231
|
+
/** Body of shape2. */
|
|
2232
|
+
get body2(): Any$k;
|
|
2233
|
+
/** The pre-handler state of this arbiter. */
|
|
2234
|
+
get state(): Any$k;
|
|
2235
|
+
/** Whether this is a collision arbiter. */
|
|
2236
|
+
isCollisionArbiter(): boolean;
|
|
2237
|
+
/** Whether this is a fluid arbiter. */
|
|
2238
|
+
isFluidArbiter(): boolean;
|
|
2239
|
+
/** Whether this is a sensor arbiter. */
|
|
2240
|
+
isSensorArbiter(): boolean;
|
|
2241
|
+
/**
|
|
2242
|
+
* Total impulse of this arbiter. Base implementation returns Vec3(0,0,0).
|
|
2243
|
+
* Overridden by CollisionArbiter and FluidArbiter.
|
|
2244
|
+
*/
|
|
2245
|
+
totalImpulse(body?: Any$k, freshOnly?: boolean): Vec3;
|
|
2246
|
+
toString(): string;
|
|
2247
|
+
/** @internal */
|
|
2248
|
+
protected _activeCheck(): void;
|
|
2249
|
+
/** @internal */
|
|
2250
|
+
protected _checkBody(body: Any$k): void;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
type Any$j = any;
|
|
2254
|
+
/**
|
|
2255
|
+
* A collision arbiter between two shapes in contact.
|
|
2256
|
+
*
|
|
2257
|
+
* Provides access to contact points, collision normal, friction, elasticity,
|
|
2258
|
+
* and impulse information. Some properties are mutable only in pre-handlers.
|
|
2259
|
+
*
|
|
2260
|
+
* Thin wrapper — delegates to compiled ZPP_Arbiter/ZPP_ColArbiter (not yet extracted).
|
|
2261
|
+
*/
|
|
2262
|
+
declare class CollisionArbiter extends Arbiter {
|
|
2263
|
+
static __name__: string[];
|
|
2264
|
+
static __super__: typeof Arbiter;
|
|
2265
|
+
constructor();
|
|
2266
|
+
/** Contact points for this collision. */
|
|
2267
|
+
get contacts(): Any$j;
|
|
2268
|
+
/** Collision normal vector. */
|
|
2269
|
+
get normal(): Any$j;
|
|
2270
|
+
/** Sum of the radii of the two shapes at the collision point. */
|
|
2271
|
+
get radius(): number;
|
|
2272
|
+
/** Reference edge of shape1 (if polygon), or null. */
|
|
2273
|
+
get referenceEdge1(): Any$j;
|
|
2274
|
+
/** Reference edge of shape2 (if polygon), or null. */
|
|
2275
|
+
get referenceEdge2(): Any$j;
|
|
2276
|
+
/** Coefficient of restitution (elasticity). Mutable in pre-handler only. */
|
|
2277
|
+
get elasticity(): number;
|
|
2278
|
+
set elasticity(value: number);
|
|
2279
|
+
/** Dynamic friction coefficient. Mutable in pre-handler only. */
|
|
2280
|
+
get dynamicFriction(): number;
|
|
2281
|
+
set dynamicFriction(value: number);
|
|
2282
|
+
/** Static friction coefficient. Mutable in pre-handler only. */
|
|
2283
|
+
get staticFriction(): number;
|
|
2284
|
+
set staticFriction(value: number);
|
|
2285
|
+
/** Rolling friction coefficient. Mutable in pre-handler only. */
|
|
2286
|
+
get rollingFriction(): number;
|
|
2287
|
+
set rollingFriction(value: number);
|
|
2288
|
+
/** Whether the first contact point lies on a polygon vertex (poly-circle only). */
|
|
2289
|
+
firstVertex(): boolean;
|
|
2290
|
+
/** Whether the second contact point lies on a polygon vertex (poly-circle only). */
|
|
2291
|
+
secondVertex(): boolean;
|
|
2292
|
+
/** Normal impulse accumulated across all contacts. */
|
|
2293
|
+
normalImpulse(body?: Any$j, freshOnly?: boolean): Vec3;
|
|
2294
|
+
/** Tangent (friction) impulse accumulated across all contacts. */
|
|
2295
|
+
tangentImpulse(body?: Any$j, freshOnly?: boolean): Vec3;
|
|
2296
|
+
/** Total impulse (normal + tangent + rolling) accumulated across all contacts. */
|
|
2297
|
+
totalImpulse(body?: Any$j, freshOnly?: boolean): Vec3;
|
|
2298
|
+
/** Rolling impulse for this collision. */
|
|
2299
|
+
rollingImpulse(body?: Any$j, freshOnly?: boolean): number;
|
|
2300
|
+
/** @internal Recalculate material properties if invalidated. */
|
|
2301
|
+
private _recalcIfInvalidated;
|
|
2302
|
+
/** @internal Throw if not in pre-handler mutable window. */
|
|
2303
|
+
private _mutableCheck;
|
|
2304
|
+
/** @internal Accumulate impulse from contacts. */
|
|
2305
|
+
private _accumulateImpulse;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
type Any$i = any;
|
|
2309
|
+
/**
|
|
2310
|
+
* A fluid arbiter between two shapes with fluid interaction.
|
|
2311
|
+
*
|
|
2312
|
+
* Provides access to buoyancy/drag impulses, overlap area, and position.
|
|
2313
|
+
* Some properties are mutable only in pre-handlers.
|
|
2314
|
+
*
|
|
2315
|
+
* Thin wrapper — delegates to compiled ZPP_Arbiter/ZPP_FluidArbiter (not yet extracted).
|
|
2316
|
+
*/
|
|
2317
|
+
declare class FluidArbiter extends Arbiter {
|
|
2318
|
+
static __name__: string[];
|
|
2319
|
+
static __super__: typeof Arbiter;
|
|
2320
|
+
constructor();
|
|
2321
|
+
/** Centre of the overlap region. Mutable in pre-handler only. */
|
|
2322
|
+
get position(): Vec2;
|
|
2323
|
+
set position(value: Vec2);
|
|
2324
|
+
/** Area of the overlap region. Mutable in pre-handler only. */
|
|
2325
|
+
get overlap(): number;
|
|
2326
|
+
set overlap(value: number);
|
|
2327
|
+
/** Buoyancy impulse applied by this fluid arbiter. */
|
|
2328
|
+
buoyancyImpulse(body?: Any$i): Vec3;
|
|
2329
|
+
/** Drag impulse applied by this fluid arbiter. */
|
|
2330
|
+
dragImpulse(body?: Any$i): Vec3;
|
|
2331
|
+
/** Total impulse (buoyancy + drag). */
|
|
2332
|
+
totalImpulse(body?: Any$i, freshOnly?: boolean): Vec3;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
1783
2335
|
type Any$h = any;
|
|
1784
2336
|
/**
|
|
1785
2337
|
* Represents a contact point between two colliding shapes.
|
|
@@ -2480,6 +3032,6 @@ declare class PulleyJoint extends Constraint {
|
|
|
2480
3032
|
set ratio(value: number);
|
|
2481
3033
|
}
|
|
2482
3034
|
|
|
2483
|
-
declare const VERSION
|
|
3035
|
+
declare const VERSION: string;
|
|
2484
3036
|
|
|
2485
|
-
export { AABB, AngleJoint, ArbiterType, Body, BodyCallback, BodyListener, BodyType, Broadphase, Callback, CbEvent, CbType, Circle, Compound, Constraint, ConstraintCallback, ConstraintListener, Contact, ConvexResult, DistanceJoint, FluidProperties, GeomPoly, GravMassMode, InertiaMode, InteractionCallback, InteractionFilter, InteractionGroup, InteractionListener, InteractionType, Interactor, LineJoint, Listener, ListenerType, MarchingSquares, MassMode, Mat23, MatMN, Material, MotorJoint, NapeList, OptionType, PivotJoint, Polygon, PreCallback, PreFlag, PreListener, PulleyJoint, Ray, RayResult, Shape, ShapeType, Space, VERSION, ValidationResult, Vec2, Vec3, WeldJoint, Winding, getNape };
|
|
3037
|
+
export { AABB, AngleJoint, Arbiter, ArbiterType, Body, BodyCallback, BodyListener, BodyType, Broadphase, Callback, CbEvent, CbType, Circle, CollisionArbiter, Compound, Constraint, ConstraintCallback, ConstraintListener, Contact, ConvexResult, DistanceJoint, FluidArbiter, FluidProperties, Geom, GeomPoly, GravMassMode, InertiaMode, InteractionCallback, InteractionFilter, InteractionGroup, InteractionListener, InteractionType, Interactor, LineJoint, Listener, ListenerType, MarchingSquares, MassMode, Mat23, MatMN, Material, MotorJoint, NapeList, OptionType, PivotJoint, Polygon, PreCallback, PreFlag, PreListener, PulleyJoint, Ray, RayResult, Shape, ShapeType, Space, VERSION, ValidationResult, Vec2, Vec3, WeldJoint, Winding, getNape };
|