@newkrok/nape-js 3.3.15 → 3.3.17
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 +4619 -5247
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +444 -174
- package/dist/index.d.ts +444 -174
- package/dist/index.js +4619 -5247
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/dist/index.d.cts
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,18 +740,18 @@ 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$
|
|
754
|
+
type Any$v = any;
|
|
755
755
|
/**
|
|
756
756
|
* Static utility class for geometric queries between shapes and bodies.
|
|
757
757
|
*
|
|
@@ -769,7 +769,7 @@ declare class Geom {
|
|
|
769
769
|
* @param out2 - Output Vec2 for closest point on body2.
|
|
770
770
|
* @returns The distance between the two bodies.
|
|
771
771
|
*/
|
|
772
|
-
static distanceBody(body1: Any$
|
|
772
|
+
static distanceBody(body1: Any$v, body2: Any$v, out1: Vec2, out2: Vec2): number;
|
|
773
773
|
/**
|
|
774
774
|
* Calculate minimum distance between two shapes and return closest points.
|
|
775
775
|
* @param shape1 - First shape (must be part of a body).
|
|
@@ -778,28 +778,28 @@ declare class Geom {
|
|
|
778
778
|
* @param out2 - Output Vec2 for closest point on shape2.
|
|
779
779
|
* @returns The distance between the two shapes.
|
|
780
780
|
*/
|
|
781
|
-
static distance(shape1: Any$
|
|
781
|
+
static distance(shape1: Any$v, shape2: Any$v, out1: Vec2, out2: Vec2): number;
|
|
782
782
|
/**
|
|
783
783
|
* Test if two bodies intersect (any of their shapes overlap).
|
|
784
784
|
* @param body1 - First body (must have shapes).
|
|
785
785
|
* @param body2 - Second body (must have shapes).
|
|
786
786
|
* @returns True if the bodies intersect.
|
|
787
787
|
*/
|
|
788
|
-
static intersectsBody(body1: Any$
|
|
788
|
+
static intersectsBody(body1: Any$v, body2: Any$v): boolean;
|
|
789
789
|
/**
|
|
790
790
|
* Test if two shapes intersect.
|
|
791
791
|
* @param shape1 - First shape (must be part of a body).
|
|
792
792
|
* @param shape2 - Second shape (must be part of a body).
|
|
793
793
|
* @returns True if the shapes intersect.
|
|
794
794
|
*/
|
|
795
|
-
static intersects(shape1: Any$
|
|
795
|
+
static intersects(shape1: Any$v, shape2: Any$v): boolean;
|
|
796
796
|
/**
|
|
797
797
|
* Test if shape1 fully contains shape2.
|
|
798
798
|
* @param shape1 - Containing shape (must be part of a body).
|
|
799
799
|
* @param shape2 - Contained shape (must be part of a body).
|
|
800
800
|
* @returns True if shape1 contains shape2.
|
|
801
801
|
*/
|
|
802
|
-
static contains(shape1: Any$
|
|
802
|
+
static contains(shape1: Any$v, shape2: Any$v): boolean;
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
/**
|
|
@@ -820,15 +820,15 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
820
820
|
at(index: number): T;
|
|
821
821
|
/** Add an element to the list. */
|
|
822
822
|
add(item: T & {
|
|
823
|
-
_inner
|
|
823
|
+
_inner?: NapeInner;
|
|
824
824
|
}): void;
|
|
825
825
|
/** Remove an element from the list. */
|
|
826
826
|
remove(item: T & {
|
|
827
|
-
_inner
|
|
827
|
+
_inner?: NapeInner;
|
|
828
828
|
}): void;
|
|
829
829
|
/** Check if the list contains an element. */
|
|
830
830
|
has(item: T & {
|
|
831
|
-
_inner
|
|
831
|
+
_inner?: NapeInner;
|
|
832
832
|
}): boolean;
|
|
833
833
|
/** Remove all elements. */
|
|
834
834
|
clear(): void;
|
|
@@ -836,7 +836,7 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
836
836
|
get empty(): boolean;
|
|
837
837
|
/** Push an element to the end. */
|
|
838
838
|
push(item: T & {
|
|
839
|
-
_inner
|
|
839
|
+
_inner?: NapeInner;
|
|
840
840
|
}): void;
|
|
841
841
|
/** Pop the last element. */
|
|
842
842
|
pop(): T;
|
|
@@ -844,7 +844,7 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
844
844
|
shift(): T;
|
|
845
845
|
/** Unshift an element to the front. */
|
|
846
846
|
unshift(item: T & {
|
|
847
|
-
_inner
|
|
847
|
+
_inner?: NapeInner;
|
|
848
848
|
}): void;
|
|
849
849
|
/** Iterate over all elements. */
|
|
850
850
|
[Symbol.iterator](): Iterator<T>;
|
|
@@ -863,7 +863,7 @@ declare class NapeList<T> implements Iterable<T> {
|
|
|
863
863
|
*
|
|
864
864
|
* Converted from nape-compiled.js lines 87523–87601, 135477–135481.
|
|
865
865
|
*/
|
|
866
|
-
type Any$
|
|
866
|
+
type Any$u = any;
|
|
867
867
|
declare class ZPP_Material {
|
|
868
868
|
static zpp_pool: ZPP_Material | null;
|
|
869
869
|
static WAKE: number;
|
|
@@ -876,27 +876,27 @@ declare class ZPP_Material {
|
|
|
876
876
|
* _nape = the `nape` public namespace (for wrapper creation)
|
|
877
877
|
* _zpp = the `zpp_nape` internal namespace (for ZNPList_ZPP_Shape)
|
|
878
878
|
*/
|
|
879
|
-
static _nape: Any$
|
|
880
|
-
static _zpp: Any$
|
|
879
|
+
static _nape: Any$u;
|
|
880
|
+
static _zpp: Any$u;
|
|
881
881
|
/**
|
|
882
882
|
* Wrapper factory callback, registered by the modernized Material class.
|
|
883
883
|
* When set, wrapper() uses this instead of creating a compiled Material.
|
|
884
884
|
*/
|
|
885
|
-
static _wrapFn: ((zpp: ZPP_Material) => Any$
|
|
885
|
+
static _wrapFn: ((zpp: ZPP_Material) => Any$u) | null;
|
|
886
886
|
elasticity: number;
|
|
887
887
|
dynamicFriction: number;
|
|
888
888
|
staticFriction: number;
|
|
889
889
|
density: number;
|
|
890
890
|
rollingFriction: number;
|
|
891
|
-
shapes: Any$
|
|
892
|
-
wrap_shapes: Any$
|
|
893
|
-
outer: Any$
|
|
894
|
-
userData: Any$
|
|
891
|
+
shapes: Any$u;
|
|
892
|
+
wrap_shapes: Any$u;
|
|
893
|
+
outer: Any$u;
|
|
894
|
+
userData: Any$u;
|
|
895
895
|
next: ZPP_Material | null;
|
|
896
|
-
__class__: Any$
|
|
896
|
+
__class__: Any$u;
|
|
897
897
|
constructor();
|
|
898
898
|
/** Create/return the public nape.phys.Material wrapper for this internal object. */
|
|
899
|
-
wrapper(): Any$
|
|
899
|
+
wrapper(): Any$u;
|
|
900
900
|
/** Called when this object is returned to the pool. */
|
|
901
901
|
free(): void;
|
|
902
902
|
/** Called when this object is taken from the pool. */
|
|
@@ -904,9 +904,9 @@ declare class ZPP_Material {
|
|
|
904
904
|
/** Initialize the shapes list (called during feature construction). */
|
|
905
905
|
feature_cons(): void;
|
|
906
906
|
/** Register a shape that uses this material. */
|
|
907
|
-
addShape(shape: Any$
|
|
907
|
+
addShape(shape: Any$u): void;
|
|
908
908
|
/** Unregister a shape that no longer uses this material. */
|
|
909
|
-
remShape(shape: Any$
|
|
909
|
+
remShape(shape: Any$u): void;
|
|
910
910
|
/** Create a copy with the same property values. */
|
|
911
911
|
copy(): ZPP_Material;
|
|
912
912
|
/** Copy all property values from another ZPP_Material. */
|
|
@@ -966,36 +966,36 @@ declare class Material {
|
|
|
966
966
|
*
|
|
967
967
|
* Converted from nape-compiled.js lines 87335–87523, 135403.
|
|
968
968
|
*/
|
|
969
|
-
type Any$
|
|
969
|
+
type Any$t = any;
|
|
970
970
|
declare class ZPP_FluidProperties {
|
|
971
971
|
static zpp_pool: ZPP_FluidProperties | null;
|
|
972
972
|
static __name__: string[];
|
|
973
|
-
static _nape: Any$
|
|
974
|
-
static _zpp: Any$
|
|
975
|
-
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;
|
|
976
976
|
viscosity: number;
|
|
977
977
|
density: number;
|
|
978
978
|
gravityx: number;
|
|
979
979
|
gravityy: number;
|
|
980
|
-
wrap_gravity: Any$
|
|
981
|
-
shapes: Any$
|
|
982
|
-
wrap_shapes: Any$
|
|
983
|
-
outer: Any$
|
|
984
|
-
userData: Any$
|
|
980
|
+
wrap_gravity: Any$t;
|
|
981
|
+
shapes: Any$t;
|
|
982
|
+
wrap_shapes: Any$t;
|
|
983
|
+
outer: Any$t;
|
|
984
|
+
userData: Any$t;
|
|
985
985
|
next: ZPP_FluidProperties | null;
|
|
986
|
-
__class__: Any$
|
|
986
|
+
__class__: Any$t;
|
|
987
987
|
constructor();
|
|
988
988
|
/** Create/return the public nape.phys.FluidProperties wrapper. */
|
|
989
|
-
wrapper(): Any$
|
|
989
|
+
wrapper(): Any$t;
|
|
990
990
|
free(): void;
|
|
991
991
|
alloc(): void;
|
|
992
992
|
feature_cons(): void;
|
|
993
|
-
addShape(shape: Any$
|
|
994
|
-
remShape(shape: Any$
|
|
993
|
+
addShape(shape: Any$t): void;
|
|
994
|
+
remShape(shape: Any$t): void;
|
|
995
995
|
/** Copy with object pooling. */
|
|
996
996
|
copy(): ZPP_FluidProperties;
|
|
997
997
|
/** Called when gravity Vec2 wrapper is invalidated (user set new gravity). */
|
|
998
|
-
gravity_invalidate(x: Any$
|
|
998
|
+
gravity_invalidate(x: Any$t): void;
|
|
999
999
|
/** Sync the gravity Vec2 wrapper with internal values. */
|
|
1000
1000
|
gravity_validate(): void;
|
|
1001
1001
|
/** Lazily create and return the gravity Vec2 wrapper. */
|
|
@@ -1046,33 +1046,33 @@ declare class FluidProperties {
|
|
|
1046
1046
|
*
|
|
1047
1047
|
* Converted from nape-compiled.js lines 63255–63366, 135329.
|
|
1048
1048
|
*/
|
|
1049
|
-
type Any$
|
|
1049
|
+
type Any$s = any;
|
|
1050
1050
|
declare class ZPP_InteractionFilter {
|
|
1051
1051
|
static zpp_pool: ZPP_InteractionFilter | null;
|
|
1052
1052
|
static __name__: string[];
|
|
1053
|
-
static _nape: Any$
|
|
1054
|
-
static _zpp: Any$
|
|
1055
|
-
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;
|
|
1056
1056
|
collisionGroup: number;
|
|
1057
1057
|
collisionMask: number;
|
|
1058
1058
|
sensorGroup: number;
|
|
1059
1059
|
sensorMask: number;
|
|
1060
1060
|
fluidGroup: number;
|
|
1061
1061
|
fluidMask: number;
|
|
1062
|
-
shapes: Any$
|
|
1063
|
-
wrap_shapes: Any$
|
|
1064
|
-
outer: Any$
|
|
1065
|
-
userData: Any$
|
|
1062
|
+
shapes: Any$s;
|
|
1063
|
+
wrap_shapes: Any$s;
|
|
1064
|
+
outer: Any$s;
|
|
1065
|
+
userData: Any$s;
|
|
1066
1066
|
next: ZPP_InteractionFilter | null;
|
|
1067
|
-
__class__: Any$
|
|
1067
|
+
__class__: Any$s;
|
|
1068
1068
|
constructor();
|
|
1069
1069
|
/** Create/return the public nape.dynamics.InteractionFilter wrapper. */
|
|
1070
|
-
wrapper(): Any$
|
|
1070
|
+
wrapper(): Any$s;
|
|
1071
1071
|
free(): void;
|
|
1072
1072
|
alloc(): void;
|
|
1073
1073
|
feature_cons(): void;
|
|
1074
|
-
addShape(shape: Any$
|
|
1075
|
-
remShape(shape: Any$
|
|
1074
|
+
addShape(shape: Any$s): void;
|
|
1075
|
+
remShape(shape: Any$s): void;
|
|
1076
1076
|
/** Create a copy with object pooling. */
|
|
1077
1077
|
copy(): ZPP_InteractionFilter;
|
|
1078
1078
|
/** Test whether two filters allow collision between their shapes. */
|
|
@@ -1136,22 +1136,22 @@ declare class InteractionFilter {
|
|
|
1136
1136
|
*
|
|
1137
1137
|
* Converted from nape-compiled.js lines 63367–63463, 135330–135331.
|
|
1138
1138
|
*/
|
|
1139
|
-
type Any$
|
|
1139
|
+
type Any$r = any;
|
|
1140
1140
|
declare class ZPP_InteractionGroup {
|
|
1141
1141
|
static SHAPE: number;
|
|
1142
1142
|
static BODY: number;
|
|
1143
1143
|
static __name__: string[];
|
|
1144
|
-
static _zpp: Any$
|
|
1145
|
-
static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$
|
|
1146
|
-
outer: Any$
|
|
1144
|
+
static _zpp: Any$r;
|
|
1145
|
+
static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$r) | null;
|
|
1146
|
+
outer: Any$r;
|
|
1147
1147
|
ignore: boolean;
|
|
1148
1148
|
group: ZPP_InteractionGroup | null;
|
|
1149
|
-
groups: Any$
|
|
1150
|
-
wrap_groups: Any$
|
|
1151
|
-
interactors: Any$
|
|
1152
|
-
wrap_interactors: Any$
|
|
1149
|
+
groups: Any$r;
|
|
1150
|
+
wrap_groups: Any$r;
|
|
1151
|
+
interactors: Any$r;
|
|
1152
|
+
wrap_interactors: Any$r;
|
|
1153
1153
|
depth: number;
|
|
1154
|
-
__class__: Any$
|
|
1154
|
+
__class__: Any$r;
|
|
1155
1155
|
constructor();
|
|
1156
1156
|
/** Set or change the parent group. */
|
|
1157
1157
|
setGroup(group: ZPP_InteractionGroup | null): void;
|
|
@@ -1162,9 +1162,9 @@ declare class ZPP_InteractionGroup {
|
|
|
1162
1162
|
/** Remove a child group. */
|
|
1163
1163
|
remGroup(group: ZPP_InteractionGroup): void;
|
|
1164
1164
|
/** Register an interactor in this group. */
|
|
1165
|
-
addInteractor(intx: Any$
|
|
1165
|
+
addInteractor(intx: Any$r): void;
|
|
1166
1166
|
/** Unregister an interactor from this group. */
|
|
1167
|
-
remInteractor(intx: Any$
|
|
1167
|
+
remInteractor(intx: Any$r, flag?: number): void;
|
|
1168
1168
|
}
|
|
1169
1169
|
|
|
1170
1170
|
/**
|
|
@@ -1371,28 +1371,28 @@ declare class Constraint {
|
|
|
1371
1371
|
*
|
|
1372
1372
|
* Converted from nape-compiled.js lines 27259–27304, 112053–112139.
|
|
1373
1373
|
*/
|
|
1374
|
-
type Any$
|
|
1374
|
+
type Any$q = any;
|
|
1375
1375
|
declare class ZPP_Listener {
|
|
1376
1376
|
static __name__: string[];
|
|
1377
|
-
static _nape: Any$
|
|
1378
|
-
static _zpp: Any$
|
|
1377
|
+
static _nape: Any$q;
|
|
1378
|
+
static _zpp: Any$q;
|
|
1379
1379
|
static internal: boolean;
|
|
1380
|
-
static types: Any$
|
|
1381
|
-
static events: Any$
|
|
1382
|
-
space: Any$
|
|
1383
|
-
interaction: Any$
|
|
1384
|
-
constraint: Any$
|
|
1385
|
-
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;
|
|
1386
1386
|
precedence: number;
|
|
1387
1387
|
event: number;
|
|
1388
1388
|
type: number;
|
|
1389
1389
|
id: number;
|
|
1390
|
-
outer: Any$
|
|
1391
|
-
__class__: Any$
|
|
1390
|
+
outer: Any$q;
|
|
1391
|
+
__class__: Any$q;
|
|
1392
1392
|
constructor();
|
|
1393
1393
|
/** Sort comparator: higher precedence first, then by id descending. */
|
|
1394
1394
|
static setlt(a: ZPP_Listener, b: ZPP_Listener): boolean;
|
|
1395
|
-
swapEvent(_event
|
|
1395
|
+
swapEvent(_event?: number): void;
|
|
1396
1396
|
invalidate_precedence(): void;
|
|
1397
1397
|
addedToSpace(): void;
|
|
1398
1398
|
removedFromSpace(): void;
|
|
@@ -1464,20 +1464,20 @@ declare class ListenerType {
|
|
|
1464
1464
|
* Fully modernized from nape-compiled.js lines 231–433.
|
|
1465
1465
|
*/
|
|
1466
1466
|
|
|
1467
|
-
type Any$
|
|
1467
|
+
type Any$p = any;
|
|
1468
1468
|
declare class Listener {
|
|
1469
1469
|
static __name__: string[];
|
|
1470
1470
|
zpp_inner: ZPP_Listener;
|
|
1471
|
-
get _inner(): Any$
|
|
1471
|
+
get _inner(): Any$p;
|
|
1472
1472
|
constructor();
|
|
1473
|
-
static _wrap(inner: Any$
|
|
1473
|
+
static _wrap(inner: Any$p): Listener;
|
|
1474
1474
|
get type(): ListenerType;
|
|
1475
1475
|
get event(): CbEvent;
|
|
1476
1476
|
set event(event: CbEvent);
|
|
1477
1477
|
get precedence(): number;
|
|
1478
1478
|
set precedence(precedence: number);
|
|
1479
1479
|
get space(): Space | null;
|
|
1480
|
-
set space(space: Space | Any$
|
|
1480
|
+
set space(space: Space | Any$p | null);
|
|
1481
1481
|
toString(): string;
|
|
1482
1482
|
}
|
|
1483
1483
|
|
|
@@ -1554,10 +1554,274 @@ declare class BodyType {
|
|
|
1554
1554
|
toString(): string;
|
|
1555
1555
|
}
|
|
1556
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(_param: 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;
|
|
1557
1763
|
/**
|
|
1558
1764
|
* A rigid body in the physics simulation.
|
|
1765
|
+
*
|
|
1766
|
+
* Fully modernized — uses ZPP_Body directly (extracted to TypeScript).
|
|
1559
1767
|
*/
|
|
1560
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;
|
|
1561
1825
|
constructor(type?: BodyType, position?: Vec2);
|
|
1562
1826
|
/** @internal */
|
|
1563
1827
|
static _wrap(inner: NapeInner): Body;
|
|
@@ -1606,34 +1870,40 @@ declare class Body extends Interactor {
|
|
|
1606
1870
|
get shapes(): NapeList<Shape>;
|
|
1607
1871
|
get space(): Space;
|
|
1608
1872
|
set space(value: Space | null);
|
|
1609
|
-
get compound():
|
|
1610
|
-
set compound(value:
|
|
1611
|
-
_inner: NapeInner;
|
|
1612
|
-
} | null);
|
|
1873
|
+
get compound(): Any$n;
|
|
1874
|
+
set compound(value: Any$n);
|
|
1613
1875
|
get bounds(): AABB;
|
|
1614
1876
|
get constraintVelocity(): Vec2;
|
|
1615
1877
|
get localCOM(): Vec2;
|
|
1616
1878
|
get worldCOM(): Vec2;
|
|
1617
|
-
integrate(deltaTime: number): void;
|
|
1618
|
-
applyImpulse(impulse: Vec2, pos?: Vec2, sleepable?: boolean): void;
|
|
1619
|
-
applyAngularImpulse(impulse: number, sleepable?: boolean): void;
|
|
1620
|
-
setVelocityFromTarget(targetPosition: Vec2, targetRotation: number, deltaTime: number): void;
|
|
1621
|
-
localPointToWorld(point: Vec2, weak?: boolean): Vec2;
|
|
1622
|
-
worldPointToLocal(point: Vec2, weak?: boolean): Vec2;
|
|
1623
|
-
localVectorToWorld(vector: Vec2, weak?: boolean): Vec2;
|
|
1624
|
-
worldVectorToLocal(vector: Vec2, weak?: boolean): Vec2;
|
|
1625
|
-
translateShapes(translation: Vec2): void;
|
|
1626
|
-
rotateShapes(angle: number): void;
|
|
1627
|
-
scaleShapes(scaleX: number, scaleY: number): void;
|
|
1628
|
-
align(): void;
|
|
1629
|
-
rotate(centre: Vec2, angle: number): void;
|
|
1630
|
-
setShapeMaterials(material: Material): void;
|
|
1631
|
-
setShapeFilters(filter: InteractionFilter): void;
|
|
1632
|
-
setShapeFluidProperties(fluidProperties: FluidProperties): void;
|
|
1633
|
-
contains(point: Vec2): boolean;
|
|
1634
|
-
crushFactor(): number;
|
|
1635
1879
|
copy(): Body;
|
|
1636
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;
|
|
1637
1907
|
}
|
|
1638
1908
|
|
|
1639
1909
|
/**
|
|
@@ -1972,7 +2242,7 @@ declare class Arbiter {
|
|
|
1972
2242
|
* Total impulse of this arbiter. Base implementation returns Vec3(0,0,0).
|
|
1973
2243
|
* Overridden by CollisionArbiter and FluidArbiter.
|
|
1974
2244
|
*/
|
|
1975
|
-
totalImpulse(body?: Any$k,
|
|
2245
|
+
totalImpulse(body?: Any$k, _freshOnly?: boolean): Vec3;
|
|
1976
2246
|
toString(): string;
|
|
1977
2247
|
/** @internal */
|
|
1978
2248
|
protected _activeCheck(): void;
|
|
@@ -2059,7 +2329,7 @@ declare class FluidArbiter extends Arbiter {
|
|
|
2059
2329
|
/** Drag impulse applied by this fluid arbiter. */
|
|
2060
2330
|
dragImpulse(body?: Any$i): Vec3;
|
|
2061
2331
|
/** Total impulse (buoyancy + drag). */
|
|
2062
|
-
totalImpulse(body?: Any$i,
|
|
2332
|
+
totalImpulse(body?: Any$i, _freshOnly?: boolean): Vec3;
|
|
2063
2333
|
}
|
|
2064
2334
|
|
|
2065
2335
|
type Any$h = any;
|