@newkrok/nape-js 3.3.44 → 3.3.45

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.d.cts CHANGED
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Converted from nape-compiled.js lines 32346–32733.
9
9
  */
10
- type Any$12 = any;
10
+ type Any$17 = any;
11
11
  declare class ZPP_IContact {
12
12
  static __name__: string[];
13
13
  length: number;
@@ -29,7 +29,7 @@ declare class ZPP_IContact {
29
29
  lr1y: number;
30
30
  lr2x: number;
31
31
  lr2y: number;
32
- __class__: Any$12;
32
+ __class__: Any$17;
33
33
  elem(): this;
34
34
  begin(): ZPP_IContact | null;
35
35
  setbegin(i: ZPP_IContact | null): void;
@@ -73,19 +73,19 @@ declare class ZPP_IContact {
73
73
  * Converted from nape-compiled.js lines 31853–32345, 81644–81645.
74
74
  */
75
75
 
76
- type Any$11 = any;
76
+ type Any$16 = any;
77
77
  declare class ZPP_Contact {
78
78
  static __name__: string[];
79
- static _nape: Any$11;
80
- static _zpp: Any$11;
79
+ static _nape: Any$16;
80
+ static _zpp: Any$16;
81
81
  static zpp_pool: ZPP_Contact | null;
82
82
  static internal: boolean;
83
- static _wrapFn: ((zpp: ZPP_Contact) => Any$11) | null;
84
- outer: Any$11;
83
+ static _wrapFn: ((zpp: ZPP_Contact) => Any$16) | null;
84
+ outer: Any$16;
85
85
  px: number;
86
86
  py: number;
87
- wrap_position: Any$11;
88
- arbiter: Any$11;
87
+ wrap_position: Any$16;
88
+ arbiter: Any$16;
89
89
  inner: ZPP_IContact;
90
90
  active: boolean;
91
91
  posOnly: boolean;
@@ -99,9 +99,9 @@ declare class ZPP_Contact {
99
99
  modified: boolean;
100
100
  _inuse: boolean;
101
101
  next: ZPP_Contact | null;
102
- __class__: Any$11;
102
+ __class__: Any$16;
103
103
  constructor();
104
- wrapper(): Any$11;
104
+ wrapper(): Any$16;
105
105
  position_validate(): void;
106
106
  getposition(): void;
107
107
  inactiveme(): boolean;
@@ -166,13 +166,13 @@ declare function getNape(): any;
166
166
  *
167
167
  * Converted from nape-compiled.js lines 83820–84273, 134996.
168
168
  */
169
- type Any$10 = any;
169
+ type Any$15 = any;
170
170
  declare class ZPP_Vec2 {
171
171
  static zpp_pool: ZPP_Vec2 | null;
172
172
  static __name__: string[];
173
- static _nape: Any$10;
174
- static _zpp: Any$10;
175
- static _wrapFn: ((zpp: ZPP_Vec2) => Any$10) | null;
173
+ static _nape: Any$15;
174
+ static _zpp: Any$15;
175
+ static _wrapFn: ((zpp: ZPP_Vec2) => Any$15) | null;
176
176
  x: number;
177
177
  y: number;
178
178
  next: ZPP_Vec2 | null;
@@ -181,18 +181,18 @@ declare class ZPP_Vec2 {
181
181
  pushmod: boolean;
182
182
  _inuse: boolean;
183
183
  weak: boolean;
184
- outer: Any$10;
184
+ outer: Any$15;
185
185
  _immutable: boolean;
186
186
  _isimmutable: (() => void) | null;
187
187
  _validate: (() => void) | null;
188
188
  _invalidate: ((self: ZPP_Vec2) => void) | null;
189
- __class__: Any$10;
189
+ __class__: Any$15;
190
190
  /** Static factory with optional pooling and immutability. */
191
191
  static get(x: number, y: number, immutable?: boolean): ZPP_Vec2;
192
192
  validate(): void;
193
193
  invalidate(): void;
194
194
  immutable(): void;
195
- wrapper(): Any$10;
195
+ wrapper(): Any$15;
196
196
  free(): void;
197
197
  alloc(): void;
198
198
  elem(): ZPP_Vec2;
@@ -344,20 +344,20 @@ type NapeInner = any;
344
344
  *
345
345
  * Converted from nape-compiled.js lines 83412–83434.
346
346
  */
347
- type Any$$ = any;
347
+ type Any$14 = any;
348
348
  declare class ZPP_Vec3 {
349
349
  static __name__: string[];
350
- static _zpp: Any$$;
351
- static _wrapFn: ((zpp: ZPP_Vec3) => Any$$) | null;
352
- outer: Any$$;
350
+ static _zpp: Any$14;
351
+ static _wrapFn: ((zpp: ZPP_Vec3) => Any$14) | null;
352
+ outer: Any$14;
353
353
  x: number;
354
354
  y: number;
355
355
  z: number;
356
356
  immutable: boolean;
357
357
  _validate: (() => void) | null;
358
- __class__: Any$$;
358
+ __class__: Any$14;
359
359
  validate(): void;
360
- wrapper(): Any$$;
360
+ wrapper(): Any$14;
361
361
  }
362
362
 
363
363
  /**
@@ -421,13 +421,13 @@ declare class Vec3 {
421
421
  *
422
422
  * Converted from nape-compiled.js lines 73495–73561, 133826.
423
423
  */
424
- type Any$_ = any;
424
+ type Any$13 = any;
425
425
  declare class ZPP_Mat23 {
426
426
  static __name__: string[];
427
- static _nape: Any$_;
428
- static _wrapFn: ((zpp: ZPP_Mat23) => Any$_) | null;
427
+ static _nape: Any$13;
428
+ static _wrapFn: ((zpp: ZPP_Mat23) => Any$13) | null;
429
429
  static zpp_pool: ZPP_Mat23 | null;
430
- outer: Any$_;
430
+ outer: Any$13;
431
431
  a: number;
432
432
  b: number;
433
433
  c: number;
@@ -436,13 +436,13 @@ declare class ZPP_Mat23 {
436
436
  ty: number;
437
437
  _invalidate: (() => void) | null;
438
438
  next: ZPP_Mat23 | null;
439
- __class__: Any$_;
439
+ __class__: Any$13;
440
440
  /** Static factory with pooling. */
441
441
  static get(): ZPP_Mat23;
442
442
  /** Create an identity matrix from pool. */
443
443
  static identity(): ZPP_Mat23;
444
444
  /** Create a public wrapper, recycling any existing inner. */
445
- wrapper(): Any$_;
445
+ wrapper(): Any$13;
446
446
  invalidate(): void;
447
447
  set(m: ZPP_Mat23): void;
448
448
  setas(a: number, b: number, c: number, d: number, tx: number, ty: number): void;
@@ -503,13 +503,13 @@ declare class Mat23 {
503
503
  *
504
504
  * Converted from nape-compiled.js lines 69554–69563.
505
505
  */
506
- type Any$Z = any;
506
+ type Any$12 = any;
507
507
  declare class ZPP_GeomPoly {
508
508
  static __name__: string[];
509
- outer: Any$Z;
510
- vertices: Any$Z;
511
- __class__: Any$Z;
512
- constructor(outer?: Any$Z);
509
+ outer: Any$12;
510
+ vertices: Any$12;
511
+ __class__: Any$12;
512
+ constructor(outer?: Any$12);
513
513
  }
514
514
 
515
515
  /**
@@ -533,7 +533,7 @@ declare class Winding {
533
533
  toString(): string;
534
534
  }
535
535
 
536
- type Any$Y = any;
536
+ type Any$11 = any;
537
537
  /**
538
538
  * A polygon represented as a circular doubly-linked list of vertices.
539
539
  *
@@ -548,8 +548,8 @@ declare class GeomPoly {
548
548
  zpp_inner: ZPP_GeomPoly;
549
549
  zpp_pool: GeomPoly | null;
550
550
  zpp_disp: boolean;
551
- get _inner(): Any$Y;
552
- constructor(vertices?: Any$Y);
551
+ get _inner(): Any$11;
552
+ constructor(vertices?: Any$11);
553
553
  private _checkDisposed;
554
554
  /** @internal Get compiled ZPP_GeomVert class */
555
555
  private static _gvClass;
@@ -575,12 +575,12 @@ declare class GeomPoly {
575
575
  private static _addVertices;
576
576
  /** @internal After copying, dispose weak Vec2 inputs */
577
577
  private static _disposeWeakInputs;
578
- static get(vertices?: Any$Y): GeomPoly;
578
+ static get(vertices?: Any$11): GeomPoly;
579
579
  empty(): boolean;
580
580
  size(): number;
581
- iterator(): Any$Y;
582
- forwardIterator(): Any$Y;
583
- backwardsIterator(): Any$Y;
581
+ iterator(): Any$11;
582
+ forwardIterator(): Any$11;
583
+ backwardsIterator(): Any$11;
584
584
  current(): Vec2;
585
585
  push(vertex: Vec2): this;
586
586
  pop(): this;
@@ -593,7 +593,7 @@ declare class GeomPoly {
593
593
  copy(): GeomPoly;
594
594
  dispose(): void;
595
595
  area(): number;
596
- winding(): Any$Y;
596
+ winding(): Any$11;
597
597
  contains(point: Vec2): boolean;
598
598
  isClockwise(): boolean;
599
599
  isConvex(): boolean;
@@ -601,14 +601,14 @@ declare class GeomPoly {
601
601
  isMonotone(): boolean;
602
602
  isDegenerate(): boolean;
603
603
  simplify(epsilon: number): GeomPoly;
604
- simpleDecomposition(output?: Any$Y): Any$Y;
605
- monotoneDecomposition(output?: Any$Y): Any$Y;
606
- convexDecomposition(delaunay?: boolean, output?: Any$Y): Any$Y;
607
- triangularDecomposition(delaunay?: boolean, output?: Any$Y): Any$Y;
604
+ simpleDecomposition(output?: Any$11): Any$11;
605
+ monotoneDecomposition(output?: Any$11): Any$11;
606
+ convexDecomposition(delaunay?: boolean, output?: Any$11): Any$11;
607
+ triangularDecomposition(delaunay?: boolean, output?: Any$11): Any$11;
608
608
  inflate(inflation: number): GeomPoly;
609
- cut(start: Vec2, end: Vec2, boundedStart?: boolean, boundedEnd?: boolean, output?: Any$Y): Any$Y;
610
- transform(matrix: Any$Y): this;
611
- bounds(): Any$Y;
609
+ cut(start: Vec2, end: Vec2, boundedStart?: boolean, boundedEnd?: boolean, output?: Any$11): Any$11;
610
+ transform(matrix: Any$11): this;
611
+ bounds(): Any$11;
612
612
  top(): Vec2;
613
613
  bottom(): Vec2;
614
614
  left(): Vec2;
@@ -624,30 +624,30 @@ declare class GeomPoly {
624
624
  *
625
625
  * Converted from nape-compiled.js lines 63546–63965, 134951.
626
626
  */
627
- type Any$X = any;
627
+ type Any$10 = any;
628
628
  declare class ZPP_AABB {
629
629
  static zpp_pool: ZPP_AABB | null;
630
630
  static __name__: string[];
631
- static _nape: Any$X;
632
- static _zpp: Any$X;
633
- static _wrapFn: ((zpp: ZPP_AABB) => Any$X) | null;
631
+ static _nape: Any$10;
632
+ static _zpp: Any$10;
633
+ static _wrapFn: ((zpp: ZPP_AABB) => Any$10) | null;
634
634
  _invalidate: ((self: ZPP_AABB) => void) | null;
635
635
  _validate: (() => void) | null;
636
636
  _immutable: boolean;
637
- outer: Any$X;
637
+ outer: Any$10;
638
638
  next: ZPP_AABB | null;
639
639
  minx: number;
640
640
  miny: number;
641
641
  maxx: number;
642
642
  maxy: number;
643
- wrap_min: Any$X;
644
- wrap_max: Any$X;
645
- __class__: Any$X;
643
+ wrap_min: Any$10;
644
+ wrap_max: Any$10;
645
+ __class__: Any$10;
646
646
  /** Static factory with pooling. */
647
647
  static get(minx: number, miny: number, maxx: number, maxy: number): ZPP_AABB;
648
648
  validate(): void;
649
649
  invalidate(): void;
650
- wrapper(): Any$X;
650
+ wrapper(): Any$10;
651
651
  alloc(): void;
652
652
  free(): void;
653
653
  copy(): ZPP_AABB;
@@ -658,10 +658,10 @@ declare class ZPP_AABB {
658
658
  private static _makeVec2Wrapper;
659
659
  getmin(): void;
660
660
  dom_min(): void;
661
- mod_min(min: Any$X): void;
661
+ mod_min(min: Any$10): void;
662
662
  getmax(): void;
663
663
  dom_max(): void;
664
- mod_max(max: Any$X): void;
664
+ mod_max(max: Any$10): void;
665
665
  intersectX(x: ZPP_AABB): boolean;
666
666
  intersectY(x: ZPP_AABB): boolean;
667
667
  intersect(x: ZPP_AABB): boolean;
@@ -725,18 +725,18 @@ declare class AABB {
725
725
  *
726
726
  * Converted from nape-compiled.js lines 72949–72972.
727
727
  */
728
- type Any$W = any;
728
+ type Any$$ = any;
729
729
  declare class ZPP_MatMN {
730
730
  static __name__: string[];
731
- outer: Any$W;
731
+ outer: Any$$;
732
732
  m: number;
733
733
  n: number;
734
734
  x: number[];
735
- __class__: Any$W;
735
+ __class__: Any$$;
736
736
  constructor(m: number, n: number);
737
737
  }
738
738
 
739
- type Any$V = any;
739
+ type Any$_ = any;
740
740
  /**
741
741
  * Variable-sized M×N matrix.
742
742
  *
@@ -747,7 +747,7 @@ declare class MatMN {
747
747
  zpp_inner: ZPP_MatMN;
748
748
  get _inner(): NapeInner;
749
749
  constructor(rows: number, cols: number);
750
- static _wrap(inner: Any$V): MatMN;
750
+ static _wrap(inner: Any$_): MatMN;
751
751
  get rows(): number;
752
752
  get cols(): number;
753
753
  x(row: number, col: number): number;
@@ -757,7 +757,7 @@ declare class MatMN {
757
757
  mul(matrix: MatMN): MatMN;
758
758
  }
759
759
 
760
- type Any$U = any;
760
+ type Any$Z = any;
761
761
  /**
762
762
  * Isosurface extraction using the marching squares algorithm.
763
763
  *
@@ -780,7 +780,7 @@ declare class MarchingSquares {
780
780
  * @param output - Optional GeomPolyList to populate. If null, a new one is created.
781
781
  * @returns The populated GeomPolyList.
782
782
  */
783
- static run(iso: (x: number, y: number) => number, bounds: AABB, cellsize: Vec2, quality?: number, subgrid?: Vec2 | null, combine?: boolean, output?: Any$U): Any$U;
783
+ static run(iso: (x: number, y: number) => number, bounds: AABB, cellsize: Vec2, quality?: number, subgrid?: Vec2 | null, combine?: boolean, output?: Any$Z): Any$Z;
784
784
  }
785
785
 
786
786
  /**
@@ -792,7 +792,7 @@ declare class MarchingSquares {
792
792
  * Converted from nape-compiled.js lines 31239–33172, 65896.
793
793
  */
794
794
 
795
- type Any$T = any;
795
+ type Any$Y = any;
796
796
  declare class ZPP_Ray {
797
797
  static __name__: string[];
798
798
  static internal: boolean;
@@ -807,30 +807,30 @@ declare class ZPP_Ray {
807
807
  dirx: number;
808
808
  originy: number;
809
809
  originx: number;
810
- userData: Any$T;
810
+ userData: Any$Y;
811
811
  maxdist: number;
812
- direction: Any$T;
813
- origin: Any$T;
814
- __class__: Any$T;
812
+ direction: Any$Y;
813
+ origin: Any$Y;
814
+ __class__: Any$Y;
815
815
  constructor();
816
- origin_invalidate(x: Any$T): void;
817
- direction_invalidate(x: Any$T): void;
816
+ origin_invalidate(x: Any$Y): void;
817
+ direction_invalidate(x: Any$Y): void;
818
818
  invalidate_dir(): void;
819
819
  validate_dir(): void;
820
820
  rayAABB(): ZPP_AABB;
821
- aabbtest(a: Any$T): boolean;
822
- aabbsect(a: Any$T): number;
821
+ aabbtest(a: Any$Y): boolean;
822
+ aabbsect(a: Any$Y): number;
823
823
  private static _allocVec2;
824
824
  private static _validateWorldCOM;
825
825
  private _circleNormal;
826
826
  private static _insertSorted;
827
- circlesect(c: Any$T, inner: boolean, mint: number): Any$T;
828
- circlesect2(c: Any$T, inner: boolean, list: Any$T): void;
829
- polysect(p: Any$T, inner: boolean, mint: number): Any$T;
830
- polysect2(p: Any$T, inner: boolean, list: Any$T): void;
827
+ circlesect(c: Any$Y, inner: boolean, mint: number): Any$Y;
828
+ circlesect2(c: Any$Y, inner: boolean, list: Any$Y): void;
829
+ polysect(p: Any$Y, inner: boolean, mint: number): Any$Y;
830
+ polysect2(p: Any$Y, inner: boolean, list: Any$Y): void;
831
831
  }
832
832
 
833
- type Any$S = any;
833
+ type Any$X = any;
834
834
  /**
835
835
  * A ray for raycasting queries.
836
836
  *
@@ -844,7 +844,7 @@ declare class Ray {
844
844
  get _inner(): this;
845
845
  constructor(origin: Vec2, direction: Vec2);
846
846
  /** @internal */
847
- static _wrap(inner: Any$S): Ray;
847
+ static _wrap(inner: Any$X): Ray;
848
848
  static fromSegment(start: Vec2, end: Vec2): Ray;
849
849
  get origin(): Vec2;
850
850
  set origin(value: Vec2);
@@ -862,7 +862,7 @@ declare class Ray {
862
862
  /** @internal */ set_direction(v: Vec2): Vec2;
863
863
  /** @internal */ get_maxDistance(): number;
864
864
  /** @internal */ set_maxDistance(v: number): number;
865
- /** @internal */ get_userData(): Any$S;
865
+ /** @internal */ get_userData(): Any$X;
866
866
  }
867
867
 
868
868
  /**
@@ -873,31 +873,31 @@ declare class Ray {
873
873
  *
874
874
  * Converted from nape-compiled.js lines 38897–39076, 86860–86862.
875
875
  */
876
- type Any$R = any;
876
+ type Any$W = any;
877
877
  declare class ZPP_ConvexRayResult {
878
878
  static __name__: string[];
879
879
  static rayPool: ZPP_ConvexRayResult | null;
880
880
  static convexPool: ZPP_ConvexRayResult | null;
881
881
  static internal: boolean;
882
- static _createRayResult: (() => Any$R) | null;
883
- static _createConvexResult: (() => Any$R) | null;
884
- normal: Any$R;
885
- shape: Any$R;
886
- convex: Any$R;
887
- position: Any$R;
888
- ray: Any$R;
882
+ static _createRayResult: (() => Any$W) | null;
883
+ static _createConvexResult: (() => Any$W) | null;
884
+ normal: Any$W;
885
+ shape: Any$W;
886
+ convex: Any$W;
887
+ position: Any$W;
888
+ ray: Any$W;
889
889
  inner: boolean;
890
890
  next: ZPP_ConvexRayResult | null;
891
891
  toiDistance: number;
892
- __class__: Any$R;
893
- static getRay(normal: Any$R, time: number, inner: boolean, shape: Any$R): Any$R;
894
- static getConvex(normal: Any$R, position: Any$R, toiDistance: number, shape: Any$R): Any$R;
892
+ __class__: Any$W;
893
+ static getRay(normal: Any$W, time: number, inner: boolean, shape: Any$W): Any$W;
894
+ static getConvex(normal: Any$W, position: Any$W, toiDistance: number, shape: Any$W): Any$W;
895
895
  disposed(): void;
896
896
  free(): void;
897
897
  private static _disposeVec2;
898
898
  }
899
899
 
900
- type Any$Q = any;
900
+ type Any$V = any;
901
901
  /**
902
902
  * Result from a convex-cast query.
903
903
  *
@@ -912,18 +912,18 @@ declare class ConvexResult {
912
912
  get _inner(): NapeInner;
913
913
  constructor();
914
914
  /** @internal */
915
- static _wrap(inner: Any$Q): ConvexResult;
915
+ static _wrap(inner: Any$V): ConvexResult;
916
916
  get normal(): Vec2;
917
917
  get position(): Vec2;
918
918
  get toi(): number;
919
- get shape(): Any$Q;
919
+ get shape(): Any$V;
920
920
  dispose(): void;
921
921
  toString(): string;
922
922
  /** @internal */
923
923
  private _disposed;
924
924
  }
925
925
 
926
- type Any$P = any;
926
+ type Any$U = any;
927
927
  /**
928
928
  * Result from a raycast query.
929
929
  *
@@ -938,11 +938,11 @@ declare class RayResult {
938
938
  get _inner(): NapeInner;
939
939
  constructor();
940
940
  /** @internal */
941
- static _wrap(inner: Any$P): RayResult;
941
+ static _wrap(inner: Any$U): RayResult;
942
942
  get normal(): Vec2;
943
943
  get distance(): number;
944
944
  get inner(): boolean;
945
- get shape(): Any$P;
945
+ get shape(): Any$U;
946
946
  dispose(): void;
947
947
  toString(): string;
948
948
  /** @internal */
@@ -1010,7 +1010,7 @@ declare class NapeList<T> implements Iterable<T> {
1010
1010
  *
1011
1011
  * Converted from nape-compiled.js lines 21424–21827.
1012
1012
  */
1013
- type Any$O = any;
1013
+ type Any$T = any;
1014
1014
  declare class ZPP_Constraint {
1015
1015
  static __name__: string[];
1016
1016
  /**
@@ -1018,13 +1018,13 @@ declare class ZPP_Constraint {
1018
1018
  * _nape = the `nape` public namespace (for CbTypeIterator in copyto)
1019
1019
  * _zpp = the `zpp_nape` internal namespace (for ZNPList_*, ZPP_CbSet, etc.)
1020
1020
  */
1021
- static _nape: Any$O;
1022
- static _zpp: Any$O;
1023
- outer: Any$O;
1021
+ static _nape: Any$T;
1022
+ static _zpp: Any$T;
1023
+ outer: Any$T;
1024
1024
  id: number;
1025
- userData: Any$O;
1026
- compound: Any$O;
1027
- space: Any$O;
1025
+ userData: Any$T;
1026
+ compound: Any$T;
1027
+ space: Any$T;
1028
1028
  active: boolean;
1029
1029
  stiff: boolean;
1030
1030
  frequency: number;
@@ -1034,14 +1034,14 @@ declare class ZPP_Constraint {
1034
1034
  breakUnderForce: boolean;
1035
1035
  breakUnderError: boolean;
1036
1036
  removeOnBreak: boolean;
1037
- component: Any$O;
1037
+ component: Any$T;
1038
1038
  ignore: boolean;
1039
1039
  __velocity: boolean;
1040
- cbTypes: Any$O;
1041
- cbSet: Any$O;
1042
- wrap_cbTypes: Any$O;
1040
+ cbTypes: Any$T;
1041
+ cbSet: Any$T;
1042
+ wrap_cbTypes: Any$T;
1043
1043
  pre_dt: number;
1044
- __class__: Any$O;
1044
+ __class__: Any$T;
1045
1045
  constructor();
1046
1046
  /**
1047
1047
  * Initialise base constraint fields.
@@ -1059,18 +1059,18 @@ declare class ZPP_Constraint {
1059
1059
  forest(): void;
1060
1060
  broken(): void;
1061
1061
  warmStart(): void;
1062
- draw(_g: Any$O): void;
1063
- pair_exists(_id: Any$O, _di: Any$O): boolean;
1062
+ draw(_g: Any$T): void;
1063
+ pair_exists(_id: Any$T, _di: Any$T): boolean;
1064
1064
  preStep(_dt: number): boolean;
1065
1065
  applyImpulseVel(): boolean;
1066
1066
  applyImpulsePos(): boolean;
1067
- copy(_dict?: Any$O, _todo?: Any$O): Any$O;
1067
+ copy(_dict?: Any$T, _todo?: Any$T): Any$T;
1068
1068
  immutable_midstep(name: string): void;
1069
1069
  setupcbTypes(): void;
1070
1070
  immutable_cbTypes(): void;
1071
- wrap_cbTypes_subber(pcb: Any$O): void;
1072
- wrap_cbTypes_adder(cb: Any$O): boolean;
1073
- insert_cbtype(cb: Any$O): void;
1071
+ wrap_cbTypes_subber(pcb: Any$T): void;
1072
+ wrap_cbTypes_adder(cb: Any$T): boolean;
1073
+ insert_cbtype(cb: Any$T): void;
1074
1074
  alloc_cbSet(): void;
1075
1075
  dealloc_cbSet(): void;
1076
1076
  activate(): void;
@@ -1080,12 +1080,12 @@ declare class ZPP_Constraint {
1080
1080
  activeInSpace(): void;
1081
1081
  inactiveOrOutSpace(): void;
1082
1082
  wake(): void;
1083
- copyto(ret: Any$O): void;
1084
- static _findRoot(comp: Any$O): Any$O;
1085
- static _unionComponents(a: Any$O, b: Any$O): void;
1083
+ copyto(ret: Any$T): void;
1084
+ static _findRoot(comp: Any$T): Any$T;
1085
+ static _unionComponents(a: Any$T, b: Any$T): void;
1086
1086
  }
1087
1087
 
1088
- type Any$N = any;
1088
+ type Any$S = any;
1089
1089
  /**
1090
1090
  * Base class for all constraints / joints.
1091
1091
  *
@@ -1102,16 +1102,16 @@ declare class Constraint {
1102
1102
  * are fully modernized. Also serves as backward compat for compiled code.
1103
1103
  * @internal
1104
1104
  */
1105
- _inner: Any$N;
1105
+ _inner: Any$S;
1106
1106
  debugDraw: boolean;
1107
1107
  /** @internal */
1108
1108
  protected constructor();
1109
1109
  /** @internal */
1110
- static _wrap(inner: Any$N): Constraint;
1110
+ static _wrap(inner: Any$S): Constraint;
1111
1111
  get space(): Space | null;
1112
1112
  set space(value: Space | null);
1113
- get compound(): Any$N;
1114
- set compound(value: Any$N);
1113
+ get compound(): Any$S;
1114
+ set compound(value: Any$S);
1115
1115
  get active(): boolean;
1116
1116
  set active(value: boolean);
1117
1117
  get ignore(): boolean;
@@ -1134,17 +1134,17 @@ declare class Constraint {
1134
1134
  set removeOnBreak(value: boolean);
1135
1135
  get isSleeping(): boolean;
1136
1136
  get userData(): Record<string, unknown>;
1137
- get cbTypes(): Any$N;
1138
- impulse(): Any$N;
1139
- bodyImpulse(_body: Body): Any$N;
1137
+ get cbTypes(): Any$S;
1138
+ impulse(): Any$S;
1139
+ bodyImpulse(_body: Body): Any$S;
1140
1140
  visitBodies(_fn: (body: Body) => void): void;
1141
1141
  copy(): Constraint;
1142
1142
  toString(): string;
1143
- /** @internal */ get_userData(): Any$N;
1144
- /** @internal */ get_compound(): Any$N;
1145
- /** @internal */ set_compound(v: Any$N): Any$N;
1146
- /** @internal */ get_space(): Any$N;
1147
- /** @internal */ set_space(v: Any$N): Any$N;
1143
+ /** @internal */ get_userData(): Any$S;
1144
+ /** @internal */ get_compound(): Any$S;
1145
+ /** @internal */ set_compound(v: Any$S): Any$S;
1146
+ /** @internal */ get_space(): Any$S;
1147
+ /** @internal */ set_space(v: Any$S): Any$S;
1148
1148
  /** @internal */ get_isSleeping(): boolean;
1149
1149
  /** @internal */ get_active(): boolean;
1150
1150
  /** @internal */ set_active(v: boolean): boolean;
@@ -1166,179 +1166,369 @@ declare class Constraint {
1166
1166
  /** @internal */ set_breakUnderError(v: boolean): boolean;
1167
1167
  /** @internal */ get_removeOnBreak(): boolean;
1168
1168
  /** @internal */ set_removeOnBreak(v: boolean): boolean;
1169
- /** @internal */ get_cbTypes(): Any$N;
1169
+ /** @internal */ get_cbTypes(): Any$S;
1170
1170
  }
1171
1171
 
1172
1172
  /**
1173
- * ZPP_Listener — Internal listener base class for the nape physics engine.
1173
+ * ZPP_InteractionFilter — Internal interaction filter for the nape physics engine.
1174
1174
  *
1175
- * Base class for ZPP_BodyListener, ZPP_ConstraintListener, and
1176
- * ZPP_InteractionListener. Holds common properties (space, precedence,
1177
- * event type, listener type) and provides stub methods for subclass override.
1175
+ * Stores collision/sensor/fluid group and mask bitmasks that determine
1176
+ * which shapes interact with each other.
1178
1177
  *
1179
- * Converted from nape-compiled.js lines 2725927304, 112053–112139.
1178
+ * Converted from nape-compiled.js lines 6325563366, 135329.
1180
1179
  */
1181
- type Any$M = any;
1182
- declare class ZPP_Listener {
1180
+ type Any$R = any;
1181
+ declare class ZPP_InteractionFilter {
1182
+ static zpp_pool: ZPP_InteractionFilter | null;
1183
1183
  static __name__: string[];
1184
- static _nape: Any$M;
1185
- static _zpp: Any$M;
1186
- static internal: boolean;
1187
- static types: Any$M[];
1188
- static events: Any$M[];
1189
- space: Any$M;
1190
- interaction: Any$M;
1191
- constraint: Any$M;
1192
- body: Any$M;
1193
- precedence: number;
1194
- event: number;
1195
- type: number;
1196
- id: number;
1197
- outer: Any$M;
1198
- __class__: Any$M;
1184
+ static _nape: Any$R;
1185
+ static _zpp: Any$R;
1186
+ static _wrapFn: ((zpp: ZPP_InteractionFilter) => Any$R) | null;
1187
+ collisionGroup: number;
1188
+ collisionMask: number;
1189
+ sensorGroup: number;
1190
+ sensorMask: number;
1191
+ fluidGroup: number;
1192
+ fluidMask: number;
1193
+ shapes: Any$R;
1194
+ wrap_shapes: Any$R;
1195
+ outer: Any$R;
1196
+ userData: Any$R;
1197
+ next: ZPP_InteractionFilter | null;
1198
+ __class__: Any$R;
1199
1199
  constructor();
1200
- /** Sort comparator: higher precedence first, then by id descending. */
1201
- static setlt(a: ZPP_Listener, b: ZPP_Listener): boolean;
1202
- swapEvent(_event?: number): void;
1203
- invalidate_precedence(): void;
1204
- addedToSpace(): void;
1205
- removedFromSpace(): void;
1200
+ /** Create/return the public nape.dynamics.InteractionFilter wrapper. */
1201
+ wrapper(): Any$R;
1202
+ free(): void;
1203
+ alloc(): void;
1204
+ feature_cons(): void;
1205
+ addShape(shape: Any$R): void;
1206
+ remShape(shape: Any$R): void;
1207
+ /** Create a copy with object pooling. */
1208
+ copy(): ZPP_InteractionFilter;
1209
+ /** Test whether two filters allow collision between their shapes. */
1210
+ shouldCollide(x: ZPP_InteractionFilter): boolean;
1211
+ /** Test whether two filters allow sensor interaction. */
1212
+ shouldSense(x: ZPP_InteractionFilter): boolean;
1213
+ /** Test whether two filters allow fluid interaction. */
1214
+ shouldFlow(x: ZPP_InteractionFilter): boolean;
1215
+ /** Notify all shapes that the filter changed. */
1216
+ invalidate(): void;
1206
1217
  }
1207
1218
 
1208
1219
  /**
1209
- * Callback event types.
1220
+ * Bit-mask based interaction filter for controlling which shapes
1221
+ * collide, sense, or interact as fluids.
1210
1222
  *
1211
- * - `BEGIN` — interaction just started
1212
- * - `ONGOING` interaction continues
1213
- * - `END` — interaction just ended
1214
- * - `WAKE` — body/constraint woke up
1215
- * - `SLEEP` — body/constraint went to sleep
1216
- * - `BREAK` — constraint was broken
1217
- * - `PRE` — pre-interaction callback
1223
+ * Internally wraps a ZPP_InteractionFilter and is registered as
1224
+ * the public `nape.dynamics.InteractionFilter` class in the compiled namespace.
1218
1225
  *
1219
- * Converted from nape-compiled.js lines 516657.
1226
+ * Converted from nape-compiled.js lines 1436114640.
1220
1227
  */
1221
- declare class CbEvent {
1228
+ declare class InteractionFilter {
1222
1229
  static __name__: string[];
1223
- constructor();
1224
- static get BEGIN(): CbEvent;
1225
- static get ONGOING(): CbEvent;
1226
- static get END(): CbEvent;
1227
- static get WAKE(): CbEvent;
1228
- static get SLEEP(): CbEvent;
1229
- static get BREAK(): CbEvent;
1230
- static get PRE(): CbEvent;
1231
- static get_BEGIN(): CbEvent;
1232
- static get_ONGOING(): CbEvent;
1233
- static get_END(): CbEvent;
1234
- static get_WAKE(): CbEvent;
1235
- static get_SLEEP(): CbEvent;
1236
- static get_BREAK(): CbEvent;
1237
- static get_PRE(): CbEvent;
1230
+ /** @internal The internal ZPP_InteractionFilter this wrapper owns. */
1231
+ zpp_inner: ZPP_InteractionFilter;
1232
+ /**
1233
+ * Backward-compatible accessor — returns `this` so that compiled engine
1234
+ * code that receives `filter._inner` can still access `zpp_inner`.
1235
+ * @internal
1236
+ */
1237
+ get _inner(): NapeInner;
1238
+ constructor(collisionGroup?: number, collisionMask?: number, sensorGroup?: number, sensorMask?: number, fluidGroup?: number, fluidMask?: number);
1239
+ /** @internal Wrap a ZPP_InteractionFilter (or legacy compiled InteractionFilter) with caching. */
1240
+ static _wrap(inner: any): InteractionFilter;
1241
+ get collisionGroup(): number;
1242
+ set collisionGroup(value: number);
1243
+ get collisionMask(): number;
1244
+ set collisionMask(value: number);
1245
+ get sensorGroup(): number;
1246
+ set sensorGroup(value: number);
1247
+ get sensorMask(): number;
1248
+ set sensorMask(value: number);
1249
+ get fluidGroup(): number;
1250
+ set fluidGroup(value: number);
1251
+ get fluidMask(): number;
1252
+ set fluidMask(value: number);
1253
+ get userData(): Record<string, unknown>;
1254
+ get shapes(): any;
1255
+ shouldCollide(filter: InteractionFilter): boolean;
1256
+ shouldSense(filter: InteractionFilter): boolean;
1257
+ shouldFlow(filter: InteractionFilter): boolean;
1258
+ copy(): InteractionFilter;
1238
1259
  toString(): string;
1239
1260
  }
1240
1261
 
1241
1262
  /**
1242
- * Listener type classification.
1263
+ * ZPP_Callback Internal callback data holder for the nape physics engine.
1243
1264
  *
1244
- * - `BODY` — body event listener
1245
- * - `CONSTRAINT` — constraint event listener
1246
- * - `INTERACTION` — interaction event listener
1247
- * - `PRE` — pre-interaction listener
1265
+ * Stores callback event information (listener, event type, interactors, etc.)
1266
+ * and forms a doubly-linked list for callback queue management.
1248
1267
  *
1249
- * Converted from nape-compiled.js lines 25542646.
1268
+ * Converted from nape-compiled.js lines 4458744794, 133299–133300.
1250
1269
  */
1251
- declare class ListenerType {
1270
+ type Any$Q = any;
1271
+ declare class ZPP_Callback {
1252
1272
  static __name__: string[];
1253
- static BODY: ListenerType | null;
1254
- static CONSTRAINT: ListenerType | null;
1255
- static INTERACTION: ListenerType | null;
1256
- static PRE: ListenerType | null;
1257
- constructor();
1258
- static get_BODY(): ListenerType;
1259
- static get_CONSTRAINT(): ListenerType;
1260
- static get_INTERACTION(): ListenerType;
1261
- static get_PRE(): ListenerType;
1262
- toString(): string;
1273
+ static _nape: Any$Q;
1274
+ static _zpp: Any$Q;
1275
+ static internal: boolean;
1276
+ static zpp_pool: ZPP_Callback | null;
1277
+ outer_body: Any$Q;
1278
+ outer_con: Any$Q;
1279
+ outer_int: Any$Q;
1280
+ event: number;
1281
+ listener: Any$Q;
1282
+ space: Any$Q;
1283
+ index: number;
1284
+ next: ZPP_Callback | null;
1285
+ prev: ZPP_Callback | null;
1286
+ length: number;
1287
+ int1: Any$Q;
1288
+ int2: Any$Q;
1289
+ set: Any$Q;
1290
+ wrap_arbiters: Any$Q;
1291
+ pre_arbiter: Any$Q;
1292
+ pre_swapped: boolean;
1293
+ body: Any$Q;
1294
+ constraint: Any$Q;
1295
+ __class__: Any$Q;
1296
+ wrapper_body(): Any$Q;
1297
+ wrapper_con(): Any$Q;
1298
+ wrapper_int(): Any$Q;
1299
+ push(obj: ZPP_Callback): void;
1300
+ push_rev(obj: ZPP_Callback): void;
1301
+ pop(): ZPP_Callback;
1302
+ pop_rev(): ZPP_Callback;
1303
+ empty(): boolean;
1304
+ clear(): void;
1305
+ splice(o: ZPP_Callback): ZPP_Callback | null;
1306
+ rotateL(): void;
1307
+ rotateR(): void;
1308
+ cycleNext(o: ZPP_Callback): ZPP_Callback | null;
1309
+ cyclePrev(o: ZPP_Callback): ZPP_Callback | null;
1310
+ at(i: number): ZPP_Callback;
1311
+ rev_at(i: number): ZPP_Callback;
1312
+ free(): void;
1313
+ alloc(): void;
1314
+ genarbs(): void;
1263
1315
  }
1264
1316
 
1265
1317
  /**
1266
- * Listener Base class for all physics event listeners.
1267
- *
1268
- * Provides common properties (type, event, precedence, space) and
1269
- * toString() for all listener subclasses.
1318
+ * ZPP_Space -- Internal space implementation (core simulation loop).
1319
+ * Converted from nape-compiled.js lines 30236-43690.
1270
1320
  *
1271
- * Fully modernized from nape-compiled.js lines 231–433.
1321
+ * This is the largest and most complex class in the engine (~13,450 lines).
1322
+ * It handles integration, constraint solving, broadphase management,
1323
+ * sleeping/waking, and callback dispatch.
1272
1324
  */
1273
1325
 
1274
- type Any$L = any;
1275
- declare class Listener {
1326
+ type Any$P = any;
1327
+ declare class ZPP_Space {
1276
1328
  static __name__: string[];
1277
- zpp_inner: ZPP_Listener;
1278
- get _inner(): Any$L;
1279
- constructor();
1280
- static _wrap(inner: Any$L): Listener;
1281
- get type(): ListenerType;
1282
- get event(): CbEvent;
1283
- set event(event: CbEvent);
1284
- get precedence(): number;
1285
- set precedence(precedence: number);
1286
- get space(): Space | null;
1287
- set space(space: Space | Any$L | null);
1288
- toString(): string;
1329
+ static _zpp: Any$P;
1330
+ static _nape: Any$P;
1331
+ outer: Any$P;
1332
+ userData: Any$P;
1333
+ gravityx: Any$P;
1334
+ gravityy: Any$P;
1335
+ wrap_gravity: Any$P;
1336
+ bodies: Any$P;
1337
+ wrap_bodies: Any$P;
1338
+ compounds: Any$P;
1339
+ wrap_compounds: Any$P;
1340
+ constraints: Any$P;
1341
+ wrap_constraints: Any$P;
1342
+ kinematics: Any$P;
1343
+ bphase: Any$P;
1344
+ __static: Any$P;
1345
+ global_lin_drag: Any$P;
1346
+ global_ang_drag: Any$P;
1347
+ stamp: Any$P;
1348
+ midstep: Any$P;
1349
+ time: Any$P;
1350
+ sortcontacts: Any$P;
1351
+ c_arbiters_true: Any$P;
1352
+ c_arbiters_false: Any$P;
1353
+ f_arbiters: Any$P;
1354
+ s_arbiters: Any$P;
1355
+ wrap_arbiters: Any$P;
1356
+ live: Any$P;
1357
+ wrap_live: Any$P;
1358
+ live_constraints: Any$P;
1359
+ wrap_livecon: Any$P;
1360
+ staticsleep: Any$P;
1361
+ islands: Any$P;
1362
+ listeners: Any$P;
1363
+ wrap_listeners: Any$P;
1364
+ callbacks: Any$P;
1365
+ callbackset_list: Any$P;
1366
+ cbsets: Any$P;
1367
+ convexShapeList: Any$P;
1368
+ pre_dt: Any$P;
1369
+ toiEvents: Any$P;
1370
+ continuous: Any$P;
1371
+ precb: Any$P;
1372
+ prelisteners: Any$P;
1373
+ mrca1: Any$P;
1374
+ mrca2: Any$P;
1375
+ __class__: Any$P;
1376
+ constructor(gravity?: Any$P, broadphase?: Any$P);
1377
+ getgravity(): void;
1378
+ gravity_invalidate(x: Any$P): void;
1379
+ gravity_validate(): void;
1380
+ clear(): void;
1381
+ bodies_adder(x: Any$P): boolean;
1382
+ bodies_subber(x: Any$P): void;
1383
+ bodies_modifiable(): void;
1384
+ compounds_adder(x: Any$P): boolean;
1385
+ compounds_subber(x: Any$P): void;
1386
+ compounds_modifiable(): void;
1387
+ constraints_adder(x: Any$P): boolean;
1388
+ constraints_subber(x: Any$P): void;
1389
+ constraints_modifiable(): void;
1390
+ listeners_adder(x: Any$P): boolean;
1391
+ listeners_subber(x: Any$P): void;
1392
+ listeners_modifiable(): void;
1393
+ revoke_listener(x: Any$P): void;
1394
+ unrevoke_listener(x: Any$P): void;
1395
+ addListener(x: Any$P): void;
1396
+ remListener(x: Any$P): void;
1397
+ add_callbackset(cb: Any$P): void;
1398
+ remove_callbackset(cb: Any$P): void;
1399
+ transmitType(p: Any$P, new_type: Any$P): void;
1400
+ added_shape(s: Any$P, dontwake: Any$P): void;
1401
+ removed_shape(s: Any$P, deleting: Any$P): void;
1402
+ addConstraint(con: Any$P): void;
1403
+ remConstraint(con: Any$P): void;
1404
+ addCompound(x: Any$P): void;
1405
+ remCompound(x: Any$P): void;
1406
+ addBody(body: Any$P, flag?: Any$P): void;
1407
+ remBody(body: Any$P, flag?: Any$P): void;
1408
+ shapesUnderPoint(x: Any$P, y: Any$P, filter: Any$P, output: Any$P): any;
1409
+ bodiesUnderPoint(x: Any$P, y: Any$P, filter: Any$P, output: Any$P): any;
1410
+ shapesInAABB(aabb: Any$P, strict: Any$P, cont: Any$P, filter: Any$P, output: Any$P): any;
1411
+ bodiesInAABB(aabb: Any$P, strict: Any$P, cont: Any$P, filter: Any$P, output: Any$P): any;
1412
+ shapesInCircle(pos: Any$P, rad: Any$P, cont: Any$P, filter: Any$P, output: Any$P): any;
1413
+ bodiesInCircle(pos: Any$P, rad: Any$P, cont: Any$P, filter: Any$P, output: Any$P): any;
1414
+ shapesInShape(shape: Any$P, cont: Any$P, filter: Any$P, output: Any$P): any;
1415
+ bodiesInShape(shape: Any$P, cont: Any$P, filter: Any$P, output: Any$P): any;
1416
+ rayCast(ray: Any$P, inner: Any$P, filter: Any$P): any;
1417
+ rayMultiCast(ray: Any$P, inner: Any$P, filter: Any$P, output: Any$P): any;
1418
+ convexCast(shape: Any$P, deltaTime: Any$P, filter: Any$P, dynamics: Any$P): any;
1419
+ prepareCast(s: Any$P): void;
1420
+ convexMultiCast(shape: Any$P, deltaTime: Any$P, filter: Any$P, dynamics: Any$P, output: Any$P): any;
1421
+ push_callback(i: Any$P): ZPP_Callback;
1422
+ step(deltaTime: Any$P, velocityIterations: Any$P, positionIterations: Any$P): void;
1423
+ continuousCollisions(deltaTime: Any$P): void;
1424
+ continuousEvent(s1: Any$P, s2: Any$P, stat: Any$P, in_arb: Any$P, _: Any$P): any;
1425
+ bodyCbWake(b: Any$P): void;
1426
+ bodyCbSleep(b: Any$P): void;
1427
+ constraintCbWake(con: Any$P): void;
1428
+ constraintCbSleep(con: Any$P): void;
1429
+ constraintCbBreak(con: Any$P): void;
1430
+ nullListenerType(cb1: Any$P, cb2: Any$P): void;
1431
+ nullInteractorType(intx: Any$P, me: Any$P): void;
1432
+ freshListenerType(cb1: Any$P, cb2: Any$P): void;
1433
+ freshInteractorType(intx: Any$P, me: Any$P): void;
1434
+ wakeCompound(x: Any$P): void;
1435
+ wakeIsland(i: Any$P): void;
1436
+ non_inlined_wake(o: Any$P, fst?: Any$P): void;
1437
+ really_wake(o: Any$P, fst?: Any$P): void;
1438
+ wake_constraint(con: Any$P, fst?: Any$P): boolean;
1439
+ doForests(dt: Any$P): void;
1440
+ sleepArbiters(): void;
1441
+ static_validation(body: Any$P): void;
1442
+ validation(): void;
1443
+ updateVel(dt: Any$P): void;
1444
+ updatePos(dt: Any$P): void;
1445
+ presteparb(arb: Any$P, dt: Any$P, cont?: Any$P): boolean;
1446
+ prestep(dt: Any$P): void;
1447
+ warmStart(): void;
1448
+ iterateVel(times: Any$P): void;
1449
+ iteratePos(times: Any$P): void;
1450
+ group_ignore(s1: Any$P, s2: Any$P): boolean;
1451
+ interactionType(s1: Any$P, s2: Any$P, b1: Any$P, b2: Any$P): 0 | 1 | 2 | -1;
1452
+ narrowPhase(s1: Any$P, s2: Any$P, stat: Any$P, in_arb: Any$P, continuous: Any$P): any;
1453
+ MRCA_chains(s1: Any$P, s2: Any$P): void;
1454
+ inlined_MRCA_chains(s1: Any$P, s2: Any$P): void;
1289
1455
  }
1290
1456
 
1457
+ type Any$O = any;
1291
1458
  /**
1292
1459
  * The physics world. Add bodies and constraints, then call `step()` each frame.
1460
+ *
1461
+ * Fully modernized — uses ZPP_Space directly (extracted to TypeScript).
1293
1462
  */
1294
1463
  declare class Space {
1464
+ zpp_inner: ZPP_Space;
1465
+ constructor(gravity?: Vec2, broadphase?: Any$O);
1295
1466
  /** @internal */
1296
- readonly _inner: NapeInner;
1297
- constructor(gravity?: Vec2);
1467
+ get _inner(): Any$O;
1298
1468
  /** @internal */
1299
1469
  static _wrap(inner: NapeInner): Space;
1470
+ get userData(): Record<string, unknown>;
1300
1471
  get gravity(): Vec2;
1301
1472
  set gravity(value: Vec2);
1302
- get worldLinearDrag(): number;
1303
- set worldLinearDrag(value: number);
1304
- get worldAngularDrag(): number;
1305
- set worldAngularDrag(value: number);
1473
+ get broadphase(): Any$O;
1306
1474
  get sortContacts(): boolean;
1307
1475
  set sortContacts(value: boolean);
1308
- get bodies(): NapeList<Body>;
1309
- get liveBodies(): NapeList<Body>;
1310
- get constraints(): NapeList<Constraint>;
1311
- get liveConstraints(): NapeList<Constraint>;
1312
- get arbiters(): NapeInner;
1313
- get listeners(): NapeList<Listener>;
1314
- get compounds(): NapeInner;
1315
- /** The static world body (always present, immovable). */
1476
+ get worldAngularDrag(): number;
1477
+ set worldAngularDrag(value: number);
1478
+ get worldLinearDrag(): number;
1479
+ set worldLinearDrag(value: number);
1480
+ get compounds(): Any$O;
1481
+ get bodies(): Any$O;
1482
+ get liveBodies(): Any$O;
1483
+ get constraints(): Any$O;
1484
+ get liveConstraints(): Any$O;
1316
1485
  get world(): Body;
1486
+ get arbiters(): Any$O;
1487
+ get listeners(): Any$O;
1317
1488
  get timeStamp(): number;
1318
1489
  get elapsedTime(): number;
1319
- get broadphase(): NapeInner;
1320
- get userData(): Record<string, unknown>;
1321
1490
  step(deltaTime: number, velocityIterations?: number, positionIterations?: number): void;
1322
1491
  clear(): void;
1323
- visitBodies(fn: (body: Body) => void): void;
1324
- visitConstraints(fn: (constraint: Constraint) => void): void;
1325
- visitCompounds(fn: (compound: NapeInner) => void): void;
1326
- shapesUnderPoint(point: Vec2, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1327
- bodiesUnderPoint(point: Vec2, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1328
- shapesInAABB(aabb: AABB, containment?: boolean, strict?: boolean, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1329
- bodiesInAABB(aabb: AABB, containment?: boolean, strict?: boolean, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1330
- rayCast(ray: {
1331
- _inner: NapeInner;
1332
- } | NapeInner, inner?: boolean, filter?: InteractionFilterLike): NapeInner;
1333
- rayMultiCast(ray: {
1334
- _inner: NapeInner;
1335
- } | NapeInner, inner?: boolean, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1492
+ visitBodies(lambda: (body: Body) => void): void;
1493
+ visitConstraints(lambda: (constraint: Constraint) => void): void;
1494
+ visitCompounds(lambda: (compound: Any$O) => void): void;
1495
+ interactionType(shape1: Shape, shape2: Shape): Any$O;
1496
+ shapesUnderPoint(point: Vec2, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1497
+ bodiesUnderPoint(point: Vec2, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1498
+ shapesInAABB(aabb: AABB, containment?: boolean, strict?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1499
+ bodiesInAABB(aabb: AABB, containment?: boolean, strict?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1500
+ shapesInCircle(position: Vec2, radius: number, containment?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1501
+ bodiesInCircle(position: Vec2, radius: number, containment?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1502
+ shapesInShape(shape: Shape, containment?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1503
+ bodiesInShape(shape: Shape, containment?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1504
+ shapesInBody(body: Body, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1505
+ bodiesInBody(body: Body, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1506
+ convexCast(shape: Shape, deltaTime: number, liveSweep?: boolean, filter?: InteractionFilter | Any$O): Any$O;
1507
+ convexMultiCast(shape: Shape, deltaTime: number, liveSweep?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1508
+ rayCast(ray: Ray | Any$O, inner?: boolean, filter?: InteractionFilter | Any$O): Any$O;
1509
+ rayMultiCast(ray: Ray | Any$O, inner?: boolean, filter?: InteractionFilter | Any$O, output?: Any$O): Any$O;
1336
1510
  toString(): string;
1511
+ /** @internal */ get_userData(): Any$O;
1512
+ /** @internal */ get_gravity(): Any$O;
1513
+ /** @internal */ set_gravity(v: Any$O): Any$O;
1514
+ /** @internal */ get_broadphase(): Any$O;
1515
+ /** @internal */ get_sortContacts(): boolean;
1516
+ /** @internal */ set_sortContacts(v: boolean): boolean;
1517
+ /** @internal */ get_worldAngularDrag(): number;
1518
+ /** @internal */ set_worldAngularDrag(v: number): number;
1519
+ /** @internal */ get_worldLinearDrag(): number;
1520
+ /** @internal */ set_worldLinearDrag(v: number): number;
1521
+ /** @internal */ get_compounds(): Any$O;
1522
+ /** @internal */ get_bodies(): Any$O;
1523
+ /** @internal */ get_liveBodies(): Any$O;
1524
+ /** @internal */ get_constraints(): Any$O;
1525
+ /** @internal */ get_liveConstraints(): Any$O;
1526
+ /** @internal */ get_world(): Any$O;
1527
+ /** @internal */ get_arbiters(): Any$O;
1528
+ /** @internal */ get_listeners(): Any$O;
1529
+ /** @internal */ get_timeStamp(): number;
1530
+ /** @internal */ get_elapsedTime(): number;
1337
1531
  }
1338
- /** @internal Helper type for filter-like parameters. */
1339
- type InteractionFilterLike = {
1340
- _inner: NapeInner;
1341
- } | NapeInner | undefined;
1342
1532
 
1343
1533
  /**
1344
1534
  * Body type enumeration.
@@ -1369,22 +1559,22 @@ declare class BodyType {
1369
1559
  *
1370
1560
  * Converted from nape-compiled.js lines 63367–63463, 135330–135331.
1371
1561
  */
1372
- type Any$K = any;
1562
+ type Any$N = any;
1373
1563
  declare class ZPP_InteractionGroup {
1374
1564
  static SHAPE: number;
1375
1565
  static BODY: number;
1376
1566
  static __name__: string[];
1377
- static _zpp: Any$K;
1378
- static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$K) | null;
1379
- outer: Any$K;
1567
+ static _zpp: Any$N;
1568
+ static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$N) | null;
1569
+ outer: Any$N;
1380
1570
  ignore: boolean;
1381
1571
  group: ZPP_InteractionGroup | null;
1382
- groups: Any$K;
1383
- wrap_groups: Any$K;
1384
- interactors: Any$K;
1385
- wrap_interactors: Any$K;
1572
+ groups: Any$N;
1573
+ wrap_groups: Any$N;
1574
+ interactors: Any$N;
1575
+ wrap_interactors: Any$N;
1386
1576
  depth: number;
1387
- __class__: Any$K;
1577
+ __class__: Any$N;
1388
1578
  constructor();
1389
1579
  /** Set or change the parent group. */
1390
1580
  setGroup(group: ZPP_InteractionGroup | null): void;
@@ -1395,9 +1585,9 @@ declare class ZPP_InteractionGroup {
1395
1585
  /** Remove a child group. */
1396
1586
  remGroup(group: ZPP_InteractionGroup): void;
1397
1587
  /** Register an interactor in this group. */
1398
- addInteractor(intx: Any$K): void;
1588
+ addInteractor(intx: Any$N): void;
1399
1589
  /** Unregister an interactor from this group. */
1400
- remInteractor(intx: Any$K, flag?: number): void;
1590
+ remInteractor(intx: Any$N, flag?: number): void;
1401
1591
  }
1402
1592
 
1403
1593
  /**
@@ -1492,46 +1682,46 @@ declare class Interactor {
1492
1682
  * Converted from nape-compiled.js lines 52431–54547.
1493
1683
  */
1494
1684
 
1495
- type Any$J = any;
1685
+ type Any$M = any;
1496
1686
  declare class ZPP_Body {
1497
1687
  static __name__: string[];
1498
- static __super__: Any$J;
1688
+ static __super__: Any$M;
1499
1689
  /**
1500
1690
  * Namespace references, set by the compiled module after import.
1501
1691
  * _nape = the `nape` public namespace
1502
1692
  * _zpp = the `zpp_nape` internal namespace
1503
1693
  */
1504
- static _nape: Any$J;
1505
- static _zpp: Any$J;
1506
- static types: Any$J[];
1507
- static bodystack: Any$J;
1508
- static bodyset: Any$J;
1694
+ static _nape: Any$M;
1695
+ static _zpp: Any$M;
1696
+ static types: Any$M[];
1697
+ static bodystack: Any$M;
1698
+ static bodyset: Any$M;
1509
1699
  static cur_graph_depth: number;
1510
- static bodysetlt(a: Any$J, b: Any$J): boolean;
1511
- static __static(): Any$J;
1512
- outer_i: Any$J;
1700
+ static bodysetlt(a: Any$M, b: Any$M): boolean;
1701
+ static __static(): Any$M;
1702
+ outer_i: Any$M;
1513
1703
  id: number;
1514
- userData: Any$J;
1515
- ishape: Any$J;
1516
- ibody: Any$J;
1517
- icompound: Any$J;
1518
- wrap_cbTypes: Any$J;
1519
- cbSet: Any$J;
1520
- cbTypes: Any$J;
1521
- group: Any$J;
1522
- cbsets: Any$J;
1523
- outer: Any$J;
1704
+ userData: Any$M;
1705
+ ishape: Any$M;
1706
+ ibody: Any$M;
1707
+ icompound: Any$M;
1708
+ wrap_cbTypes: Any$M;
1709
+ cbSet: Any$M;
1710
+ cbTypes: Any$M;
1711
+ group: Any$M;
1712
+ cbsets: Any$M;
1713
+ outer: Any$M;
1524
1714
  world: boolean;
1525
1715
  type: number;
1526
- compound: Any$J;
1527
- shapes: Any$J;
1528
- wrap_shapes: Any$J;
1529
- space: Any$J;
1530
- arbiters: Any$J;
1531
- wrap_arbiters: Any$J;
1532
- constraints: Any$J;
1533
- wrap_constraints: Any$J;
1534
- component: Any$J;
1716
+ compound: Any$M;
1717
+ shapes: Any$M;
1718
+ wrap_shapes: Any$M;
1719
+ space: Any$M;
1720
+ arbiters: Any$M;
1721
+ wrap_arbiters: Any$M;
1722
+ constraints: Any$M;
1723
+ wrap_constraints: Any$M;
1724
+ component: Any$M;
1535
1725
  graph_depth: number;
1536
1726
  sweepTime: number;
1537
1727
  sweep_angvel: number;
@@ -1544,20 +1734,20 @@ declare class ZPP_Body {
1544
1734
  pre_posy: number;
1545
1735
  posx: number;
1546
1736
  posy: number;
1547
- wrap_pos: Any$J;
1737
+ wrap_pos: Any$M;
1548
1738
  velx: number;
1549
1739
  vely: number;
1550
- wrap_vel: Any$J;
1740
+ wrap_vel: Any$M;
1551
1741
  forcex: number;
1552
1742
  forcey: number;
1553
- wrap_force: Any$J;
1743
+ wrap_force: Any$M;
1554
1744
  kinvelx: number;
1555
1745
  kinvely: number;
1556
- wrap_kinvel: Any$J;
1746
+ wrap_kinvel: Any$M;
1557
1747
  svelx: number;
1558
1748
  svely: number;
1559
- wrap_svel: Any$J;
1560
- wrapcvel: Any$J;
1749
+ wrap_svel: Any$M;
1750
+ wrapcvel: Any$M;
1561
1751
  angvel: number;
1562
1752
  torque: number;
1563
1753
  kinangvel: number;
@@ -1594,9 +1784,9 @@ declare class ZPP_Body {
1594
1784
  worldCOMx: number;
1595
1785
  worldCOMy: number;
1596
1786
  zip_worldCOM: boolean;
1597
- wrap_localCOM: Any$J;
1598
- wrap_worldCOM: Any$J;
1599
- __class__: Any$J;
1787
+ wrap_localCOM: Any$M;
1788
+ wrap_worldCOM: Any$M;
1789
+ __class__: Any$M;
1600
1790
  constructor();
1601
1791
  isStatic(): boolean;
1602
1792
  isDynamic(): boolean;
@@ -1604,23 +1794,23 @@ declare class ZPP_Body {
1604
1794
  invalidate_type(): void;
1605
1795
  invalidate_shapes(): void;
1606
1796
  init_bodysetlist(): void;
1607
- connectedBodies_cont(b: Any$J): void;
1608
- connectedBodies(depth: number, output: Any$J): Any$J;
1609
- interactingBodies(type: number, output: Any$J): Any$J;
1797
+ connectedBodies_cont(b: Any$M): void;
1798
+ connectedBodies(depth: number, output: Any$M): Any$M;
1799
+ interactingBodies(type: number, output: Any$M): Any$M;
1610
1800
  atRest(dt: number): boolean;
1611
1801
  refreshArbiters(): void;
1612
1802
  sweepIntegrate(dt: number): void;
1613
- sweepValidate(s: Any$J): void;
1803
+ sweepValidate(s: Any$M): void;
1614
1804
  invalidate_pos(): void;
1615
- pos_invalidate(pos: Any$J): void;
1805
+ pos_invalidate(pos: Any$M): void;
1616
1806
  pos_validate(): void;
1617
- vel_invalidate(vel: Any$J): void;
1807
+ vel_invalidate(vel: Any$M): void;
1618
1808
  vel_validate(): void;
1619
- kinvel_invalidate(vel: Any$J): void;
1809
+ kinvel_invalidate(vel: Any$M): void;
1620
1810
  kinvel_validate(): void;
1621
- svel_invalidate(vel: Any$J): void;
1811
+ svel_invalidate(vel: Any$M): void;
1622
1812
  svel_validate(): void;
1623
- force_invalidate(force: Any$J): void;
1813
+ force_invalidate(force: Any$M): void;
1624
1814
  force_validate(): void;
1625
1815
  private _setupVec2Wrapper;
1626
1816
  setupPosition(): void;
@@ -1657,37 +1847,37 @@ declare class ZPP_Body {
1657
1847
  getworldCOM(): void;
1658
1848
  __immutable_midstep(): void;
1659
1849
  clear(): void;
1660
- shapes_adder(s: Any$J): boolean;
1661
- shapes_subber(s: Any$J): void;
1662
- shapes_invalidate(_param: Any$J): void;
1850
+ shapes_adder(s: Any$M): boolean;
1851
+ shapes_subber(s: Any$M): void;
1852
+ shapes_invalidate(_param: Any$M): void;
1663
1853
  shapes_modifiable(): void;
1664
1854
  addedToSpace(): void;
1665
1855
  removedFromSpace(): void;
1666
1856
  private _removeArbiterFromList;
1667
- copy(): Any$J;
1857
+ copy(): Any$M;
1668
1858
  wake: () => void;
1669
1859
  __iaddedToSpace: () => void;
1670
1860
  __iremovedFromSpace: () => void;
1671
1861
  immutable_midstep: (name: string) => void;
1672
- copyto: (ret: Any$J) => void;
1673
- insert_cbtype: (cb: Any$J) => void;
1862
+ copyto: (ret: Any$M) => void;
1863
+ insert_cbtype: (cb: Any$M) => void;
1674
1864
  alloc_cbSet: () => void;
1675
1865
  dealloc_cbSet: () => void;
1676
1866
  setupcbTypes: () => void;
1677
1867
  immutable_cbTypes: () => void;
1678
- wrap_cbTypes_subber: (pcb: Any$J) => void;
1679
- wrap_cbTypes_adder: (cb: Any$J) => void;
1680
- setGroup: (group: Any$J) => void;
1681
- lookup_group: () => Any$J;
1682
- getSpace: () => Any$J;
1868
+ wrap_cbTypes_subber: (pcb: Any$M) => void;
1869
+ wrap_cbTypes_adder: (cb: Any$M) => void;
1870
+ setGroup: (group: Any$M) => void;
1871
+ lookup_group: () => Any$M;
1872
+ getSpace: () => Any$M;
1683
1873
  isShape: () => boolean;
1684
1874
  isBody: () => boolean;
1685
1875
  isCompound: () => boolean;
1686
1876
  static _initialized: boolean;
1687
- static _init(zpp: Any$J, nape: Any$J): void;
1877
+ static _init(zpp: Any$M, nape: Any$M): void;
1688
1878
  }
1689
1879
 
1690
- type Any$I = any;
1880
+ type Any$L = any;
1691
1881
  /**
1692
1882
  * A rigid body in the physics simulation.
1693
1883
  *
@@ -1695,7 +1885,7 @@ type Any$I = any;
1695
1885
  */
1696
1886
  declare class Body extends Interactor {
1697
1887
  static __name__: string[];
1698
- static __super__: Any$I;
1888
+ static __super__: Any$L;
1699
1889
  /** Direct access to the extracted internal ZPP_Body. */
1700
1890
  zpp_inner: ZPP_Body;
1701
1891
  debugDraw: boolean;
@@ -1747,47 +1937,47 @@ declare class Body extends Interactor {
1747
1937
  get shapes(): NapeList<Shape>;
1748
1938
  get space(): Space;
1749
1939
  set space(value: Space | null);
1750
- get compound(): Any$I;
1751
- set compound(value: Any$I);
1940
+ get compound(): Any$L;
1941
+ set compound(value: Any$L);
1752
1942
  get bounds(): AABB;
1753
1943
  get constraintVelocity(): Vec2;
1754
1944
  get localCOM(): Vec2;
1755
1945
  get worldCOM(): Vec2;
1756
- get massMode(): Any$I;
1757
- set massMode(value: Any$I);
1758
- get inertiaMode(): Any$I;
1759
- set inertiaMode(value: Any$I);
1760
- get gravMassMode(): Any$I;
1761
- set gravMassMode(value: Any$I);
1946
+ get massMode(): Any$L;
1947
+ set massMode(value: Any$L);
1948
+ get inertiaMode(): Any$L;
1949
+ set inertiaMode(value: Any$L);
1950
+ get gravMassMode(): Any$L;
1951
+ set gravMassMode(value: Any$L);
1762
1952
  copy(): Body;
1763
1953
  toString(): string;
1764
- get_type(): Any$I;
1765
- set_type(type: Any$I): Any$I;
1766
- get_shapes(): Any$I;
1954
+ get_type(): Any$L;
1955
+ set_type(type: Any$L): Any$L;
1956
+ get_shapes(): Any$L;
1767
1957
  get_isBullet(): boolean;
1768
1958
  set_isBullet(v: boolean): boolean;
1769
1959
  get_disableCCD(): boolean;
1770
1960
  set_disableCCD(v: boolean): boolean;
1771
- get_position(): Any$I;
1772
- set_position(position: Any$I): Any$I;
1773
- get_velocity(): Any$I;
1774
- set_velocity(velocity: Any$I): Any$I;
1961
+ get_position(): Any$L;
1962
+ set_position(position: Any$L): Any$L;
1963
+ get_velocity(): Any$L;
1964
+ set_velocity(velocity: Any$L): Any$L;
1775
1965
  get_rotation(): number;
1776
1966
  set_rotation(rotation: number): number;
1777
1967
  get_angularVel(): number;
1778
1968
  set_angularVel(angularVel: number): number;
1779
- get_kinematicVel(): Any$I;
1780
- set_kinematicVel(kinematicVel: Any$I): Any$I;
1969
+ get_kinematicVel(): Any$L;
1970
+ set_kinematicVel(kinematicVel: Any$L): Any$L;
1781
1971
  get_kinAngVel(): number;
1782
1972
  set_kinAngVel(kinAngVel: number): number;
1783
- get_surfaceVel(): Any$I;
1784
- set_surfaceVel(surfaceVel: Any$I): Any$I;
1785
- get_force(): Any$I;
1786
- set_force(force: Any$I): Any$I;
1973
+ get_surfaceVel(): Any$L;
1974
+ set_surfaceVel(surfaceVel: Any$L): Any$L;
1975
+ get_force(): Any$L;
1976
+ set_force(force: Any$L): Any$L;
1787
1977
  get_torque(): number;
1788
1978
  set_torque(torque: number): number;
1789
- get_bounds(): Any$I;
1790
- get_constraintVelocity(): Any$I;
1979
+ get_bounds(): Any$L;
1980
+ get_constraintVelocity(): Any$L;
1791
1981
  get_constraintMass(): number;
1792
1982
  get_constraintInertia(): number;
1793
1983
  get_allowMovement(): boolean;
@@ -1795,28 +1985,28 @@ declare class Body extends Interactor {
1795
1985
  get_allowRotation(): boolean;
1796
1986
  set_allowRotation(allowRotation: boolean): boolean;
1797
1987
  get_isSleeping(): boolean;
1798
- get_compound(): Any$I;
1799
- set_compound(compound: Any$I): Any$I;
1800
- get_space(): Any$I;
1801
- set_space(space: Any$I): Any$I;
1802
- get_arbiters(): Any$I;
1803
- get_constraints(): Any$I;
1804
- get_massMode(): Any$I;
1805
- set_massMode(massMode: Any$I): Any$I;
1988
+ get_compound(): Any$L;
1989
+ set_compound(compound: Any$L): Any$L;
1990
+ get_space(): Any$L;
1991
+ set_space(space: Any$L): Any$L;
1992
+ get_arbiters(): Any$L;
1993
+ get_constraints(): Any$L;
1994
+ get_massMode(): Any$L;
1995
+ set_massMode(massMode: Any$L): Any$L;
1806
1996
  get_mass(): number;
1807
1997
  set_mass(mass: number): number;
1808
- get_gravMassMode(): Any$I;
1809
- set_gravMassMode(gravMassMode: Any$I): Any$I;
1998
+ get_gravMassMode(): Any$L;
1999
+ set_gravMassMode(gravMassMode: Any$L): Any$L;
1810
2000
  get_gravMass(): number;
1811
2001
  set_gravMass(gravMass: number): number;
1812
2002
  get_gravMassScale(): number;
1813
2003
  set_gravMassScale(gravMassScale: number): number;
1814
- get_inertiaMode(): Any$I;
1815
- set_inertiaMode(inertiaMode: Any$I): Any$I;
2004
+ get_inertiaMode(): Any$L;
2005
+ set_inertiaMode(inertiaMode: Any$L): Any$L;
1816
2006
  get_inertia(): number;
1817
2007
  set_inertia(inertia: number): number;
1818
- get_localCOM(): Any$I;
1819
- get_worldCOM(): Any$I;
2008
+ get_localCOM(): Any$L;
2009
+ get_worldCOM(): Any$L;
1820
2010
  integrate(deltaTime: number): Body;
1821
2011
  localPointToWorld(point: Vec2, weak?: boolean): Vec2;
1822
2012
  worldPointToLocal(point: Vec2, weak?: boolean): Vec2;
@@ -1828,24 +2018,24 @@ declare class Body extends Interactor {
1828
2018
  translateShapes(translation: Vec2): Body;
1829
2019
  rotateShapes(angle: number): Body;
1830
2020
  scaleShapes(scaleX: number, scaleY: number): Body;
1831
- transformShapes(matrix: Any$I): Body;
2021
+ transformShapes(matrix: Any$L): Body;
1832
2022
  align(): Body;
1833
2023
  rotate(centre: Vec2, angle: number): Body;
1834
- setShapeMaterials(material: Any$I): Body;
1835
- setShapeFilters(filter: Any$I): Body;
1836
- setShapeFluidProperties(fluidProperties: Any$I): Body;
2024
+ setShapeMaterials(material: Any$L): Body;
2025
+ setShapeFilters(filter: Any$L): Body;
2026
+ setShapeFluidProperties(fluidProperties: Any$L): Body;
1837
2027
  contains(point: Vec2): boolean;
1838
- connectedBodies(depth?: number, output?: Any$I): Any$I;
1839
- interactingBodies(type?: Any$I, depth?: number, output?: Any$I): Any$I;
1840
- normalImpulse(body?: Any$I, freshOnly?: boolean): Vec3;
1841
- tangentImpulse(body?: Any$I, freshOnly?: boolean): Vec3;
1842
- totalContactsImpulse(body?: Any$I, freshOnly?: boolean): Vec3;
1843
- rollingImpulse(body?: Any$I, freshOnly?: boolean): number;
1844
- buoyancyImpulse(body?: Any$I): Vec3;
1845
- dragImpulse(body?: Any$I): Vec3;
1846
- totalFluidImpulse(body?: Any$I): Vec3;
2028
+ connectedBodies(depth?: number, output?: Any$L): Any$L;
2029
+ interactingBodies(type?: Any$L, depth?: number, output?: Any$L): Any$L;
2030
+ normalImpulse(body?: Any$L, freshOnly?: boolean): Vec3;
2031
+ tangentImpulse(body?: Any$L, freshOnly?: boolean): Vec3;
2032
+ totalContactsImpulse(body?: Any$L, freshOnly?: boolean): Vec3;
2033
+ rollingImpulse(body?: Any$L, freshOnly?: boolean): number;
2034
+ buoyancyImpulse(body?: Any$L): Vec3;
2035
+ dragImpulse(body?: Any$L): Vec3;
2036
+ totalFluidImpulse(body?: Any$L): Vec3;
1847
2037
  constraintsImpulse(): Vec3;
1848
- totalImpulse(body?: Any$I, freshOnly?: boolean): Vec3;
2038
+ totalImpulse(body?: Any$L, freshOnly?: boolean): Vec3;
1849
2039
  crushFactor(): number;
1850
2040
  private _arbiterImpulseQuery;
1851
2041
  }
@@ -1858,7 +2048,7 @@ declare class Body extends Interactor {
1858
2048
  *
1859
2049
  * Converted from nape-compiled.js lines 87523–87601, 135477–135481.
1860
2050
  */
1861
- type Any$H = any;
2051
+ type Any$K = any;
1862
2052
  declare class ZPP_Material {
1863
2053
  static zpp_pool: ZPP_Material | null;
1864
2054
  static WAKE: number;
@@ -1871,27 +2061,27 @@ declare class ZPP_Material {
1871
2061
  * _nape = the `nape` public namespace (for wrapper creation)
1872
2062
  * _zpp = the `zpp_nape` internal namespace (for ZNPList_ZPP_Shape)
1873
2063
  */
1874
- static _nape: Any$H;
1875
- static _zpp: Any$H;
2064
+ static _nape: Any$K;
2065
+ static _zpp: Any$K;
1876
2066
  /**
1877
2067
  * Wrapper factory callback, registered by the modernized Material class.
1878
2068
  * When set, wrapper() uses this instead of creating a compiled Material.
1879
2069
  */
1880
- static _wrapFn: ((zpp: ZPP_Material) => Any$H) | null;
2070
+ static _wrapFn: ((zpp: ZPP_Material) => Any$K) | null;
1881
2071
  elasticity: number;
1882
2072
  dynamicFriction: number;
1883
2073
  staticFriction: number;
1884
2074
  density: number;
1885
2075
  rollingFriction: number;
1886
- shapes: Any$H;
1887
- wrap_shapes: Any$H;
1888
- outer: Any$H;
1889
- userData: Any$H;
2076
+ shapes: Any$K;
2077
+ wrap_shapes: Any$K;
2078
+ outer: Any$K;
2079
+ userData: Any$K;
1890
2080
  next: ZPP_Material | null;
1891
- __class__: Any$H;
2081
+ __class__: Any$K;
1892
2082
  constructor();
1893
2083
  /** Create/return the public nape.phys.Material wrapper for this internal object. */
1894
- wrapper(): Any$H;
2084
+ wrapper(): Any$K;
1895
2085
  /** Called when this object is returned to the pool. */
1896
2086
  free(): void;
1897
2087
  /** Called when this object is taken from the pool. */
@@ -1899,9 +2089,9 @@ declare class ZPP_Material {
1899
2089
  /** Initialize the shapes list (called during feature construction). */
1900
2090
  feature_cons(): void;
1901
2091
  /** Register a shape that uses this material. */
1902
- addShape(shape: Any$H): void;
2092
+ addShape(shape: Any$K): void;
1903
2093
  /** Unregister a shape that no longer uses this material. */
1904
- remShape(shape: Any$H): void;
2094
+ remShape(shape: Any$K): void;
1905
2095
  /** Create a copy with the same property values. */
1906
2096
  copy(): ZPP_Material;
1907
2097
  /** Copy all property values from another ZPP_Material. */
@@ -1961,36 +2151,36 @@ declare class Material {
1961
2151
  *
1962
2152
  * Converted from nape-compiled.js lines 87335–87523, 135403.
1963
2153
  */
1964
- type Any$G = any;
2154
+ type Any$J = any;
1965
2155
  declare class ZPP_FluidProperties {
1966
2156
  static zpp_pool: ZPP_FluidProperties | null;
1967
2157
  static __name__: string[];
1968
- static _nape: Any$G;
1969
- static _zpp: Any$G;
1970
- static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$G) | null;
2158
+ static _nape: Any$J;
2159
+ static _zpp: Any$J;
2160
+ static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$J) | null;
1971
2161
  viscosity: number;
1972
2162
  density: number;
1973
2163
  gravityx: number;
1974
2164
  gravityy: number;
1975
- wrap_gravity: Any$G;
1976
- shapes: Any$G;
1977
- wrap_shapes: Any$G;
1978
- outer: Any$G;
1979
- userData: Any$G;
2165
+ wrap_gravity: Any$J;
2166
+ shapes: Any$J;
2167
+ wrap_shapes: Any$J;
2168
+ outer: Any$J;
2169
+ userData: Any$J;
1980
2170
  next: ZPP_FluidProperties | null;
1981
- __class__: Any$G;
2171
+ __class__: Any$J;
1982
2172
  constructor();
1983
2173
  /** Create/return the public nape.phys.FluidProperties wrapper. */
1984
- wrapper(): Any$G;
2174
+ wrapper(): Any$J;
1985
2175
  free(): void;
1986
2176
  alloc(): void;
1987
2177
  feature_cons(): void;
1988
- addShape(shape: Any$G): void;
1989
- remShape(shape: Any$G): void;
2178
+ addShape(shape: Any$J): void;
2179
+ remShape(shape: Any$J): void;
1990
2180
  /** Copy with object pooling. */
1991
2181
  copy(): ZPP_FluidProperties;
1992
2182
  /** Called when gravity Vec2 wrapper is invalidated (user set new gravity). */
1993
- gravity_invalidate(x: Any$G): void;
2183
+ gravity_invalidate(x: Any$J): void;
1994
2184
  /** Sync the gravity Vec2 wrapper with internal values. */
1995
2185
  gravity_validate(): void;
1996
2186
  /** Lazily create and return the gravity Vec2 wrapper. */
@@ -2033,96 +2223,6 @@ declare class FluidProperties {
2033
2223
  toString(): string;
2034
2224
  }
2035
2225
 
2036
- /**
2037
- * ZPP_InteractionFilter — Internal interaction filter for the nape physics engine.
2038
- *
2039
- * Stores collision/sensor/fluid group and mask bitmasks that determine
2040
- * which shapes interact with each other.
2041
- *
2042
- * Converted from nape-compiled.js lines 63255–63366, 135329.
2043
- */
2044
- type Any$F = any;
2045
- declare class ZPP_InteractionFilter {
2046
- static zpp_pool: ZPP_InteractionFilter | null;
2047
- static __name__: string[];
2048
- static _nape: Any$F;
2049
- static _zpp: Any$F;
2050
- static _wrapFn: ((zpp: ZPP_InteractionFilter) => Any$F) | null;
2051
- collisionGroup: number;
2052
- collisionMask: number;
2053
- sensorGroup: number;
2054
- sensorMask: number;
2055
- fluidGroup: number;
2056
- fluidMask: number;
2057
- shapes: Any$F;
2058
- wrap_shapes: Any$F;
2059
- outer: Any$F;
2060
- userData: Any$F;
2061
- next: ZPP_InteractionFilter | null;
2062
- __class__: Any$F;
2063
- constructor();
2064
- /** Create/return the public nape.dynamics.InteractionFilter wrapper. */
2065
- wrapper(): Any$F;
2066
- free(): void;
2067
- alloc(): void;
2068
- feature_cons(): void;
2069
- addShape(shape: Any$F): void;
2070
- remShape(shape: Any$F): void;
2071
- /** Create a copy with object pooling. */
2072
- copy(): ZPP_InteractionFilter;
2073
- /** Test whether two filters allow collision between their shapes. */
2074
- shouldCollide(x: ZPP_InteractionFilter): boolean;
2075
- /** Test whether two filters allow sensor interaction. */
2076
- shouldSense(x: ZPP_InteractionFilter): boolean;
2077
- /** Test whether two filters allow fluid interaction. */
2078
- shouldFlow(x: ZPP_InteractionFilter): boolean;
2079
- /** Notify all shapes that the filter changed. */
2080
- invalidate(): void;
2081
- }
2082
-
2083
- /**
2084
- * Bit-mask based interaction filter for controlling which shapes
2085
- * collide, sense, or interact as fluids.
2086
- *
2087
- * Internally wraps a ZPP_InteractionFilter and is registered as
2088
- * the public `nape.dynamics.InteractionFilter` class in the compiled namespace.
2089
- *
2090
- * Converted from nape-compiled.js lines 14361–14640.
2091
- */
2092
- declare class InteractionFilter {
2093
- static __name__: string[];
2094
- /** @internal The internal ZPP_InteractionFilter this wrapper owns. */
2095
- zpp_inner: ZPP_InteractionFilter;
2096
- /**
2097
- * Backward-compatible accessor — returns `this` so that compiled engine
2098
- * code that receives `filter._inner` can still access `zpp_inner`.
2099
- * @internal
2100
- */
2101
- get _inner(): NapeInner;
2102
- constructor(collisionGroup?: number, collisionMask?: number, sensorGroup?: number, sensorMask?: number, fluidGroup?: number, fluidMask?: number);
2103
- /** @internal Wrap a ZPP_InteractionFilter (or legacy compiled InteractionFilter) with caching. */
2104
- static _wrap(inner: any): InteractionFilter;
2105
- get collisionGroup(): number;
2106
- set collisionGroup(value: number);
2107
- get collisionMask(): number;
2108
- set collisionMask(value: number);
2109
- get sensorGroup(): number;
2110
- set sensorGroup(value: number);
2111
- get sensorMask(): number;
2112
- set sensorMask(value: number);
2113
- get fluidGroup(): number;
2114
- set fluidGroup(value: number);
2115
- get fluidMask(): number;
2116
- set fluidMask(value: number);
2117
- get userData(): Record<string, unknown>;
2118
- get shapes(): any;
2119
- shouldCollide(filter: InteractionFilter): boolean;
2120
- shouldSense(filter: InteractionFilter): boolean;
2121
- shouldFlow(filter: InteractionFilter): boolean;
2122
- copy(): InteractionFilter;
2123
- toString(): string;
2124
- }
2125
-
2126
2226
  /**
2127
2227
  * Shape type classification.
2128
2228
  *
@@ -2264,77 +2364,77 @@ declare class Geom {
2264
2364
  *
2265
2365
  * Converted from nape-compiled.js lines 55195–55521.
2266
2366
  */
2267
- type Any$E = any;
2367
+ type Any$I = any;
2268
2368
  declare class ZPP_Compound {
2269
2369
  static __name__: string[];
2270
- static __super__: Any$E;
2370
+ static __super__: Any$I;
2271
2371
  /**
2272
2372
  * Namespace references, set by the compiled module after import.
2273
2373
  * _nape = the `nape` public namespace (for wrapper creation in copy())
2274
2374
  * _zpp = the `zpp_nape` internal namespace (for ZNPList_*, ZPP_BodyList, etc.)
2275
2375
  */
2276
- static _nape: Any$E;
2277
- static _zpp: Any$E;
2376
+ static _nape: Any$I;
2377
+ static _zpp: Any$I;
2278
2378
  /**
2279
2379
  * Wrapper factory callback, registered by the modernized Compound class.
2280
2380
  * When set, wrapper() uses this instead of the compiled Compound constructor.
2281
2381
  */
2282
- static _wrapFn: ((zpp: ZPP_Compound) => Any$E) | null;
2283
- outer_i: Any$E;
2382
+ static _wrapFn: ((zpp: ZPP_Compound) => Any$I) | null;
2383
+ outer_i: Any$I;
2284
2384
  id: number;
2285
- userData: Any$E;
2286
- ishape: Any$E;
2287
- ibody: Any$E;
2288
- icompound: Any$E;
2289
- wrap_cbTypes: Any$E;
2290
- cbSet: Any$E;
2291
- cbTypes: Any$E;
2292
- group: Any$E;
2293
- cbsets: Any$E;
2294
- outer: Any$E;
2295
- bodies: Any$E;
2296
- constraints: Any$E;
2297
- compounds: Any$E;
2298
- wrap_bodies: Any$E;
2299
- wrap_constraints: Any$E;
2300
- wrap_compounds: Any$E;
2385
+ userData: Any$I;
2386
+ ishape: Any$I;
2387
+ ibody: Any$I;
2388
+ icompound: Any$I;
2389
+ wrap_cbTypes: Any$I;
2390
+ cbSet: Any$I;
2391
+ cbTypes: Any$I;
2392
+ group: Any$I;
2393
+ cbsets: Any$I;
2394
+ outer: Any$I;
2395
+ bodies: Any$I;
2396
+ constraints: Any$I;
2397
+ compounds: Any$I;
2398
+ wrap_bodies: Any$I;
2399
+ wrap_constraints: Any$I;
2400
+ wrap_compounds: Any$I;
2301
2401
  depth: number;
2302
- compound: Any$E;
2303
- space: Any$E;
2304
- __class__: Any$E;
2402
+ compound: Any$I;
2403
+ space: Any$I;
2404
+ __class__: Any$I;
2305
2405
  constructor();
2306
2406
  __imutable_midstep(name: string): void;
2307
2407
  addedToSpace(): void;
2308
2408
  removedFromSpace(): void;
2309
2409
  breakApart(): void;
2310
2410
  private static _zppOf;
2311
- bodies_adder(x: Any$E): boolean;
2312
- bodies_subber(x: Any$E): void;
2411
+ bodies_adder(x: Any$I): boolean;
2412
+ bodies_subber(x: Any$I): void;
2313
2413
  bodies_modifiable(): void;
2314
- constraints_adder(x: Any$E): boolean;
2315
- constraints_subber(x: Any$E): void;
2414
+ constraints_adder(x: Any$I): boolean;
2415
+ constraints_subber(x: Any$I): void;
2316
2416
  constraints_modifiable(): void;
2317
- compounds_adder(x: Any$E): boolean;
2318
- compounds_subber(x: Any$E): void;
2417
+ compounds_adder(x: Any$I): boolean;
2418
+ compounds_subber(x: Any$I): void;
2319
2419
  compounds_modifiable(): void;
2320
- copy(dict?: Any$E[], todo?: Any$E[]): Any$E;
2420
+ copy(dict?: Any$I[], todo?: Any$I[]): Any$I;
2321
2421
  isShape: () => boolean;
2322
2422
  isBody: () => boolean;
2323
2423
  isCompound: () => boolean;
2324
2424
  __iaddedToSpace: () => void;
2325
2425
  __iremovedFromSpace: () => void;
2326
2426
  wake: () => void;
2327
- getSpace: () => Any$E;
2427
+ getSpace: () => Any$I;
2328
2428
  setupcbTypes: () => void;
2329
2429
  immutable_cbTypes: () => void;
2330
- wrap_cbTypes_subber: (pcb: Any$E) => void;
2331
- wrap_cbTypes_adder: (cb: Any$E) => boolean;
2332
- insert_cbtype: (cb: Any$E) => void;
2430
+ wrap_cbTypes_subber: (pcb: Any$I) => void;
2431
+ wrap_cbTypes_adder: (cb: Any$I) => boolean;
2432
+ insert_cbtype: (cb: Any$I) => void;
2333
2433
  alloc_cbSet: () => void;
2334
2434
  dealloc_cbSet: () => void;
2335
2435
  immutable_midstep: (name: string) => void;
2336
- copyto: (ret: Any$E) => void;
2337
- lookup_group: () => Any$E;
2436
+ copyto: (ret: Any$I) => void;
2437
+ lookup_group: () => Any$I;
2338
2438
  /**
2339
2439
  * Initialize prototype by copying ZPP_Interactor methods.
2340
2440
  * Must be called after _zpp is set (during compiled module init).
@@ -2342,7 +2442,7 @@ declare class ZPP_Compound {
2342
2442
  static _init(): void;
2343
2443
  }
2344
2444
 
2345
- type Any$D = any;
2445
+ type Any$H = any;
2346
2446
  /**
2347
2447
  * A compound physics object — a hierarchical grouping of Bodies, Constraints,
2348
2448
  * and other Compounds.
@@ -2351,18 +2451,18 @@ type Any$D = any;
2351
2451
  */
2352
2452
  declare class Compound extends Interactor {
2353
2453
  static __name__: string[];
2354
- static __super__: Any$D;
2454
+ static __super__: Any$H;
2355
2455
  /** Direct access to the extracted internal ZPP_Compound. */
2356
2456
  zpp_inner: ZPP_Compound;
2357
2457
  constructor();
2358
2458
  /** @internal */
2359
2459
  static _wrap(inner: NapeInner): Compound;
2360
2460
  /** Bodies in this compound. */
2361
- get bodies(): Any$D;
2461
+ get bodies(): Any$H;
2362
2462
  /** Constraints in this compound. */
2363
- get constraints(): Any$D;
2463
+ get constraints(): Any$H;
2364
2464
  /** Child compounds in this compound. */
2365
- get compounds(): Any$D;
2465
+ get compounds(): Any$H;
2366
2466
  /** Parent compound, or null if this is a root compound. */
2367
2467
  get compound(): Compound | null;
2368
2468
  set compound(value: Compound | null);
@@ -2376,7 +2476,7 @@ declare class Compound extends Interactor {
2376
2476
  /** Recursively visit all bodies in this compound and its sub-compounds. */
2377
2477
  visitBodies(lambda: (body: Body) => void): void;
2378
2478
  /** Recursively visit all constraints in this compound and its sub-compounds. */
2379
- visitConstraints(lambda: (constraint: Any$D) => void): void;
2479
+ visitConstraints(lambda: (constraint: Any$H) => void): void;
2380
2480
  /** Recursively visit all sub-compounds in this compound. */
2381
2481
  visitCompounds(lambda: (compound: Compound) => void): void;
2382
2482
  /** Calculate the center of mass of all bodies in this compound. */
@@ -2386,13 +2486,13 @@ declare class Compound extends Interactor {
2386
2486
  /** Rotate all bodies in this compound around the given centre point. */
2387
2487
  rotate(centre: Vec2, angle: number): Compound;
2388
2488
  toString(): string;
2389
- get_bodies(): Any$D;
2390
- get_constraints(): Any$D;
2391
- get_compounds(): Any$D;
2392
- get_compound(): Any$D;
2393
- set_compound(compound: Any$D): Any$D;
2394
- get_space(): Any$D;
2395
- set_space(space: Any$D): Any$D;
2489
+ get_bodies(): Any$H;
2490
+ get_constraints(): Any$H;
2491
+ get_compounds(): Any$H;
2492
+ get_compound(): Any$H;
2493
+ set_compound(compound: Any$H): Any$H;
2494
+ get_space(): Any$H;
2495
+ set_space(space: Any$H): Any$H;
2396
2496
  }
2397
2497
 
2398
2498
  /**
@@ -2460,21 +2560,21 @@ declare class MassMode {
2460
2560
  *
2461
2561
  * Converted from nape-compiled.js lines 41496–41827.
2462
2562
  */
2463
- type Any$C = any;
2563
+ type Any$G = any;
2464
2564
  declare class ZPP_Circle {
2465
2565
  static __name__: string[];
2466
- static __super__: Any$C;
2467
- static _nape: Any$C;
2468
- static _zpp: Any$C;
2566
+ static __super__: Any$G;
2567
+ static _nape: Any$G;
2568
+ static _zpp: Any$G;
2469
2569
  static _initialized: boolean;
2470
2570
  radius: number;
2471
- outer_zn: Any$C;
2472
- __class__: Any$C;
2473
- body: Any$C;
2571
+ outer_zn: Any$G;
2572
+ __class__: Any$G;
2573
+ body: Any$G;
2474
2574
  type: number;
2475
- circle: Any$C;
2476
- polygon: Any$C;
2477
- aabb: Any$C;
2575
+ circle: Any$G;
2576
+ polygon: Any$G;
2577
+ aabb: Any$G;
2478
2578
  localCOMx: number;
2479
2579
  localCOMy: number;
2480
2580
  worldCOMx: number;
@@ -2488,25 +2588,25 @@ declare class ZPP_Circle {
2488
2588
  angDrag: number;
2489
2589
  sweepCoef: number;
2490
2590
  sweepRadius: number;
2491
- material: Any$C;
2492
- filter: Any$C;
2493
- wrap_localCOM: Any$C;
2494
- outer: Any$C;
2495
- outer_i: Any$C;
2496
- space: Any$C;
2591
+ material: Any$G;
2592
+ filter: Any$G;
2593
+ wrap_localCOM: Any$G;
2594
+ outer: Any$G;
2595
+ outer_i: Any$G;
2596
+ space: Any$G;
2497
2597
  invalidate_area_inertia: () => void;
2498
2598
  invalidate_angDrag: () => void;
2499
2599
  invalidate_localCOM: () => void;
2500
2600
  immutable_midstep: (name: string) => void;
2501
- setMaterial: (mat: Any$C) => void;
2502
- setFilter: (filt: Any$C) => void;
2503
- insert_cbtype: (cb: Any$C) => void;
2601
+ setMaterial: (mat: Any$G) => void;
2602
+ setFilter: (filt: Any$G) => void;
2603
+ insert_cbtype: (cb: Any$G) => void;
2504
2604
  constructor();
2505
2605
  static _init(): void;
2506
2606
  __clear(): void;
2507
2607
  invalidate_radius(): void;
2508
2608
  localCOM_validate(): void;
2509
- localCOM_invalidate(x: Any$C): void;
2609
+ localCOM_invalidate(x: Any$G): void;
2510
2610
  localCOM_immutable(): void;
2511
2611
  setupLocalCOM(): void;
2512
2612
  __validate_aabb(): void;
@@ -2517,11 +2617,11 @@ declare class ZPP_Circle {
2517
2617
  __scale(sx: number, sy: number): void;
2518
2618
  __translate(x: number, y: number): void;
2519
2619
  __rotate(x: number, y: number): void;
2520
- __transform(m: Any$C): void;
2521
- __copy(): Any$C;
2620
+ __transform(m: Any$G): void;
2621
+ __copy(): Any$G;
2522
2622
  }
2523
2623
 
2524
- type Any$B = any;
2624
+ type Any$F = any;
2525
2625
  /**
2526
2626
  * A circular physics shape.
2527
2627
  *
@@ -2531,7 +2631,7 @@ type Any$B = any;
2531
2631
  */
2532
2632
  declare class Circle extends Shape {
2533
2633
  static __name__: string[];
2534
- static __super__: Any$B;
2634
+ static __super__: Any$F;
2535
2635
  /** Direct access to the extracted internal ZPP_Circle. */
2536
2636
  zpp_inner_zn: ZPP_Circle;
2537
2637
  constructor(radius?: number, localCOM?: Vec2, material?: Material, filter?: InteractionFilter);
@@ -2541,26 +2641,152 @@ declare class Circle extends Shape {
2541
2641
  set radius(value: number);
2542
2642
  }
2543
2643
 
2644
+ /**
2645
+ * ZPP_Polygon — Internal polygon shape for the nape physics engine.
2646
+ *
2647
+ * Extends ZPP_Shape (type=1). Manages vertex rings (local/world),
2648
+ * edge lists, validation, and polygon-specific physics calculations.
2649
+ *
2650
+ * Converted from nape-compiled.js lines 42176–43786.
2651
+ */
2652
+ type Any$E = any;
2653
+ declare class ZPP_Polygon {
2654
+ static __name__: string[];
2655
+ static __super__: Any$E;
2656
+ static _nape: Any$E;
2657
+ static _zpp: Any$E;
2658
+ static _initialized: boolean;
2659
+ outer_zn: Any$E;
2660
+ lverts: Any$E;
2661
+ wrap_lverts: Any$E;
2662
+ gverts: Any$E;
2663
+ wrap_gverts: Any$E;
2664
+ edges: Any$E;
2665
+ wrap_edges: Any$E;
2666
+ edgeCnt: number;
2667
+ reverse_flag: boolean;
2668
+ zip_lverts: boolean;
2669
+ zip_laxi: boolean;
2670
+ zip_gverts: boolean;
2671
+ zip_gaxi: boolean;
2672
+ zip_valid: boolean;
2673
+ zip_sanitation: boolean;
2674
+ validation: Any$E;
2675
+ __class__: Any$E;
2676
+ body: Any$E;
2677
+ type: number;
2678
+ circle: Any$E;
2679
+ polygon: Any$E;
2680
+ aabb: Any$E;
2681
+ localCOMx: number;
2682
+ localCOMy: number;
2683
+ worldCOMx: number;
2684
+ worldCOMy: number;
2685
+ zip_localCOM: boolean;
2686
+ zip_worldCOM: boolean;
2687
+ zip_aabb: boolean;
2688
+ zip_sweepRadius: boolean;
2689
+ zip_area_inertia: boolean;
2690
+ zip_angDrag: boolean;
2691
+ area: number;
2692
+ inertia: number;
2693
+ angDrag: number;
2694
+ sweepCoef: number;
2695
+ sweepRadius: number;
2696
+ material: Any$E;
2697
+ filter: Any$E;
2698
+ wrap_localCOM: Any$E;
2699
+ outer: Any$E;
2700
+ outer_i: Any$E;
2701
+ invalidate_area_inertia: () => void;
2702
+ invalidate_angDrag: () => void;
2703
+ invalidate_localCOM: () => void;
2704
+ invalidate_worldCOM: () => void;
2705
+ validate_area_inertia: () => void;
2706
+ validate_localCOM: () => void;
2707
+ immutable_midstep: (name: string) => void;
2708
+ wake: () => void;
2709
+ setMaterial: (m: Any$E) => void;
2710
+ setFilter: (f: Any$E) => void;
2711
+ insert_cbtype: (cb: Any$E) => void;
2712
+ constructor();
2713
+ static _init(): void;
2714
+ __clear(): void;
2715
+ lverts_pa_invalidate(_x: Any$E): void;
2716
+ lverts_pa_immutable(): void;
2717
+ gverts_pa_validate(): void;
2718
+ lverts_post_adder(x: Any$E): void;
2719
+ lverts_subber(x: Any$E): void;
2720
+ lverts_invalidate(_: Any$E): void;
2721
+ lverts_validate(): void;
2722
+ lverts_modifiable(): void;
2723
+ gverts_validate(): void;
2724
+ edges_validate(): void;
2725
+ getlverts(): void;
2726
+ getgverts(): void;
2727
+ getedges(): void;
2728
+ invalidate_lverts(): void;
2729
+ invalidate_laxi(): void;
2730
+ invalidate_gverts(): void;
2731
+ invalidate_gaxi(): void;
2732
+ validate_lverts(): void;
2733
+ validate_laxi(): void;
2734
+ validate_gverts(): void;
2735
+ validate_gaxi(): void;
2736
+ /** Internal helper: recompute world vertex positions from local verts + body transform */
2737
+ private _validateGverts;
2738
+ cleanup_lvert(x: Any$E): void;
2739
+ splice_collinear(): void;
2740
+ splice_collinear_real(): void;
2741
+ reverse_vertices(): void;
2742
+ valid(): Any$E;
2743
+ /** Helper: check if two edges (u1→v1) and (a→b) do NOT intersect */
2744
+ private _checkNoIntersection;
2745
+ __validate_aabb(): void;
2746
+ _force_validate_aabb(): void;
2747
+ __validate_sweepRadius(): void;
2748
+ __validate_area_inertia(): void;
2749
+ __validate_angDrag(): void;
2750
+ __validate_localCOM(): void;
2751
+ localCOM_validate(): void;
2752
+ localCOM_invalidate(x: Any$E): void;
2753
+ setupLocalCOM(): void;
2754
+ __translate(dx: number, dy: number): void;
2755
+ __scale(sx: number, sy: number): void;
2756
+ __rotate(ax: number, ay: number): void;
2757
+ __transform(mat: Any$E): void;
2758
+ __copy(): Any$E;
2759
+ }
2760
+
2761
+ type Any$D = any;
2544
2762
  /**
2545
2763
  * A convex polygon physics shape.
2546
2764
  *
2765
+ * Fully modernized — uses ZPP_Polygon directly (extracted to TypeScript).
2547
2766
  * Use the static helper methods (`box`, `rect`, `regular`) for common shapes.
2548
2767
  */
2549
2768
  declare class Polygon extends Shape {
2550
- constructor(vertices?: Vec2[] | NapeInner, material?: Material, filter?: InteractionFilter);
2769
+ static __name__: string[];
2770
+ static __super__: Any$D;
2771
+ /** Direct access to the extracted internal ZPP_Polygon. */
2772
+ zpp_inner_zn: ZPP_Polygon;
2773
+ constructor(localVerts?: Vec2[] | Any$D, material?: Material, filter?: InteractionFilter);
2551
2774
  /** @internal */
2552
2775
  static _wrap(inner: NapeInner): Polygon;
2553
- static box(width: number, height: number, weak?: boolean): NapeInner;
2554
- static rect(x: number, y: number, width: number, height: number, weak?: boolean): NapeInner;
2555
- static regular(xRadius: number, yRadius: number, sides: number, angle?: number, weak?: boolean): NapeInner;
2776
+ static rect(x: number, y: number, width: number, height: number, weak?: boolean): Vec2[];
2777
+ static box(width: number, height?: number, weak?: boolean): Vec2[];
2778
+ static regular(xRadius: number, yRadius: number, edgeCount: number, angleOffset?: number, weak?: boolean): Vec2[];
2556
2779
  /** Read-only list of local-space vertices. */
2557
- get localVerts(): NapeInner;
2780
+ get localVerts(): Any$D;
2558
2781
  /** Read-only list of world-space vertices (computed after stepping). */
2559
- get worldVerts(): NapeInner;
2782
+ get worldVerts(): Any$D;
2560
2783
  /** Read-only edge list. */
2561
- get edges(): NapeInner;
2784
+ get edges(): Any$D;
2562
2785
  /** Validate the polygon geometry. */
2563
- validity(): NapeInner;
2786
+ validity(): Any$D;
2787
+ /** @internal */ get_localVerts(): Any$D;
2788
+ /** @internal */ get_worldVerts(): Any$D;
2789
+ /** @internal */ get_edges(): Any$D;
2564
2790
  }
2565
2791
 
2566
2792
  /**
@@ -2571,44 +2797,44 @@ declare class Polygon extends Shape {
2571
2797
  *
2572
2798
  * Converted from nape-compiled.js lines 41828–42175.
2573
2799
  */
2574
- type Any$A = any;
2800
+ type Any$C = any;
2575
2801
  declare class ZPP_Edge {
2576
2802
  static __name__: string[];
2577
2803
  static zpp_pool: ZPP_Edge | null;
2578
2804
  static internal: boolean;
2579
- static _nape: Any$A;
2580
- static _zpp: Any$A;
2581
- static _wrapFn: ((zpp: ZPP_Edge) => Any$A) | null;
2805
+ static _nape: Any$C;
2806
+ static _zpp: Any$C;
2807
+ static _wrapFn: ((zpp: ZPP_Edge) => Any$C) | null;
2582
2808
  next: ZPP_Edge | null;
2583
- polygon: Any$A;
2584
- outer: Any$A;
2809
+ polygon: Any$C;
2810
+ outer: Any$C;
2585
2811
  lnormx: number;
2586
2812
  lnormy: number;
2587
- wrap_lnorm: Any$A;
2813
+ wrap_lnorm: Any$C;
2588
2814
  gnormx: number;
2589
2815
  gnormy: number;
2590
- wrap_gnorm: Any$A;
2816
+ wrap_gnorm: Any$C;
2591
2817
  length: number;
2592
2818
  lprojection: number;
2593
2819
  gprojection: number;
2594
- lp0: Any$A;
2595
- gp0: Any$A;
2596
- lp1: Any$A;
2597
- gp1: Any$A;
2820
+ lp0: Any$C;
2821
+ gp0: Any$C;
2822
+ lp1: Any$C;
2823
+ gp1: Any$C;
2598
2824
  tp0: number;
2599
2825
  tp1: number;
2600
- __class__: Any$A;
2826
+ __class__: Any$C;
2601
2827
  constructor();
2602
2828
  free(): void;
2603
2829
  alloc(): void;
2604
- wrapper(): Any$A;
2830
+ wrapper(): Any$C;
2605
2831
  lnorm_validate(): void;
2606
2832
  gnorm_validate(): void;
2607
2833
  getlnorm(): void;
2608
2834
  getgnorm(): void;
2609
2835
  }
2610
2836
 
2611
- type Any$z = any;
2837
+ type Any$B = any;
2612
2838
  /**
2613
2839
  * An edge of a polygon shape.
2614
2840
  *
@@ -2623,9 +2849,9 @@ declare class Edge {
2623
2849
  zpp_inner: ZPP_Edge;
2624
2850
  constructor();
2625
2851
  /** @internal */
2626
- static _wrap(inner: Any$z): Edge;
2852
+ static _wrap(inner: Any$B): Edge;
2627
2853
  /** Parent polygon (as compiled Polygon wrapper). */
2628
- get polygon(): Any$z;
2854
+ get polygon(): Any$B;
2629
2855
  /** Local-space normal vector (immutable Vec2). */
2630
2856
  get localNormal(): Vec2;
2631
2857
  /** World-space normal vector (immutable Vec2). Requires polygon in a body. */
@@ -2724,17 +2950,17 @@ declare class ArbiterType {
2724
2950
  *
2725
2951
  * Converted from nape-compiled.js lines 29044–29362, 80738–80766.
2726
2952
  */
2727
- type Any$y = any;
2953
+ type Any$A = any;
2728
2954
  declare class ZPP_Arbiter {
2729
2955
  static __name__: string[];
2730
- static _nape: Any$y;
2731
- static _zpp: Any$y;
2956
+ static _nape: Any$A;
2957
+ static _zpp: Any$A;
2732
2958
  static internal: boolean;
2733
2959
  static COL: number;
2734
2960
  static FLUID: number;
2735
2961
  static SENSOR: number;
2736
- static types: Any$y[];
2737
- outer: Any$y;
2962
+ static types: Any$A[];
2963
+ outer: Any$A;
2738
2964
  hnext: ZPP_Arbiter | null;
2739
2965
  id: number;
2740
2966
  di: number;
@@ -2752,31 +2978,31 @@ declare class ZPP_Arbiter {
2752
2978
  fresh: boolean;
2753
2979
  immState: number;
2754
2980
  invalidated: boolean;
2755
- b1: Any$y;
2756
- b2: Any$y;
2757
- ws1: Any$y;
2758
- ws2: Any$y;
2759
- pair: Any$y;
2981
+ b1: Any$A;
2982
+ b2: Any$A;
2983
+ ws1: Any$A;
2984
+ ws2: Any$A;
2985
+ pair: Any$A;
2760
2986
  type: number;
2761
- colarb: Any$y;
2762
- fluidarb: Any$y;
2763
- sensorarb: Any$y;
2764
- __class__: Any$y;
2987
+ colarb: Any$A;
2988
+ fluidarb: Any$A;
2989
+ sensorarb: Any$A;
2990
+ __class__: Any$A;
2765
2991
  constructor();
2766
- wrapper(): Any$y;
2992
+ wrapper(): Any$A;
2767
2993
  inactiveme(): boolean;
2768
2994
  acting(): boolean;
2769
2995
  swap_features(): void;
2770
- lazyRetire(s: Any$y, b: Any$y): void;
2771
- sup_assign(s1: Any$y, s2: Any$y, id: number, di: number): void;
2996
+ lazyRetire(s: Any$A, b: Any$A): void;
2997
+ sup_assign(s1: Any$A, s2: Any$A, id: number, di: number): void;
2772
2998
  sup_retire(): void;
2773
2999
  /** Remove this arbiter from a ZNPList_ZPP_Arbiter */
2774
- static _removeFromArbiterList(list: Any$y, arb: ZPP_Arbiter, zpp: Any$y): void;
3000
+ static _removeFromArbiterList(list: Any$A, arb: ZPP_Arbiter, zpp: Any$A): void;
2775
3001
  /** Add this arbiter to a ZNPList_ZPP_Arbiter */
2776
- static _addToArbiterList(list: Any$y, arb: ZPP_Arbiter, zpp: Any$y): void;
3002
+ static _addToArbiterList(list: Any$A, arb: ZPP_Arbiter, zpp: Any$A): void;
2777
3003
  }
2778
3004
 
2779
- type Any$x = any;
3005
+ type Any$z = any;
2780
3006
  /**
2781
3007
  * Represents an interaction arbiter between two shapes.
2782
3008
  *
@@ -2795,21 +3021,21 @@ declare class Arbiter {
2795
3021
  /** Whether this arbiter is currently sleeping. */
2796
3022
  get isSleeping(): boolean;
2797
3023
  /** The type of this arbiter (COLLISION, SENSOR, or FLUID). */
2798
- get type(): Any$x;
3024
+ get type(): Any$z;
2799
3025
  /** Cast to CollisionArbiter if this is a collision, else null. */
2800
- get collisionArbiter(): Any$x;
3026
+ get collisionArbiter(): Any$z;
2801
3027
  /** Cast to FluidArbiter if this is a fluid interaction, else null. */
2802
- get fluidArbiter(): Any$x;
3028
+ get fluidArbiter(): Any$z;
2803
3029
  /** First shape (lower id). */
2804
- get shape1(): Any$x;
3030
+ get shape1(): Any$z;
2805
3031
  /** Second shape (higher id). */
2806
- get shape2(): Any$x;
3032
+ get shape2(): Any$z;
2807
3033
  /** Body of shape1. */
2808
- get body1(): Any$x;
3034
+ get body1(): Any$z;
2809
3035
  /** Body of shape2. */
2810
- get body2(): Any$x;
3036
+ get body2(): Any$z;
2811
3037
  /** The pre-handler state of this arbiter. */
2812
- get state(): Any$x;
3038
+ get state(): Any$z;
2813
3039
  /** Whether this is a collision arbiter. */
2814
3040
  isCollisionArbiter(): boolean;
2815
3041
  /** Whether this is a fluid arbiter. */
@@ -2820,15 +3046,15 @@ declare class Arbiter {
2820
3046
  * Total impulse of this arbiter. Base implementation returns Vec3(0,0,0).
2821
3047
  * Overridden by CollisionArbiter and FluidArbiter.
2822
3048
  */
2823
- totalImpulse(body?: Any$x, _freshOnly?: boolean): Vec3;
3049
+ totalImpulse(body?: Any$z, _freshOnly?: boolean): Vec3;
2824
3050
  toString(): string;
2825
3051
  /** @internal */
2826
3052
  protected _activeCheck(): void;
2827
3053
  /** @internal */
2828
- protected _checkBody(body: Any$x): void;
3054
+ protected _checkBody(body: Any$z): void;
2829
3055
  }
2830
3056
 
2831
- type Any$w = any;
3057
+ type Any$y = any;
2832
3058
  /**
2833
3059
  * A collision arbiter between two shapes in contact.
2834
3060
  *
@@ -2842,15 +3068,15 @@ declare class CollisionArbiter extends Arbiter {
2842
3068
  static __super__: typeof Arbiter;
2843
3069
  constructor();
2844
3070
  /** Contact points for this collision. */
2845
- get contacts(): Any$w;
3071
+ get contacts(): Any$y;
2846
3072
  /** Collision normal vector. */
2847
- get normal(): Any$w;
3073
+ get normal(): Any$y;
2848
3074
  /** Sum of the radii of the two shapes at the collision point. */
2849
3075
  get radius(): number;
2850
3076
  /** Reference edge of shape1 (if polygon), or null. */
2851
- get referenceEdge1(): Any$w;
3077
+ get referenceEdge1(): Any$y;
2852
3078
  /** Reference edge of shape2 (if polygon), or null. */
2853
- get referenceEdge2(): Any$w;
3079
+ get referenceEdge2(): Any$y;
2854
3080
  /** Coefficient of restitution (elasticity). Mutable in pre-handler only. */
2855
3081
  get elasticity(): number;
2856
3082
  set elasticity(value: number);
@@ -2868,20 +3094,20 @@ declare class CollisionArbiter extends Arbiter {
2868
3094
  /** Whether the second contact point lies on a polygon vertex (poly-circle only). */
2869
3095
  secondVertex(): boolean;
2870
3096
  /** Normal impulse accumulated across all contacts. */
2871
- normalImpulse(body?: Any$w, freshOnly?: boolean): Vec3;
3097
+ normalImpulse(body?: Any$y, freshOnly?: boolean): Vec3;
2872
3098
  /** Tangent (friction) impulse accumulated across all contacts. */
2873
- tangentImpulse(body?: Any$w, freshOnly?: boolean): Vec3;
3099
+ tangentImpulse(body?: Any$y, freshOnly?: boolean): Vec3;
2874
3100
  /** Total impulse (normal + tangent + rolling) accumulated across all contacts. */
2875
- totalImpulse(body?: Any$w, freshOnly?: boolean): Vec3;
3101
+ totalImpulse(body?: Any$y, freshOnly?: boolean): Vec3;
2876
3102
  /** Rolling impulse for this collision. */
2877
- rollingImpulse(body?: Any$w, freshOnly?: boolean): number;
3103
+ rollingImpulse(body?: Any$y, freshOnly?: boolean): number;
2878
3104
  /** @internal Throw if not in pre-handler mutable window. */
2879
3105
  private _mutableCheck;
2880
3106
  /** @internal Accumulate impulse from contacts. */
2881
3107
  private _accumulateImpulse;
2882
3108
  }
2883
3109
 
2884
- type Any$v = any;
3110
+ type Any$x = any;
2885
3111
  /**
2886
3112
  * A fluid arbiter between two shapes with fluid interaction.
2887
3113
  *
@@ -2901,14 +3127,14 @@ declare class FluidArbiter extends Arbiter {
2901
3127
  get overlap(): number;
2902
3128
  set overlap(value: number);
2903
3129
  /** Buoyancy impulse applied by this fluid arbiter. */
2904
- buoyancyImpulse(body?: Any$v): Vec3;
3130
+ buoyancyImpulse(body?: Any$x): Vec3;
2905
3131
  /** Drag impulse applied by this fluid arbiter. */
2906
- dragImpulse(body?: Any$v): Vec3;
3132
+ dragImpulse(body?: Any$x): Vec3;
2907
3133
  /** Total impulse (buoyancy + drag). */
2908
- totalImpulse(body?: Any$v, _freshOnly?: boolean): Vec3;
3134
+ totalImpulse(body?: Any$x, _freshOnly?: boolean): Vec3;
2909
3135
  }
2910
3136
 
2911
- type Any$u = any;
3137
+ type Any$w = any;
2912
3138
  /**
2913
3139
  * Represents a contact point between two colliding shapes.
2914
3140
  *
@@ -2925,7 +3151,7 @@ declare class Contact {
2925
3151
  get _inner(): NapeInner;
2926
3152
  constructor();
2927
3153
  /** The collision arbiter this contact belongs to, or null. */
2928
- get arbiter(): Any$u;
3154
+ get arbiter(): Any$w;
2929
3155
  /** Penetration depth of this contact (positive = overlapping). */
2930
3156
  get penetration(): number;
2931
3157
  /** World-space position of this contact point. */
@@ -2939,25 +3165,25 @@ declare class Contact {
2939
3165
  * @param body - If null, returns world-frame impulse. Otherwise returns
2940
3166
  * impulse on the given body (must be one of the two in contact).
2941
3167
  */
2942
- normalImpulse(body?: Any$u): Vec3;
3168
+ normalImpulse(body?: Any$w): Vec3;
2943
3169
  /**
2944
3170
  * Tangent impulse at this contact point.
2945
3171
  * @param body - If null, returns world-frame impulse. Otherwise returns
2946
3172
  * impulse on the given body.
2947
3173
  */
2948
- tangentImpulse(body?: Any$u): Vec3;
3174
+ tangentImpulse(body?: Any$w): Vec3;
2949
3175
  /**
2950
3176
  * Rolling impulse at this contact point.
2951
3177
  * @param body - If null, returns total rolling impulse. Otherwise returns
2952
3178
  * rolling impulse on the given body.
2953
3179
  */
2954
- rollingImpulse(body?: Any$u): number;
3180
+ rollingImpulse(body?: Any$w): number;
2955
3181
  /**
2956
3182
  * Total impulse (normal + tangent + rolling) at this contact point.
2957
3183
  * @param body - If null, returns world-frame impulse. Otherwise returns
2958
3184
  * impulse on the given body.
2959
3185
  */
2960
- totalImpulse(body?: Any$u): Vec3;
3186
+ totalImpulse(body?: Any$w): Vec3;
2961
3187
  toString(): string;
2962
3188
  /** @internal */
2963
3189
  private _inactiveCheck;
@@ -2965,6 +3191,39 @@ declare class Contact {
2965
3191
  private _checkBody;
2966
3192
  }
2967
3193
 
3194
+ /**
3195
+ * Callback event types.
3196
+ *
3197
+ * - `BEGIN` — interaction just started
3198
+ * - `ONGOING` — interaction continues
3199
+ * - `END` — interaction just ended
3200
+ * - `WAKE` — body/constraint woke up
3201
+ * - `SLEEP` — body/constraint went to sleep
3202
+ * - `BREAK` — constraint was broken
3203
+ * - `PRE` — pre-interaction callback
3204
+ *
3205
+ * Converted from nape-compiled.js lines 516–657.
3206
+ */
3207
+ declare class CbEvent {
3208
+ static __name__: string[];
3209
+ constructor();
3210
+ static get BEGIN(): CbEvent;
3211
+ static get ONGOING(): CbEvent;
3212
+ static get END(): CbEvent;
3213
+ static get WAKE(): CbEvent;
3214
+ static get SLEEP(): CbEvent;
3215
+ static get BREAK(): CbEvent;
3216
+ static get PRE(): CbEvent;
3217
+ static get_BEGIN(): CbEvent;
3218
+ static get_ONGOING(): CbEvent;
3219
+ static get_END(): CbEvent;
3220
+ static get_WAKE(): CbEvent;
3221
+ static get_SLEEP(): CbEvent;
3222
+ static get_BREAK(): CbEvent;
3223
+ static get_PRE(): CbEvent;
3224
+ toString(): string;
3225
+ }
3226
+
2968
3227
  /**
2969
3228
  * ZPP_CbType — Internal callback type for the nape physics engine.
2970
3229
  *
@@ -2974,41 +3233,41 @@ declare class Contact {
2974
3233
  *
2975
3234
  * Converted from nape-compiled.js lines 48256–48482.
2976
3235
  */
2977
- type Any$t = any;
3236
+ type Any$v = any;
2978
3237
  declare class ZPP_CbType {
2979
3238
  static __name__: string[];
2980
- static _zpp: Any$t;
2981
- outer: Any$t;
2982
- userData: Any$t;
3239
+ static _zpp: Any$v;
3240
+ outer: Any$v;
3241
+ userData: Any$v;
2983
3242
  id: number;
2984
- cbsets: Any$t;
2985
- interactors: Any$t;
2986
- wrap_interactors: Any$t;
2987
- constraints: Any$t;
2988
- wrap_constraints: Any$t;
2989
- listeners: Any$t;
2990
- bodylisteners: Any$t;
2991
- conlisteners: Any$t;
2992
- __class__: Any$t;
3243
+ cbsets: Any$v;
3244
+ interactors: Any$v;
3245
+ wrap_interactors: Any$v;
3246
+ constraints: Any$v;
3247
+ wrap_constraints: Any$v;
3248
+ listeners: Any$v;
3249
+ bodylisteners: Any$v;
3250
+ conlisteners: Any$v;
3251
+ __class__: Any$v;
2993
3252
  constructor();
2994
3253
  /** Sort comparator by id. */
2995
3254
  static setlt(a: ZPP_CbType, b: ZPP_CbType): boolean;
2996
- addInteractor(intx: Any$t): void;
2997
- remInteractor(intx: Any$t): void;
2998
- addConstraint(con: Any$t): void;
2999
- remConstraint(con: Any$t): void;
3000
- addint(x: Any$t): void;
3001
- removeint(x: Any$t): void;
3255
+ addInteractor(intx: Any$v): void;
3256
+ remInteractor(intx: Any$v): void;
3257
+ addConstraint(con: Any$v): void;
3258
+ remConstraint(con: Any$v): void;
3259
+ addint(x: Any$v): void;
3260
+ removeint(x: Any$v): void;
3002
3261
  invalidateint(): void;
3003
- addbody(x: Any$t): void;
3004
- removebody(x: Any$t): void;
3262
+ addbody(x: Any$v): void;
3263
+ removebody(x: Any$v): void;
3005
3264
  invalidatebody(): void;
3006
- addconstraint(x: Any$t): void;
3007
- removeconstraint(x: Any$t): void;
3265
+ addconstraint(x: Any$v): void;
3266
+ removeconstraint(x: Any$v): void;
3008
3267
  invalidateconstraint(): void;
3009
3268
  }
3010
3269
 
3011
- type Any$s = any;
3270
+ type Any$u = any;
3012
3271
  /**
3013
3272
  * Callback type — used to tag interactors so that listeners
3014
3273
  * can filter which interactions they respond to.
@@ -3029,11 +3288,11 @@ declare class CbType {
3029
3288
  static get_ANY_SHAPE(): CbType;
3030
3289
  static get_ANY_COMPOUND(): CbType;
3031
3290
  get id(): number;
3032
- get userData(): Any$s;
3033
- get interactors(): Any$s;
3034
- get constraints(): Any$s;
3035
- including(includes: Any$s): Any$s;
3036
- excluding(excludes: Any$s): Any$s;
3291
+ get userData(): Any$u;
3292
+ get interactors(): Any$u;
3293
+ get constraints(): Any$u;
3294
+ including(includes: Any$u): Any$u;
3295
+ excluding(excludes: Any$u): Any$u;
3037
3296
  toString(): string;
3038
3297
  static _wrap(inner: any): CbType;
3039
3298
  }
@@ -3094,37 +3353,37 @@ declare class PreFlag {
3094
3353
  *
3095
3354
  * Converted from nape-compiled.js lines 51337–51655.
3096
3355
  */
3097
- type Any$r = any;
3356
+ type Any$t = any;
3098
3357
  declare class ZPP_OptionType {
3099
3358
  static __name__: string[];
3100
- static _nape: Any$r;
3101
- static _zpp: Any$r;
3102
- outer: Any$r;
3103
- handler: ((val: Any$r, included: boolean, added: boolean) => void) | null;
3104
- includes: Any$r;
3105
- excludes: Any$r;
3106
- wrap_includes: Any$r;
3107
- wrap_excludes: Any$r;
3108
- __class__: Any$r;
3359
+ static _nape: Any$t;
3360
+ static _zpp: Any$t;
3361
+ outer: Any$t;
3362
+ handler: ((val: Any$t, included: boolean, added: boolean) => void) | null;
3363
+ includes: Any$t;
3364
+ excludes: Any$t;
3365
+ wrap_includes: Any$t;
3366
+ wrap_excludes: Any$t;
3367
+ __class__: Any$t;
3109
3368
  constructor();
3110
3369
  /** Coerce a value to OptionType (null → new, OptionType → pass-through, CbType → including). */
3111
- static argument(val: Any$r): Any$r;
3370
+ static argument(val: Any$t): Any$t;
3112
3371
  setup_includes(): void;
3113
3372
  setup_excludes(): void;
3114
- excluded(xs: Any$r): boolean;
3115
- included(xs: Any$r): boolean;
3116
- compatible(xs: Any$r): boolean;
3373
+ excluded(xs: Any$t): boolean;
3374
+ included(xs: Any$t): boolean;
3375
+ compatible(xs: Any$t): boolean;
3117
3376
  /** Check whether two sorted-by-id lists share any element. */
3118
- nonemptyintersection(xs: Any$r, ys: Any$r): boolean;
3377
+ nonemptyintersection(xs: Any$t, ys: Any$t): boolean;
3119
3378
  /** Insert into the ordered include or exclude list, using pool nodes. */
3120
3379
  private insertOrdered;
3121
- effect_change(val: Any$r, included: boolean, added: boolean): void;
3122
- append_type(list: Any$r, val: Any$r): void;
3380
+ effect_change(val: Any$t, included: boolean, added: boolean): void;
3381
+ append_type(list: Any$t, val: Any$t): void;
3123
3382
  set(options: ZPP_OptionType): this;
3124
- append(list: Any$r, val: Any$r): void;
3383
+ append(list: Any$t, val: Any$t): void;
3125
3384
  }
3126
3385
 
3127
- type Any$q = any;
3386
+ type Any$s = any;
3128
3387
  /**
3129
3388
  * Composite callback option type — allows including and excluding CbTypes.
3130
3389
  *
@@ -3134,17 +3393,103 @@ declare class OptionType {
3134
3393
  static __name__: string[];
3135
3394
  zpp_inner: ZPP_OptionType;
3136
3395
  get _inner(): NapeInner;
3137
- constructor(includes?: Any$q, excludes?: Any$q);
3138
- get includes(): Any$q;
3139
- get excludes(): Any$q;
3140
- get_includes(): Any$q;
3141
- get_excludes(): Any$q;
3142
- including(includes: Any$q): this;
3143
- excluding(excludes: Any$q): this;
3396
+ constructor(includes?: Any$s, excludes?: Any$s);
3397
+ get includes(): Any$s;
3398
+ get excludes(): Any$s;
3399
+ get_includes(): Any$s;
3400
+ get_excludes(): Any$s;
3401
+ including(includes: Any$s): this;
3402
+ excluding(excludes: Any$s): this;
3144
3403
  toString(): string;
3145
3404
  static _wrap(inner: any): OptionType;
3146
3405
  }
3147
3406
 
3407
+ /**
3408
+ * ZPP_Listener — Internal listener base class for the nape physics engine.
3409
+ *
3410
+ * Base class for ZPP_BodyListener, ZPP_ConstraintListener, and
3411
+ * ZPP_InteractionListener. Holds common properties (space, precedence,
3412
+ * event type, listener type) and provides stub methods for subclass override.
3413
+ *
3414
+ * Converted from nape-compiled.js lines 27259–27304, 112053–112139.
3415
+ */
3416
+ type Any$r = any;
3417
+ declare class ZPP_Listener {
3418
+ static __name__: string[];
3419
+ static _nape: Any$r;
3420
+ static _zpp: Any$r;
3421
+ static internal: boolean;
3422
+ static types: Any$r[];
3423
+ static events: Any$r[];
3424
+ space: Any$r;
3425
+ interaction: Any$r;
3426
+ constraint: Any$r;
3427
+ body: Any$r;
3428
+ precedence: number;
3429
+ event: number;
3430
+ type: number;
3431
+ id: number;
3432
+ outer: Any$r;
3433
+ __class__: Any$r;
3434
+ constructor();
3435
+ /** Sort comparator: higher precedence first, then by id descending. */
3436
+ static setlt(a: ZPP_Listener, b: ZPP_Listener): boolean;
3437
+ swapEvent(_event?: number): void;
3438
+ invalidate_precedence(): void;
3439
+ addedToSpace(): void;
3440
+ removedFromSpace(): void;
3441
+ }
3442
+
3443
+ /**
3444
+ * Listener type classification.
3445
+ *
3446
+ * - `BODY` — body event listener
3447
+ * - `CONSTRAINT` — constraint event listener
3448
+ * - `INTERACTION` — interaction event listener
3449
+ * - `PRE` — pre-interaction listener
3450
+ *
3451
+ * Converted from nape-compiled.js lines 2554–2646.
3452
+ */
3453
+ declare class ListenerType {
3454
+ static __name__: string[];
3455
+ static BODY: ListenerType | null;
3456
+ static CONSTRAINT: ListenerType | null;
3457
+ static INTERACTION: ListenerType | null;
3458
+ static PRE: ListenerType | null;
3459
+ constructor();
3460
+ static get_BODY(): ListenerType;
3461
+ static get_CONSTRAINT(): ListenerType;
3462
+ static get_INTERACTION(): ListenerType;
3463
+ static get_PRE(): ListenerType;
3464
+ toString(): string;
3465
+ }
3466
+
3467
+ /**
3468
+ * Listener — Base class for all physics event listeners.
3469
+ *
3470
+ * Provides common properties (type, event, precedence, space) and
3471
+ * toString() for all listener subclasses.
3472
+ *
3473
+ * Fully modernized from nape-compiled.js lines 231–433.
3474
+ */
3475
+
3476
+ type Any$q = any;
3477
+ declare class Listener {
3478
+ static __name__: string[];
3479
+ zpp_inner: ZPP_Listener;
3480
+ get _inner(): Any$q;
3481
+ constructor();
3482
+ static _wrap(inner: Any$q): Listener;
3483
+ get type(): ListenerType;
3484
+ get event(): CbEvent;
3485
+ set event(event: CbEvent);
3486
+ get precedence(): number;
3487
+ set precedence(precedence: number);
3488
+ get space(): Space | null;
3489
+ set space(space: Space | Any$q | null);
3490
+ toString(): string;
3491
+ }
3492
+
3148
3493
  /**
3149
3494
  * ZPP_BodyListener — Internal body listener for the nape physics engine.
3150
3495
  *
@@ -3324,62 +3669,7 @@ declare class PreListener extends Listener {
3324
3669
  set interactionType(interactionType: InteractionType | null);
3325
3670
  }
3326
3671
 
3327
- /**
3328
- * ZPP_Callback — Internal callback data holder for the nape physics engine.
3329
- *
3330
- * Stores callback event information (listener, event type, interactors, etc.)
3331
- * and forms a doubly-linked list for callback queue management.
3332
- *
3333
- * Converted from nape-compiled.js lines 44587–44794, 133299–133300.
3334
- */
3335
3672
  type Any$i = any;
3336
- declare class ZPP_Callback {
3337
- static __name__: string[];
3338
- static _nape: Any$i;
3339
- static _zpp: Any$i;
3340
- static internal: boolean;
3341
- static zpp_pool: ZPP_Callback | null;
3342
- outer_body: Any$i;
3343
- outer_con: Any$i;
3344
- outer_int: Any$i;
3345
- event: number;
3346
- listener: Any$i;
3347
- space: Any$i;
3348
- index: number;
3349
- next: ZPP_Callback | null;
3350
- prev: ZPP_Callback | null;
3351
- length: number;
3352
- int1: Any$i;
3353
- int2: Any$i;
3354
- set: Any$i;
3355
- wrap_arbiters: Any$i;
3356
- pre_arbiter: Any$i;
3357
- pre_swapped: boolean;
3358
- body: Any$i;
3359
- constraint: Any$i;
3360
- __class__: Any$i;
3361
- wrapper_body(): Any$i;
3362
- wrapper_con(): Any$i;
3363
- wrapper_int(): Any$i;
3364
- push(obj: ZPP_Callback): void;
3365
- push_rev(obj: ZPP_Callback): void;
3366
- pop(): ZPP_Callback;
3367
- pop_rev(): ZPP_Callback;
3368
- empty(): boolean;
3369
- clear(): void;
3370
- splice(o: ZPP_Callback): ZPP_Callback | null;
3371
- rotateL(): void;
3372
- rotateR(): void;
3373
- cycleNext(o: ZPP_Callback): ZPP_Callback | null;
3374
- cyclePrev(o: ZPP_Callback): ZPP_Callback | null;
3375
- at(i: number): ZPP_Callback;
3376
- rev_at(i: number): ZPP_Callback;
3377
- free(): void;
3378
- alloc(): void;
3379
- genarbs(): void;
3380
- }
3381
-
3382
- type Any$h = any;
3383
3673
  /**
3384
3674
  * Base class for all physics engine callbacks.
3385
3675
  *
@@ -3392,12 +3682,12 @@ declare class Callback {
3392
3682
  static __name__: string[];
3393
3683
  zpp_inner: ZPP_Callback | null;
3394
3684
  constructor();
3395
- get event(): Any$h;
3396
- get listener(): Any$h;
3685
+ get event(): Any$i;
3686
+ get listener(): Any$i;
3397
3687
  toString(): string;
3398
3688
  }
3399
3689
 
3400
- type Any$g = any;
3690
+ type Any$h = any;
3401
3691
  /**
3402
3692
  * Callback for body events (WAKE/SLEEP).
3403
3693
  *
@@ -3407,11 +3697,11 @@ type Any$g = any;
3407
3697
  */
3408
3698
  declare class BodyCallback extends Callback {
3409
3699
  static __name__: string[];
3410
- get body(): Any$g;
3700
+ get body(): Any$h;
3411
3701
  toString(): string;
3412
3702
  }
3413
3703
 
3414
- type Any$f = any;
3704
+ type Any$g = any;
3415
3705
  /**
3416
3706
  * Callback for constraint events (WAKE/SLEEP/BREAK).
3417
3707
  *
@@ -3421,11 +3711,11 @@ type Any$f = any;
3421
3711
  */
3422
3712
  declare class ConstraintCallback extends Callback {
3423
3713
  static __name__: string[];
3424
- get constraint(): Any$f;
3714
+ get constraint(): Any$g;
3425
3715
  toString(): string;
3426
3716
  }
3427
3717
 
3428
- type Any$e = any;
3718
+ type Any$f = any;
3429
3719
  /**
3430
3720
  * Callback for interaction events (BEGIN/END/ONGOING).
3431
3721
  *
@@ -3435,13 +3725,13 @@ type Any$e = any;
3435
3725
  */
3436
3726
  declare class InteractionCallback extends Callback {
3437
3727
  static __name__: string[];
3438
- get int1(): Any$e;
3439
- get int2(): Any$e;
3440
- get arbiters(): Any$e;
3728
+ get int1(): Any$f;
3729
+ get int2(): Any$f;
3730
+ get arbiters(): Any$f;
3441
3731
  toString(): string;
3442
3732
  }
3443
3733
 
3444
- type Any$d = any;
3734
+ type Any$e = any;
3445
3735
  /**
3446
3736
  * Callback for pre-interaction events.
3447
3737
  *
@@ -3451,9 +3741,9 @@ type Any$d = any;
3451
3741
  */
3452
3742
  declare class PreCallback extends Callback {
3453
3743
  static __name__: string[];
3454
- get arbiter(): Any$d;
3455
- get int1(): Any$d;
3456
- get int2(): Any$d;
3744
+ get arbiter(): Any$e;
3745
+ get int1(): Any$e;
3746
+ get int2(): Any$e;
3457
3747
  get swapped(): boolean;
3458
3748
  toString(): string;
3459
3749
  }
@@ -3468,24 +3758,24 @@ declare class PreCallback extends Callback {
3468
3758
  * Converted from nape-compiled.js lines 24611–25474.
3469
3759
  */
3470
3760
 
3471
- type Any$c = any;
3761
+ type Any$d = any;
3472
3762
  declare class ZPP_PivotJoint extends ZPP_Constraint {
3473
3763
  static __name__: string[];
3474
3764
  static __super__: typeof ZPP_Constraint;
3475
- static _wrapFn: ((zpp: ZPP_PivotJoint) => Any$c) | null;
3476
- outer_zn: Any$c;
3477
- b1: Any$c;
3478
- b2: Any$c;
3765
+ static _wrapFn: ((zpp: ZPP_PivotJoint) => Any$d) | null;
3766
+ outer_zn: Any$d;
3767
+ b1: Any$d;
3768
+ b2: Any$d;
3479
3769
  a1localx: number;
3480
3770
  a1localy: number;
3481
3771
  a1relx: number;
3482
3772
  a1rely: number;
3483
- wrap_a1: Any$c;
3773
+ wrap_a1: Any$d;
3484
3774
  a2localx: number;
3485
3775
  a2localy: number;
3486
3776
  a2relx: number;
3487
3777
  a2rely: number;
3488
- wrap_a2: Any$c;
3778
+ wrap_a2: Any$d;
3489
3779
  kMassa: number;
3490
3780
  kMassb: number;
3491
3781
  kMassc: number;
@@ -3496,18 +3786,18 @@ declare class ZPP_PivotJoint extends ZPP_Constraint {
3496
3786
  biasx: number;
3497
3787
  biasy: number;
3498
3788
  stepped: boolean;
3499
- __class__: Any$c;
3789
+ __class__: Any$d;
3500
3790
  constructor();
3501
- bodyImpulse(b: Any$c): Any$c;
3791
+ bodyImpulse(b: Any$d): Any$d;
3502
3792
  activeBodies(): void;
3503
3793
  inactiveBodies(): void;
3504
3794
  validate_a1(): void;
3505
- invalidate_a1(x: Any$c): void;
3795
+ invalidate_a1(x: Any$d): void;
3506
3796
  setup_a1(): void;
3507
3797
  validate_a2(): void;
3508
- invalidate_a2(x: Any$c): void;
3798
+ invalidate_a2(x: Any$d): void;
3509
3799
  setup_a2(): void;
3510
- copy(dict: Any$c, todo: Any$c): Any$c;
3800
+ copy(dict: Any$d, todo: Any$d): Any$d;
3511
3801
  validate(): void;
3512
3802
  wake_connected(): void;
3513
3803
  forest(): void;
@@ -3517,10 +3807,10 @@ declare class ZPP_PivotJoint extends ZPP_Constraint {
3517
3807
  warmStart(): void;
3518
3808
  applyImpulseVel(): boolean;
3519
3809
  applyImpulsePos(): boolean;
3520
- draw(_g: Any$c): void;
3810
+ draw(_g: Any$d): void;
3521
3811
  }
3522
3812
 
3523
- type Any$b = any;
3813
+ type Any$c = any;
3524
3814
  /**
3525
3815
  * A pivot (pin) joint that constrains two bodies to share an anchor point.
3526
3816
  *
@@ -3530,7 +3820,7 @@ declare class PivotJoint extends Constraint {
3530
3820
  zpp_inner: ZPP_PivotJoint;
3531
3821
  constructor(body1: Body | null, body2: Body | null, anchor1: Vec2, anchor2: Vec2);
3532
3822
  /** @internal */
3533
- static _wrap(inner: Any$b): PivotJoint;
3823
+ static _wrap(inner: Any$c): PivotJoint;
3534
3824
  get body1(): Body;
3535
3825
  set body1(value: Body | null);
3536
3826
  /** @internal */
@@ -3543,17 +3833,17 @@ declare class PivotJoint extends Constraint {
3543
3833
  set anchor1(value: Vec2);
3544
3834
  get anchor2(): Vec2;
3545
3835
  set anchor2(value: Vec2);
3546
- impulse(): Any$b;
3547
- bodyImpulse(body: Body): Any$b;
3836
+ impulse(): Any$c;
3837
+ bodyImpulse(body: Body): Any$c;
3548
3838
  visitBodies(lambda: (body: Body) => void): void;
3549
- /** @internal */ get_body1(): Any$b;
3550
- /** @internal */ set_body1(v: Any$b): Any$b;
3551
- /** @internal */ get_body2(): Any$b;
3552
- /** @internal */ set_body2(v: Any$b): Any$b;
3553
- /** @internal */ get_anchor1(): Any$b;
3554
- /** @internal */ set_anchor1(v: Any$b): Any$b;
3555
- /** @internal */ get_anchor2(): Any$b;
3556
- /** @internal */ set_anchor2(v: Any$b): Any$b;
3839
+ /** @internal */ get_body1(): Any$c;
3840
+ /** @internal */ set_body1(v: Any$c): Any$c;
3841
+ /** @internal */ get_body2(): Any$c;
3842
+ /** @internal */ set_body2(v: Any$c): Any$c;
3843
+ /** @internal */ get_anchor1(): Any$c;
3844
+ /** @internal */ set_anchor1(v: Any$c): Any$c;
3845
+ /** @internal */ get_anchor2(): Any$c;
3846
+ /** @internal */ set_anchor2(v: Any$c): Any$c;
3557
3847
  /** @internal backward compat alias for zpp_inner */
3558
3848
  get zpp_inner_zn(): ZPP_PivotJoint;
3559
3849
  set zpp_inner_zn(v: ZPP_PivotJoint);
@@ -3569,12 +3859,12 @@ declare class PivotJoint extends Constraint {
3569
3859
  * Converted from nape-compiled.js lines 22329–23204.
3570
3860
  */
3571
3861
 
3572
- type Any$a = any;
3862
+ type Any$b = any;
3573
3863
  declare class ZPP_DistanceJoint extends ZPP_Constraint {
3574
3864
  static __name__: string[];
3575
3865
  static __super__: typeof ZPP_Constraint;
3576
- static _wrapFn: ((zpp: ZPP_DistanceJoint) => Any$a) | null;
3577
- outer_zn: Any$a;
3866
+ static _wrapFn: ((zpp: ZPP_DistanceJoint) => Any$b) | null;
3867
+ outer_zn: Any$b;
3578
3868
  jointMin: number;
3579
3869
  jointMax: number;
3580
3870
  slack: boolean;
@@ -3583,8 +3873,8 @@ declare class ZPP_DistanceJoint extends ZPP_Constraint {
3583
3873
  ny: number;
3584
3874
  cx1: number;
3585
3875
  cx2: number;
3586
- b1: Any$a;
3587
- b2: Any$a;
3876
+ b1: Any$b;
3877
+ b2: Any$b;
3588
3878
  a1localx: number;
3589
3879
  a1localy: number;
3590
3880
  a1relx: number;
@@ -3593,27 +3883,27 @@ declare class ZPP_DistanceJoint extends ZPP_Constraint {
3593
3883
  a2localy: number;
3594
3884
  a2relx: number;
3595
3885
  a2rely: number;
3596
- wrap_a1: Any$a;
3597
- wrap_a2: Any$a;
3886
+ wrap_a1: Any$b;
3887
+ wrap_a2: Any$b;
3598
3888
  kMass: number;
3599
3889
  jAcc: number;
3600
3890
  jMax: number;
3601
3891
  gamma: number;
3602
3892
  bias: number;
3603
3893
  stepped: boolean;
3604
- __class__: Any$a;
3894
+ __class__: Any$b;
3605
3895
  constructor();
3606
3896
  is_slack(): boolean;
3607
- bodyImpulse(b: Any$a): Any$a;
3897
+ bodyImpulse(b: Any$b): Any$b;
3608
3898
  activeBodies(): void;
3609
3899
  inactiveBodies(): void;
3610
3900
  validate_a1(): void;
3611
- invalidate_a1(x: Any$a): void;
3901
+ invalidate_a1(x: Any$b): void;
3612
3902
  setup_a1(): void;
3613
3903
  validate_a2(): void;
3614
- invalidate_a2(x: Any$a): void;
3904
+ invalidate_a2(x: Any$b): void;
3615
3905
  setup_a2(): void;
3616
- copy(dict: Any$a, todo: Any$a): Any$a;
3906
+ copy(dict: Any$b, todo: Any$b): Any$b;
3617
3907
  validate(): void;
3618
3908
  wake_connected(): void;
3619
3909
  forest(): void;
@@ -3623,7 +3913,7 @@ declare class ZPP_DistanceJoint extends ZPP_Constraint {
3623
3913
  warmStart(): void;
3624
3914
  applyImpulseVel(): boolean;
3625
3915
  applyImpulsePos(): boolean;
3626
- draw(_g: Any$a): void;
3916
+ draw(_g: Any$b): void;
3627
3917
  /**
3628
3918
  * Creates (or reuses from pool) a public Vec2 wrapper for a constraint anchor
3629
3919
  * point stored as (localx, localy). Installs the given validate and invalidate
@@ -3631,10 +3921,10 @@ declare class ZPP_DistanceJoint extends ZPP_Constraint {
3631
3921
  *
3632
3922
  * Shared by all anchor-based joints (DistanceJoint, PivotJoint, LineJoint, etc.)
3633
3923
  */
3634
- static _setupAnchorVec2(localx: number, localy: number, validateFn: (() => void) | null, invalidateFn: ((vec: Any$a) => void) | null): Any$a;
3924
+ static _setupAnchorVec2(localx: number, localy: number, validateFn: (() => void) | null, invalidateFn: ((vec: Any$b) => void) | null): Any$b;
3635
3925
  }
3636
3926
 
3637
- type Any$9 = any;
3927
+ type Any$a = any;
3638
3928
  /**
3639
3929
  * Constrains the distance between two anchor points on two bodies.
3640
3930
  *
@@ -3644,7 +3934,7 @@ declare class DistanceJoint extends Constraint {
3644
3934
  zpp_inner: ZPP_DistanceJoint;
3645
3935
  constructor(body1: Body | null, body2: Body | null, anchor1: Vec2, anchor2: Vec2, jointMin: number, jointMax: number);
3646
3936
  /** @internal */
3647
- static _wrap(inner: Any$9): DistanceJoint;
3937
+ static _wrap(inner: Any$a): DistanceJoint;
3648
3938
  get body1(): Body;
3649
3939
  set body1(value: Body | null);
3650
3940
  /** @internal */
@@ -3662,17 +3952,17 @@ declare class DistanceJoint extends Constraint {
3662
3952
  get jointMax(): number;
3663
3953
  set jointMax(value: number);
3664
3954
  isSlack(): boolean;
3665
- impulse(): Any$9;
3666
- bodyImpulse(body: Body): Any$9;
3955
+ impulse(): Any$a;
3956
+ bodyImpulse(body: Body): Any$a;
3667
3957
  visitBodies(lambda: (body: Body) => void): void;
3668
- /** @internal */ get_body1(): Any$9;
3669
- /** @internal */ set_body1(v: Any$9): Any$9;
3670
- /** @internal */ get_body2(): Any$9;
3671
- /** @internal */ set_body2(v: Any$9): Any$9;
3672
- /** @internal */ get_anchor1(): Any$9;
3673
- /** @internal */ set_anchor1(v: Any$9): Any$9;
3674
- /** @internal */ get_anchor2(): Any$9;
3675
- /** @internal */ set_anchor2(v: Any$9): Any$9;
3958
+ /** @internal */ get_body1(): Any$a;
3959
+ /** @internal */ set_body1(v: Any$a): Any$a;
3960
+ /** @internal */ get_body2(): Any$a;
3961
+ /** @internal */ set_body2(v: Any$a): Any$a;
3962
+ /** @internal */ get_anchor1(): Any$a;
3963
+ /** @internal */ set_anchor1(v: Any$a): Any$a;
3964
+ /** @internal */ get_anchor2(): Any$a;
3965
+ /** @internal */ set_anchor2(v: Any$a): Any$a;
3676
3966
  /** @internal */ get_jointMin(): number;
3677
3967
  /** @internal */ set_jointMin(v: number): number;
3678
3968
  /** @internal */ get_jointMax(): number;
@@ -3691,53 +3981,53 @@ declare class DistanceJoint extends Constraint {
3691
3981
  * Converted from nape-compiled.js lines 21441–21912.
3692
3982
  */
3693
3983
 
3694
- type Any$8 = any;
3984
+ type Any$9 = any;
3695
3985
  declare class ZPP_AngleJoint extends ZPP_Constraint {
3696
3986
  static __name__: string[];
3697
- static _wrapFn: ((zpp: ZPP_AngleJoint) => Any$8) | null;
3698
- outer_zn: Any$8;
3987
+ static _wrapFn: ((zpp: ZPP_AngleJoint) => Any$9) | null;
3988
+ outer_zn: Any$9;
3699
3989
  ratio: number;
3700
3990
  jointMin: number;
3701
3991
  jointMax: number;
3702
3992
  slack: boolean;
3703
3993
  equal: boolean;
3704
3994
  scale: number;
3705
- b1: Any$8;
3706
- b2: Any$8;
3995
+ b1: Any$9;
3996
+ b2: Any$9;
3707
3997
  kMass: number;
3708
3998
  jAcc: number;
3709
3999
  jMax: number;
3710
4000
  gamma: number;
3711
4001
  bias: number;
3712
4002
  stepped: boolean;
3713
- __class__: Any$8;
4003
+ __class__: Any$9;
3714
4004
  constructor();
3715
4005
  is_slack(): boolean;
3716
- bodyImpulse(b: Any$8): Any$8;
4006
+ bodyImpulse(b: Any$9): Any$9;
3717
4007
  activeBodies(): void;
3718
4008
  inactiveBodies(): void;
3719
- copy(dict?: Any$8, todo?: Any$8): Any$8;
4009
+ copy(dict?: Any$9, todo?: Any$9): Any$9;
3720
4010
  validate(): void;
3721
4011
  wake_connected(): void;
3722
4012
  forest(): void;
3723
- pair_exists(id: Any$8, di: Any$8): boolean;
4013
+ pair_exists(id: Any$9, di: Any$9): boolean;
3724
4014
  clearcache(): void;
3725
4015
  preStep(dt: number): boolean;
3726
4016
  warmStart(): void;
3727
4017
  applyImpulseVel(): boolean;
3728
4018
  applyImpulsePos(): boolean;
3729
- draw(_g: Any$8): void;
4019
+ draw(_g: Any$9): void;
3730
4020
  /**
3731
4021
  * Small-angle-optimized body rotation. Used by all joints' applyImpulsePos.
3732
4022
  */
3733
- static _rotateBody(body: Any$8, dr: number): void;
4023
+ static _rotateBody(body: Any$9, dr: number): void;
3734
4024
  /**
3735
4025
  * Dict-lookup / deferred-todo body copying. Used by all joints' copy().
3736
4026
  */
3737
- static _copyBody(dict: Any$8, todo: Any$8, srcBody: Any$8, ret: Any$8, field: string): void;
4027
+ static _copyBody(dict: Any$9, todo: Any$9, srcBody: Any$9, ret: Any$9, field: string): void;
3738
4028
  }
3739
4029
 
3740
- type Any$7 = any;
4030
+ type Any$8 = any;
3741
4031
  /**
3742
4032
  * Constrains the relative angle between two bodies.
3743
4033
  *
@@ -3747,7 +4037,7 @@ declare class AngleJoint extends Constraint {
3747
4037
  zpp_inner: ZPP_AngleJoint;
3748
4038
  constructor(body1: Body | null, body2: Body | null, jointMin: number, jointMax: number, ratio?: number);
3749
4039
  /** @internal */
3750
- static _wrap(inner: Any$7): AngleJoint;
4040
+ static _wrap(inner: Any$8): AngleJoint;
3751
4041
  get body1(): Body;
3752
4042
  set body1(value: Body | null);
3753
4043
  /** @internal */
@@ -3763,13 +4053,13 @@ declare class AngleJoint extends Constraint {
3763
4053
  get ratio(): number;
3764
4054
  set ratio(value: number);
3765
4055
  isSlack(): boolean;
3766
- impulse(): Any$7;
3767
- bodyImpulse(body: Body): Any$7;
4056
+ impulse(): Any$8;
4057
+ bodyImpulse(body: Body): Any$8;
3768
4058
  visitBodies(lambda: (body: Body) => void): void;
3769
- /** @internal */ get_body1(): Any$7;
3770
- /** @internal */ set_body1(v: Any$7): Any$7;
3771
- /** @internal */ get_body2(): Any$7;
3772
- /** @internal */ set_body2(v: Any$7): Any$7;
4059
+ /** @internal */ get_body1(): Any$8;
4060
+ /** @internal */ set_body1(v: Any$8): Any$8;
4061
+ /** @internal */ get_body2(): Any$8;
4062
+ /** @internal */ set_body2(v: Any$8): Any$8;
3773
4063
  /** @internal */ get_jointMin(): number;
3774
4064
  /** @internal */ set_jointMin(v: number): number;
3775
4065
  /** @internal */ get_jointMax(): number;
@@ -3791,24 +4081,24 @@ declare class AngleJoint extends Constraint {
3791
4081
  * Converted from nape-compiled.js lines 28055–29046.
3792
4082
  */
3793
4083
 
3794
- type Any$6 = any;
4084
+ type Any$7 = any;
3795
4085
  declare class ZPP_WeldJoint extends ZPP_Constraint {
3796
4086
  static __name__: string[];
3797
4087
  static __super__: typeof ZPP_Constraint;
3798
- static _wrapFn: ((zpp: ZPP_WeldJoint) => Any$6) | null;
3799
- outer_zn: Any$6;
3800
- b1: Any$6;
3801
- b2: Any$6;
4088
+ static _wrapFn: ((zpp: ZPP_WeldJoint) => Any$7) | null;
4089
+ outer_zn: Any$7;
4090
+ b1: Any$7;
4091
+ b2: Any$7;
3802
4092
  a1localx: number;
3803
4093
  a1localy: number;
3804
4094
  a1relx: number;
3805
4095
  a1rely: number;
3806
- wrap_a1: Any$6;
4096
+ wrap_a1: Any$7;
3807
4097
  a2localx: number;
3808
4098
  a2localy: number;
3809
4099
  a2relx: number;
3810
4100
  a2rely: number;
3811
- wrap_a2: Any$6;
4101
+ wrap_a2: Any$7;
3812
4102
  phase: number;
3813
4103
  kMassa: number;
3814
4104
  kMassb: number;
@@ -3825,18 +4115,18 @@ declare class ZPP_WeldJoint extends ZPP_Constraint {
3825
4115
  biasy: number;
3826
4116
  biasz: number;
3827
4117
  stepped: boolean;
3828
- __class__: Any$6;
4118
+ __class__: Any$7;
3829
4119
  constructor();
3830
- bodyImpulse(b: Any$6): Any$6;
4120
+ bodyImpulse(b: Any$7): Any$7;
3831
4121
  activeBodies(): void;
3832
4122
  inactiveBodies(): void;
3833
4123
  validate_a1(): void;
3834
- invalidate_a1(x: Any$6): void;
4124
+ invalidate_a1(x: Any$7): void;
3835
4125
  setup_a1(): void;
3836
4126
  validate_a2(): void;
3837
- invalidate_a2(x: Any$6): void;
4127
+ invalidate_a2(x: Any$7): void;
3838
4128
  setup_a2(): void;
3839
- copy(dict: Any$6, todo: Any$6): Any$6;
4129
+ copy(dict: Any$7, todo: Any$7): Any$7;
3840
4130
  validate(): void;
3841
4131
  wake_connected(): void;
3842
4132
  forest(): void;
@@ -3846,10 +4136,10 @@ declare class ZPP_WeldJoint extends ZPP_Constraint {
3846
4136
  warmStart(): void;
3847
4137
  applyImpulseVel(): boolean;
3848
4138
  applyImpulsePos(): boolean;
3849
- draw(_g: Any$6): void;
4139
+ draw(_g: Any$7): void;
3850
4140
  }
3851
4141
 
3852
- type Any$5 = any;
4142
+ type Any$6 = any;
3853
4143
  /**
3854
4144
  * Weld joint — constrains two bodies to maintain a fixed relative
3855
4145
  * position and angle (like gluing them together).
@@ -3860,7 +4150,7 @@ declare class WeldJoint extends Constraint {
3860
4150
  zpp_inner: ZPP_WeldJoint;
3861
4151
  constructor(body1: Body | null, body2: Body | null, anchor1: Vec2, anchor2: Vec2, phase?: number);
3862
4152
  /** @internal */
3863
- static _wrap(inner: Any$5): WeldJoint;
4153
+ static _wrap(inner: Any$6): WeldJoint;
3864
4154
  get body1(): Body;
3865
4155
  set body1(value: Body | null);
3866
4156
  /** @internal */
@@ -3875,17 +4165,17 @@ declare class WeldJoint extends Constraint {
3875
4165
  set anchor2(value: Vec2);
3876
4166
  get phase(): number;
3877
4167
  set phase(value: number);
3878
- impulse(): Any$5;
3879
- bodyImpulse(body: Body): Any$5;
4168
+ impulse(): Any$6;
4169
+ bodyImpulse(body: Body): Any$6;
3880
4170
  visitBodies(lambda: (body: Body) => void): void;
3881
- /** @internal */ get_body1(): Any$5;
3882
- /** @internal */ set_body1(v: Any$5): Any$5;
3883
- /** @internal */ get_body2(): Any$5;
3884
- /** @internal */ set_body2(v: Any$5): Any$5;
3885
- /** @internal */ get_anchor1(): Any$5;
3886
- /** @internal */ set_anchor1(v: Any$5): Any$5;
3887
- /** @internal */ get_anchor2(): Any$5;
3888
- /** @internal */ set_anchor2(v: Any$5): Any$5;
4171
+ /** @internal */ get_body1(): Any$6;
4172
+ /** @internal */ set_body1(v: Any$6): Any$6;
4173
+ /** @internal */ get_body2(): Any$6;
4174
+ /** @internal */ set_body2(v: Any$6): Any$6;
4175
+ /** @internal */ get_anchor1(): Any$6;
4176
+ /** @internal */ set_anchor1(v: Any$6): Any$6;
4177
+ /** @internal */ get_anchor2(): Any$6;
4178
+ /** @internal */ set_anchor2(v: Any$6): Any$6;
3889
4179
  /** @internal */ get_phase(): number;
3890
4180
  /** @internal */ set_phase(v: number): number;
3891
4181
  /** @internal backward compat alias for zpp_inner */
@@ -3902,29 +4192,29 @@ declare class WeldJoint extends Constraint {
3902
4192
  * Converted from nape-compiled.js lines 23892–24197.
3903
4193
  */
3904
4194
 
3905
- type Any$4 = any;
4195
+ type Any$5 = any;
3906
4196
  declare class ZPP_MotorJoint extends ZPP_Constraint {
3907
4197
  static __name__: string[];
3908
- static _wrapFn: ((zpp: ZPP_MotorJoint) => Any$4) | null;
3909
- outer_zn: Any$4;
4198
+ static _wrapFn: ((zpp: ZPP_MotorJoint) => Any$5) | null;
4199
+ outer_zn: Any$5;
3910
4200
  ratio: number;
3911
4201
  rate: number;
3912
- b1: Any$4;
3913
- b2: Any$4;
4202
+ b1: Any$5;
4203
+ b2: Any$5;
3914
4204
  kMass: number;
3915
4205
  jAcc: number;
3916
4206
  jMax: number;
3917
4207
  stepped: boolean;
3918
- __class__: Any$4;
4208
+ __class__: Any$5;
3919
4209
  constructor();
3920
- bodyImpulse(b: Any$4): Any$4;
4210
+ bodyImpulse(b: Any$5): Any$5;
3921
4211
  activeBodies(): void;
3922
4212
  inactiveBodies(): void;
3923
- copy(dict?: Any$4, todo?: Any$4): Any$4;
4213
+ copy(dict?: Any$5, todo?: Any$5): Any$5;
3924
4214
  validate(): void;
3925
4215
  wake_connected(): void;
3926
4216
  forest(): void;
3927
- pair_exists(id: Any$4, di: Any$4): boolean;
4217
+ pair_exists(id: Any$5, di: Any$5): boolean;
3928
4218
  clearcache(): void;
3929
4219
  preStep(dt: number): boolean;
3930
4220
  warmStart(): void;
@@ -3932,7 +4222,7 @@ declare class ZPP_MotorJoint extends ZPP_Constraint {
3932
4222
  applyImpulsePos(): boolean;
3933
4223
  }
3934
4224
 
3935
- type Any$3 = any;
4225
+ type Any$4 = any;
3936
4226
  /**
3937
4227
  * Motor joint — applies angular velocity to rotate bodies relative to each other.
3938
4228
  *
@@ -3942,7 +4232,7 @@ declare class MotorJoint extends Constraint {
3942
4232
  zpp_inner: ZPP_MotorJoint;
3943
4233
  constructor(body1: Body | null, body2: Body | null, rate?: number, ratio?: number);
3944
4234
  /** @internal */
3945
- static _wrap(inner: Any$3): MotorJoint;
4235
+ static _wrap(inner: Any$4): MotorJoint;
3946
4236
  get body1(): Body;
3947
4237
  set body1(value: Body | null);
3948
4238
  /** @internal */
@@ -3955,13 +4245,13 @@ declare class MotorJoint extends Constraint {
3955
4245
  set rate(value: number);
3956
4246
  get ratio(): number;
3957
4247
  set ratio(value: number);
3958
- impulse(): Any$3;
3959
- bodyImpulse(body: Body): Any$3;
4248
+ impulse(): Any$4;
4249
+ bodyImpulse(body: Body): Any$4;
3960
4250
  visitBodies(lambda: (body: Body) => void): void;
3961
- /** @internal */ get_body1(): Any$3;
3962
- /** @internal */ set_body1(v: Any$3): Any$3;
3963
- /** @internal */ get_body2(): Any$3;
3964
- /** @internal */ set_body2(v: Any$3): Any$3;
4251
+ /** @internal */ get_body1(): Any$4;
4252
+ /** @internal */ set_body1(v: Any$4): Any$4;
4253
+ /** @internal */ get_body2(): Any$4;
4254
+ /** @internal */ set_body2(v: Any$4): Any$4;
3965
4255
  /** @internal */ get_rate(): number;
3966
4256
  /** @internal */ set_rate(v: number): number;
3967
4257
  /** @internal */ get_ratio(): number;
@@ -3981,12 +4271,12 @@ declare class MotorJoint extends Constraint {
3981
4271
  * Converted from nape-compiled.js lines 23205–23304.
3982
4272
  */
3983
4273
 
3984
- type Any$2 = any;
4274
+ type Any$3 = any;
3985
4275
  declare class ZPP_LineJoint extends ZPP_Constraint {
3986
4276
  static __name__: string[];
3987
4277
  static __super__: typeof ZPP_Constraint;
3988
- static _wrapFn: ((zpp: ZPP_LineJoint) => Any$2) | null;
3989
- outer_zn: Any$2;
4278
+ static _wrapFn: ((zpp: ZPP_LineJoint) => Any$3) | null;
4279
+ outer_zn: Any$3;
3990
4280
  scale: number;
3991
4281
  jointMin: number;
3992
4282
  jointMax: number;
@@ -3995,35 +4285,35 @@ declare class ZPP_LineJoint extends ZPP_Constraint {
3995
4285
  dot2: number;
3996
4286
  cx1: number;
3997
4287
  cx2: number;
3998
- b1: Any$2;
4288
+ b1: Any$3;
3999
4289
  a1localx: number;
4000
4290
  a1localy: number;
4001
4291
  a1relx: number;
4002
4292
  a1rely: number;
4003
- wrap_a1: Any$2;
4004
- b2: Any$2;
4293
+ wrap_a1: Any$3;
4294
+ b2: Any$3;
4005
4295
  a2localx: number;
4006
4296
  a2localy: number;
4007
4297
  a2relx: number;
4008
4298
  a2rely: number;
4009
- wrap_a2: Any$2;
4010
- zip_n: Any$2;
4299
+ wrap_a2: Any$3;
4300
+ zip_n: Any$3;
4011
4301
  nlocalx: number;
4012
4302
  nlocaly: number;
4013
4303
  nrelx: number;
4014
4304
  nrely: number;
4015
- wrap_n: Any$2;
4305
+ wrap_n: Any$3;
4016
4306
  kMassa: number;
4017
4307
  kMassb: number;
4018
4308
  kMassc: number;
4019
4309
  jAccx: number;
4020
4310
  jAccy: number;
4021
- jMax: Any$2;
4022
- gamma: Any$2;
4311
+ jMax: Any$3;
4312
+ gamma: Any$3;
4023
4313
  biasx: number;
4024
4314
  biasy: number;
4025
4315
  stepped: boolean;
4026
- __class__: Any$2;
4316
+ __class__: Any$3;
4027
4317
  constructor();
4028
4318
  /**
4029
4319
  * Creates or recycles a Vec2 from the public pool, sets its x/y,
@@ -4032,19 +4322,19 @@ declare class ZPP_LineJoint extends ZPP_Constraint {
4032
4322
  */
4033
4323
  private _setupVec2;
4034
4324
  validate_a1(): void;
4035
- invalidate_a1(x: Any$2): void;
4325
+ invalidate_a1(x: Any$3): void;
4036
4326
  setup_a1(): void;
4037
4327
  validate_a2(): void;
4038
- invalidate_a2(x: Any$2): void;
4328
+ invalidate_a2(x: Any$3): void;
4039
4329
  setup_a2(): void;
4040
4330
  validate_n(): void;
4041
- invalidate_n(x: Any$2): void;
4331
+ invalidate_n(x: Any$3): void;
4042
4332
  setup_n(): void;
4043
4333
  validate_norm(): void;
4044
- bodyImpulse(b: Any$2): Any$2;
4334
+ bodyImpulse(b: Any$3): Any$3;
4045
4335
  activeBodies(): void;
4046
4336
  inactiveBodies(): void;
4047
- copy(dict: Any$2, todo: Any$2): Any$2;
4337
+ copy(dict: Any$3, todo: Any$3): Any$3;
4048
4338
  validate(): void;
4049
4339
  wake_connected(): void;
4050
4340
  forest(): void;
@@ -4054,10 +4344,10 @@ declare class ZPP_LineJoint extends ZPP_Constraint {
4054
4344
  warmStart(): void;
4055
4345
  applyImpulseVel(): boolean;
4056
4346
  applyImpulsePos(): boolean;
4057
- draw(_g: Any$2): void;
4347
+ draw(_g: Any$3): void;
4058
4348
  }
4059
4349
 
4060
- type Any$1 = any;
4350
+ type Any$2 = any;
4061
4351
  /**
4062
4352
  * Line joint — constrains body2's anchor to slide along a line
4063
4353
  * defined by body1's anchor and direction.
@@ -4068,7 +4358,7 @@ declare class LineJoint extends Constraint {
4068
4358
  zpp_inner: ZPP_LineJoint;
4069
4359
  constructor(body1: Body | null, body2: Body | null, anchor1: Vec2, anchor2: Vec2, direction: Vec2, jointMin: number, jointMax: number);
4070
4360
  /** @internal */
4071
- static _wrap(inner: Any$1): LineJoint;
4361
+ static _wrap(inner: Any$2): LineJoint;
4072
4362
  get body1(): Body;
4073
4363
  set body1(value: Body | null);
4074
4364
  /** @internal */
@@ -4087,19 +4377,19 @@ declare class LineJoint extends Constraint {
4087
4377
  set jointMin(value: number);
4088
4378
  get jointMax(): number;
4089
4379
  set jointMax(value: number);
4090
- impulse(): Any$1;
4091
- bodyImpulse(body: Body): Any$1;
4380
+ impulse(): Any$2;
4381
+ bodyImpulse(body: Body): Any$2;
4092
4382
  visitBodies(lambda: (body: Body) => void): void;
4093
- /** @internal */ get_body1(): Any$1;
4094
- /** @internal */ set_body1(v: Any$1): Any$1;
4095
- /** @internal */ get_body2(): Any$1;
4096
- /** @internal */ set_body2(v: Any$1): Any$1;
4097
- /** @internal */ get_anchor1(): Any$1;
4098
- /** @internal */ set_anchor1(v: Any$1): Any$1;
4099
- /** @internal */ get_anchor2(): Any$1;
4100
- /** @internal */ set_anchor2(v: Any$1): Any$1;
4101
- /** @internal */ get_direction(): Any$1;
4102
- /** @internal */ set_direction(v: Any$1): Any$1;
4383
+ /** @internal */ get_body1(): Any$2;
4384
+ /** @internal */ set_body1(v: Any$2): Any$2;
4385
+ /** @internal */ get_body2(): Any$2;
4386
+ /** @internal */ set_body2(v: Any$2): Any$2;
4387
+ /** @internal */ get_anchor1(): Any$2;
4388
+ /** @internal */ set_anchor1(v: Any$2): Any$2;
4389
+ /** @internal */ get_anchor2(): Any$2;
4390
+ /** @internal */ set_anchor2(v: Any$2): Any$2;
4391
+ /** @internal */ get_direction(): Any$2;
4392
+ /** @internal */ set_direction(v: Any$2): Any$2;
4103
4393
  /** @internal */ get_jointMin(): number;
4104
4394
  /** @internal */ set_jointMin(v: number): number;
4105
4395
  /** @internal */ get_jointMax(): number;
@@ -4109,13 +4399,108 @@ declare class LineJoint extends Constraint {
4109
4399
  set zpp_inner_zn(v: ZPP_LineJoint);
4110
4400
  }
4111
4401
 
4402
+ /**
4403
+ * ZPP_PulleyJoint — Internal 4-body, 1-DOF pulley constraint.
4404
+ *
4405
+ * Constrains (dist(b1,b2) + ratio * dist(b3,b4)) to [jointMin, jointMax].
4406
+ * Supports mechanical advantage ratio, slack detection, stiffness/damping,
4407
+ * and large-error pre-correction in applyImpulsePos.
4408
+ *
4409
+ * Converted from nape-compiled.js lines 25475–25367.
4410
+ */
4411
+
4412
+ type Any$1 = any;
4413
+ declare class ZPP_PulleyJoint extends ZPP_Constraint {
4414
+ static __name__: string[];
4415
+ static __super__: typeof ZPP_Constraint;
4416
+ static _wrapFn: ((zpp: ZPP_PulleyJoint) => Any$1) | null;
4417
+ outer_zn: Any$1;
4418
+ ratio: number;
4419
+ jointMin: number;
4420
+ jointMax: number;
4421
+ slack: boolean;
4422
+ equal: boolean;
4423
+ n12x: number;
4424
+ n12y: number;
4425
+ n34x: number;
4426
+ n34y: number;
4427
+ cx1: number;
4428
+ cx2: number;
4429
+ cx3: number;
4430
+ cx4: number;
4431
+ b1: Any$1;
4432
+ a1localx: number;
4433
+ a1localy: number;
4434
+ a1relx: number;
4435
+ a1rely: number;
4436
+ wrap_a1: Any$1;
4437
+ b2: Any$1;
4438
+ a2localx: number;
4439
+ a2localy: number;
4440
+ a2relx: number;
4441
+ a2rely: number;
4442
+ wrap_a2: Any$1;
4443
+ b3: Any$1;
4444
+ a3localx: number;
4445
+ a3localy: number;
4446
+ a3relx: number;
4447
+ a3rely: number;
4448
+ wrap_a3: Any$1;
4449
+ b4: Any$1;
4450
+ a4localx: number;
4451
+ a4localy: number;
4452
+ a4relx: number;
4453
+ a4rely: number;
4454
+ wrap_a4: Any$1;
4455
+ kMass: number;
4456
+ jAcc: number;
4457
+ jMax: number;
4458
+ gamma: number;
4459
+ bias: number;
4460
+ stepped: boolean;
4461
+ __class__: Any$1;
4462
+ constructor();
4463
+ is_slack(): boolean;
4464
+ bodyImpulse(b: Any$1): Any$1;
4465
+ activeBodies(): void;
4466
+ inactiveBodies(): void;
4467
+ validate_a1(): void;
4468
+ invalidate_a1(x: Any$1): void;
4469
+ setup_a1(): void;
4470
+ validate_a2(): void;
4471
+ invalidate_a2(x: Any$1): void;
4472
+ setup_a2(): void;
4473
+ validate_a3(): void;
4474
+ invalidate_a3(x: Any$1): void;
4475
+ setup_a3(): void;
4476
+ validate_a4(): void;
4477
+ invalidate_a4(x: Any$1): void;
4478
+ setup_a4(): void;
4479
+ copy(dict: Any$1, todo: Any$1): Any$1;
4480
+ validate(): void;
4481
+ wake_connected(): void;
4482
+ forest(): void;
4483
+ pair_exists(id: number, di: number): boolean;
4484
+ clearcache(): void;
4485
+ preStep(dt: number): boolean;
4486
+ warmStart(): void;
4487
+ applyImpulseVel(): boolean;
4488
+ applyImpulsePos(): boolean;
4489
+ draw(_g: Any$1): void;
4490
+ }
4491
+
4112
4492
  type Any = any;
4113
4493
  /**
4114
- * Pulley joint — constrains the sum of distances between four anchor points
4115
- * on four bodies.
4494
+ * Pulley joint — constrains the weighted sum of distances between
4495
+ * four anchor points on four bodies.
4496
+ *
4497
+ * Fully modernized — uses ZPP_PulleyJoint directly (extracted to TypeScript).
4116
4498
  */
4117
4499
  declare class PulleyJoint extends Constraint {
4500
+ zpp_inner: ZPP_PulleyJoint;
4118
4501
  constructor(body1: Body | null, body2: Body | null, body3: Body | null, body4: Body | null, anchor1: Vec2, anchor2: Vec2, anchor3: Vec2, anchor4: Vec2, jointMin: number, jointMax: number, ratio?: number);
4502
+ /** @internal Helper to set an anchor during construction. */
4503
+ private _setAnchorInit;
4119
4504
  /** @internal */
4120
4505
  static _wrap(inner: Any): PulleyJoint;
4121
4506
  get body1(): Body;
@@ -4126,6 +4511,14 @@ declare class PulleyJoint extends Constraint {
4126
4511
  set body3(value: Body | null);
4127
4512
  get body4(): Body;
4128
4513
  set body4(value: Body | null);
4514
+ /** @internal */
4515
+ private _setBody1;
4516
+ /** @internal */
4517
+ private _setBody2;
4518
+ /** @internal */
4519
+ private _setBody3;
4520
+ /** @internal */
4521
+ private _setBody4;
4129
4522
  get anchor1(): Vec2;
4130
4523
  set anchor1(value: Vec2);
4131
4524
  get anchor2(): Vec2;
@@ -4140,6 +4533,35 @@ declare class PulleyJoint extends Constraint {
4140
4533
  set jointMax(value: number);
4141
4534
  get ratio(): number;
4142
4535
  set ratio(value: number);
4536
+ isSlack(): boolean;
4537
+ impulse(): Any;
4538
+ bodyImpulse(body: Body): Any;
4539
+ visitBodies(lambda: (body: Body) => void): void;
4540
+ /** @internal */ get_body1(): Any;
4541
+ /** @internal */ set_body1(v: Any): Any;
4542
+ /** @internal */ get_body2(): Any;
4543
+ /** @internal */ set_body2(v: Any): Any;
4544
+ /** @internal */ get_body3(): Any;
4545
+ /** @internal */ set_body3(v: Any): Any;
4546
+ /** @internal */ get_body4(): Any;
4547
+ /** @internal */ set_body4(v: Any): Any;
4548
+ /** @internal */ get_anchor1(): Any;
4549
+ /** @internal */ set_anchor1(v: Any): Any;
4550
+ /** @internal */ get_anchor2(): Any;
4551
+ /** @internal */ set_anchor2(v: Any): Any;
4552
+ /** @internal */ get_anchor3(): Any;
4553
+ /** @internal */ set_anchor3(v: Any): Any;
4554
+ /** @internal */ get_anchor4(): Any;
4555
+ /** @internal */ set_anchor4(v: Any): Any;
4556
+ /** @internal */ get_jointMin(): number;
4557
+ /** @internal */ set_jointMin(v: number): number;
4558
+ /** @internal */ get_jointMax(): number;
4559
+ /** @internal */ set_jointMax(v: number): number;
4560
+ /** @internal */ get_ratio(): number;
4561
+ /** @internal */ set_ratio(v: number): number;
4562
+ /** @internal backward compat alias for zpp_inner */
4563
+ get zpp_inner_zn(): ZPP_PulleyJoint;
4564
+ set zpp_inner_zn(v: ZPP_PulleyJoint);
4143
4565
  }
4144
4566
 
4145
4567
  declare const VERSION: string;