@newkrok/nape-js 3.3.42 → 3.3.44

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$11 = any;
10
+ type Any$12 = 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$11;
32
+ __class__: Any$12;
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$10 = any;
76
+ type Any$11 = any;
77
77
  declare class ZPP_Contact {
78
78
  static __name__: string[];
79
- static _nape: Any$10;
80
- static _zpp: Any$10;
79
+ static _nape: Any$11;
80
+ static _zpp: Any$11;
81
81
  static zpp_pool: ZPP_Contact | null;
82
82
  static internal: boolean;
83
- static _wrapFn: ((zpp: ZPP_Contact) => Any$10) | null;
84
- outer: Any$10;
83
+ static _wrapFn: ((zpp: ZPP_Contact) => Any$11) | null;
84
+ outer: Any$11;
85
85
  px: number;
86
86
  py: number;
87
- wrap_position: Any$10;
88
- arbiter: Any$10;
87
+ wrap_position: Any$11;
88
+ arbiter: Any$11;
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$10;
102
+ __class__: Any$11;
103
103
  constructor();
104
- wrapper(): Any$10;
104
+ wrapper(): Any$11;
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$$ = any;
169
+ type Any$10 = any;
170
170
  declare class ZPP_Vec2 {
171
171
  static zpp_pool: ZPP_Vec2 | null;
172
172
  static __name__: string[];
173
- static _nape: Any$$;
174
- static _zpp: Any$$;
175
- static _wrapFn: ((zpp: ZPP_Vec2) => Any$$) | null;
173
+ static _nape: Any$10;
174
+ static _zpp: Any$10;
175
+ static _wrapFn: ((zpp: ZPP_Vec2) => Any$10) | 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$$;
184
+ outer: Any$10;
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$$;
189
+ __class__: Any$10;
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$$;
195
+ wrapper(): Any$10;
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$$ = 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$$;
351
+ static _wrapFn: ((zpp: ZPP_Vec3) => Any$$) | null;
352
+ outer: Any$$;
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$$;
359
359
  validate(): void;
360
- wrapper(): Any$_;
360
+ wrapper(): Any$$;
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$Z = any;
424
+ type Any$_ = any;
425
425
  declare class ZPP_Mat23 {
426
426
  static __name__: string[];
427
- static _nape: Any$Z;
428
- static _wrapFn: ((zpp: ZPP_Mat23) => Any$Z) | null;
427
+ static _nape: Any$_;
428
+ static _wrapFn: ((zpp: ZPP_Mat23) => Any$_) | null;
429
429
  static zpp_pool: ZPP_Mat23 | null;
430
- outer: Any$Z;
430
+ outer: Any$_;
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$Z;
439
+ __class__: Any$_;
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$Z;
445
+ wrapper(): Any$_;
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$Y = any;
506
+ type Any$Z = any;
507
507
  declare class ZPP_GeomPoly {
508
508
  static __name__: string[];
509
- outer: Any$Y;
510
- vertices: Any$Y;
511
- __class__: Any$Y;
512
- constructor(outer?: Any$Y);
509
+ outer: Any$Z;
510
+ vertices: Any$Z;
511
+ __class__: Any$Z;
512
+ constructor(outer?: Any$Z);
513
513
  }
514
514
 
515
515
  /**
@@ -533,7 +533,7 @@ declare class Winding {
533
533
  toString(): string;
534
534
  }
535
535
 
536
- type Any$X = any;
536
+ type Any$Y = 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$X;
552
- constructor(vertices?: Any$X);
551
+ get _inner(): Any$Y;
552
+ constructor(vertices?: Any$Y);
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$X): GeomPoly;
578
+ static get(vertices?: Any$Y): GeomPoly;
579
579
  empty(): boolean;
580
580
  size(): number;
581
- iterator(): Any$X;
582
- forwardIterator(): Any$X;
583
- backwardsIterator(): Any$X;
581
+ iterator(): Any$Y;
582
+ forwardIterator(): Any$Y;
583
+ backwardsIterator(): Any$Y;
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$X;
596
+ winding(): Any$Y;
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$X): Any$X;
605
- monotoneDecomposition(output?: Any$X): Any$X;
606
- convexDecomposition(delaunay?: boolean, output?: Any$X): Any$X;
607
- triangularDecomposition(delaunay?: boolean, output?: Any$X): Any$X;
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;
608
608
  inflate(inflation: number): GeomPoly;
609
- cut(start: Vec2, end: Vec2, boundedStart?: boolean, boundedEnd?: boolean, output?: Any$X): Any$X;
610
- transform(matrix: Any$X): this;
611
- bounds(): Any$X;
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;
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$W = any;
627
+ type Any$X = any;
628
628
  declare class ZPP_AABB {
629
629
  static zpp_pool: ZPP_AABB | null;
630
630
  static __name__: string[];
631
- static _nape: Any$W;
632
- static _zpp: Any$W;
633
- static _wrapFn: ((zpp: ZPP_AABB) => Any$W) | null;
631
+ static _nape: Any$X;
632
+ static _zpp: Any$X;
633
+ static _wrapFn: ((zpp: ZPP_AABB) => Any$X) | null;
634
634
  _invalidate: ((self: ZPP_AABB) => void) | null;
635
635
  _validate: (() => void) | null;
636
636
  _immutable: boolean;
637
- outer: Any$W;
637
+ outer: Any$X;
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$W;
644
- wrap_max: Any$W;
645
- __class__: Any$W;
643
+ wrap_min: Any$X;
644
+ wrap_max: Any$X;
645
+ __class__: Any$X;
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$W;
650
+ wrapper(): Any$X;
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$W): void;
661
+ mod_min(min: Any$X): void;
662
662
  getmax(): void;
663
663
  dom_max(): void;
664
- mod_max(max: Any$W): void;
664
+ mod_max(max: Any$X): 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$V = any;
728
+ type Any$W = any;
729
729
  declare class ZPP_MatMN {
730
730
  static __name__: string[];
731
- outer: Any$V;
731
+ outer: Any$W;
732
732
  m: number;
733
733
  n: number;
734
734
  x: number[];
735
- __class__: Any$V;
735
+ __class__: Any$W;
736
736
  constructor(m: number, n: number);
737
737
  }
738
738
 
739
- type Any$U = any;
739
+ type Any$V = 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$U): MatMN;
750
+ static _wrap(inner: Any$V): 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$T = any;
760
+ type Any$U = any;
761
761
  /**
762
762
  * Isosurface extraction using the marching squares algorithm.
763
763
  *
@@ -780,21 +780,71 @@ 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$T): Any$T;
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;
784
+ }
785
+
786
+ /**
787
+ * ZPP_Ray — Internal ray representation for the nape physics engine.
788
+ *
789
+ * Manages ray origin/direction with invalidation callbacks, plus ray-shape
790
+ * intersection methods (AABB, circle, polygon).
791
+ *
792
+ * Converted from nape-compiled.js lines 31239–33172, 65896.
793
+ */
794
+
795
+ type Any$T = any;
796
+ declare class ZPP_Ray {
797
+ static __name__: string[];
798
+ static internal: boolean;
799
+ zip_dir: boolean;
800
+ absnormaly: number;
801
+ absnormalx: number;
802
+ normaly: number;
803
+ normalx: number;
804
+ idiry: number;
805
+ idirx: number;
806
+ diry: number;
807
+ dirx: number;
808
+ originy: number;
809
+ originx: number;
810
+ userData: Any$T;
811
+ maxdist: number;
812
+ direction: Any$T;
813
+ origin: Any$T;
814
+ __class__: Any$T;
815
+ constructor();
816
+ origin_invalidate(x: Any$T): void;
817
+ direction_invalidate(x: Any$T): void;
818
+ invalidate_dir(): void;
819
+ validate_dir(): void;
820
+ rayAABB(): ZPP_AABB;
821
+ aabbtest(a: Any$T): boolean;
822
+ aabbsect(a: Any$T): number;
823
+ private static _allocVec2;
824
+ private static _validateWorldCOM;
825
+ private _circleNormal;
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;
784
831
  }
785
832
 
833
+ type Any$S = any;
786
834
  /**
787
835
  * A ray for raycasting queries.
788
836
  *
789
- * Thin wrapper around the compiled Ray implementation.
790
- * Full modernization (replacing compiled code) is pending ZPP_Ray extraction.
837
+ * Fully modernized uses ZPP_Ray directly (extracted to TypeScript).
791
838
  */
792
839
  declare class Ray {
793
- /** @internal */
794
- readonly _inner: NapeInner;
840
+ static __name__: string[];
841
+ /** Direct access to the extracted internal ZPP_Ray. */
842
+ zpp_inner: ZPP_Ray;
843
+ /** Backward-compat alias for compiled code. */
844
+ get _inner(): this;
795
845
  constructor(origin: Vec2, direction: Vec2);
796
846
  /** @internal */
797
- static _wrap(inner: NapeInner): Ray;
847
+ static _wrap(inner: Any$S): Ray;
798
848
  static fromSegment(start: Vec2, end: Vec2): Ray;
799
849
  get origin(): Vec2;
800
850
  set origin(value: Vec2);
@@ -806,6 +856,13 @@ declare class Ray {
806
856
  aabb(): AABB;
807
857
  at(distance: number, weak?: boolean): Vec2;
808
858
  copy(): Ray;
859
+ /** @internal */ get_origin(): Vec2;
860
+ /** @internal */ set_origin(v: Vec2): Vec2;
861
+ /** @internal */ get_direction(): Vec2;
862
+ /** @internal */ set_direction(v: Vec2): Vec2;
863
+ /** @internal */ get_maxDistance(): number;
864
+ /** @internal */ set_maxDistance(v: number): number;
865
+ /** @internal */ get_userData(): Any$S;
809
866
  }
810
867
 
811
868
  /**
@@ -816,31 +873,31 @@ declare class Ray {
816
873
  *
817
874
  * Converted from nape-compiled.js lines 38897–39076, 86860–86862.
818
875
  */
819
- type Any$S = any;
876
+ type Any$R = any;
820
877
  declare class ZPP_ConvexRayResult {
821
878
  static __name__: string[];
822
879
  static rayPool: ZPP_ConvexRayResult | null;
823
880
  static convexPool: ZPP_ConvexRayResult | null;
824
881
  static internal: boolean;
825
- static _createRayResult: (() => Any$S) | null;
826
- static _createConvexResult: (() => Any$S) | null;
827
- normal: Any$S;
828
- shape: Any$S;
829
- convex: Any$S;
830
- position: Any$S;
831
- ray: Any$S;
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;
832
889
  inner: boolean;
833
890
  next: ZPP_ConvexRayResult | null;
834
891
  toiDistance: number;
835
- __class__: Any$S;
836
- static getRay(normal: Any$S, time: number, inner: boolean, shape: Any$S): Any$S;
837
- static getConvex(normal: Any$S, position: Any$S, toiDistance: number, shape: Any$S): Any$S;
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;
838
895
  disposed(): void;
839
896
  free(): void;
840
897
  private static _disposeVec2;
841
898
  }
842
899
 
843
- type Any$R = any;
900
+ type Any$Q = any;
844
901
  /**
845
902
  * Result from a convex-cast query.
846
903
  *
@@ -855,18 +912,18 @@ declare class ConvexResult {
855
912
  get _inner(): NapeInner;
856
913
  constructor();
857
914
  /** @internal */
858
- static _wrap(inner: Any$R): ConvexResult;
915
+ static _wrap(inner: Any$Q): ConvexResult;
859
916
  get normal(): Vec2;
860
917
  get position(): Vec2;
861
918
  get toi(): number;
862
- get shape(): Any$R;
919
+ get shape(): Any$Q;
863
920
  dispose(): void;
864
921
  toString(): string;
865
922
  /** @internal */
866
923
  private _disposed;
867
924
  }
868
925
 
869
- type Any$Q = any;
926
+ type Any$P = any;
870
927
  /**
871
928
  * Result from a raycast query.
872
929
  *
@@ -881,68 +938,17 @@ declare class RayResult {
881
938
  get _inner(): NapeInner;
882
939
  constructor();
883
940
  /** @internal */
884
- static _wrap(inner: Any$Q): RayResult;
941
+ static _wrap(inner: Any$P): RayResult;
885
942
  get normal(): Vec2;
886
943
  get distance(): number;
887
944
  get inner(): boolean;
888
- get shape(): Any$Q;
945
+ get shape(): Any$P;
889
946
  dispose(): void;
890
947
  toString(): string;
891
948
  /** @internal */
892
949
  private _disposed;
893
950
  }
894
951
 
895
- type Any$P = any;
896
- /**
897
- * Static utility class for geometric queries between shapes and bodies.
898
- *
899
- * All methods are static. This class cannot be instantiated.
900
- *
901
- * Thin wrapper — delegates to compiled nape.geom.Geom methods.
902
- */
903
- declare class Geom {
904
- static __name__: string[];
905
- /**
906
- * Calculate minimum distance between two bodies and return closest points.
907
- * @param body1 - First body (must have shapes).
908
- * @param body2 - Second body (must have shapes).
909
- * @param out1 - Output Vec2 for closest point on body1.
910
- * @param out2 - Output Vec2 for closest point on body2.
911
- * @returns The distance between the two bodies.
912
- */
913
- static distanceBody(body1: Any$P, body2: Any$P, out1: Vec2, out2: Vec2): number;
914
- /**
915
- * Calculate minimum distance between two shapes and return closest points.
916
- * @param shape1 - First shape (must be part of a body).
917
- * @param shape2 - Second shape (must be part of a body).
918
- * @param out1 - Output Vec2 for closest point on shape1.
919
- * @param out2 - Output Vec2 for closest point on shape2.
920
- * @returns The distance between the two shapes.
921
- */
922
- static distance(shape1: Any$P, shape2: Any$P, out1: Vec2, out2: Vec2): number;
923
- /**
924
- * Test if two bodies intersect (any of their shapes overlap).
925
- * @param body1 - First body (must have shapes).
926
- * @param body2 - Second body (must have shapes).
927
- * @returns True if the bodies intersect.
928
- */
929
- static intersectsBody(body1: Any$P, body2: Any$P): boolean;
930
- /**
931
- * Test if two shapes intersect.
932
- * @param shape1 - First shape (must be part of a body).
933
- * @param shape2 - Second shape (must be part of a body).
934
- * @returns True if the shapes intersect.
935
- */
936
- static intersects(shape1: Any$P, shape2: Any$P): boolean;
937
- /**
938
- * Test if shape1 fully contains shape2.
939
- * @param shape1 - Containing shape (must be part of a body).
940
- * @param shape2 - Contained shape (must be part of a body).
941
- * @returns True if shape1 contains shape2.
942
- */
943
- static contains(shape1: Any$P, shape2: Any$P): boolean;
944
- }
945
-
946
952
  /**
947
953
  * Generic typed wrapper around Haxe list objects (BodyList, ShapeList, etc.).
948
954
  *
@@ -997,325 +1003,411 @@ declare class NapeList<T> implements Iterable<T> {
997
1003
  }
998
1004
 
999
1005
  /**
1000
- * ZPP_Material — Internal material representation for the nape physics engine.
1006
+ * ZPP_Constraint — Internal base class for all constraints / joints.
1001
1007
  *
1002
- * Stores physical material properties (friction, elasticity, density) and
1003
- * manages the list of shapes that reference this material for invalidation.
1008
+ * Manages activation/deactivation, callback types, space integration,
1009
+ * and provides stubs for solver methods overridden by joint subclasses.
1004
1010
  *
1005
- * Converted from nape-compiled.js lines 8752387601, 135477–135481.
1011
+ * Converted from nape-compiled.js lines 2142421827.
1006
1012
  */
1007
1013
  type Any$O = any;
1008
- declare class ZPP_Material {
1009
- static zpp_pool: ZPP_Material | null;
1010
- static WAKE: number;
1011
- static PROPS: number;
1012
- static ANGDRAG: number;
1013
- static ARBITERS: number;
1014
+ declare class ZPP_Constraint {
1014
1015
  static __name__: string[];
1015
1016
  /**
1016
1017
  * Namespace references, set by the compiled module after import.
1017
- * _nape = the `nape` public namespace (for wrapper creation)
1018
- * _zpp = the `zpp_nape` internal namespace (for ZNPList_ZPP_Shape)
1018
+ * _nape = the `nape` public namespace (for CbTypeIterator in copyto)
1019
+ * _zpp = the `zpp_nape` internal namespace (for ZNPList_*, ZPP_CbSet, etc.)
1019
1020
  */
1020
1021
  static _nape: Any$O;
1021
1022
  static _zpp: Any$O;
1022
- /**
1023
- * Wrapper factory callback, registered by the modernized Material class.
1024
- * When set, wrapper() uses this instead of creating a compiled Material.
1025
- */
1026
- static _wrapFn: ((zpp: ZPP_Material) => Any$O) | null;
1027
- elasticity: number;
1028
- dynamicFriction: number;
1029
- staticFriction: number;
1030
- density: number;
1031
- rollingFriction: number;
1032
- shapes: Any$O;
1033
- wrap_shapes: Any$O;
1034
1023
  outer: Any$O;
1024
+ id: number;
1035
1025
  userData: Any$O;
1036
- next: ZPP_Material | null;
1026
+ compound: Any$O;
1027
+ space: Any$O;
1028
+ active: boolean;
1029
+ stiff: boolean;
1030
+ frequency: number;
1031
+ damping: number;
1032
+ maxForce: number;
1033
+ maxError: number;
1034
+ breakUnderForce: boolean;
1035
+ breakUnderError: boolean;
1036
+ removeOnBreak: boolean;
1037
+ component: Any$O;
1038
+ ignore: boolean;
1039
+ __velocity: boolean;
1040
+ cbTypes: Any$O;
1041
+ cbSet: Any$O;
1042
+ wrap_cbTypes: Any$O;
1043
+ pre_dt: number;
1037
1044
  __class__: Any$O;
1038
1045
  constructor();
1039
- /** Create/return the public nape.phys.Material wrapper for this internal object. */
1040
- wrapper(): Any$O;
1041
- /** Called when this object is returned to the pool. */
1042
- free(): void;
1043
- /** Called when this object is taken from the pool. */
1044
- alloc(): void;
1045
- /** Initialize the shapes list (called during feature construction). */
1046
- feature_cons(): void;
1047
- /** Register a shape that uses this material. */
1048
- addShape(shape: Any$O): void;
1049
- /** Unregister a shape that no longer uses this material. */
1050
- remShape(shape: Any$O): void;
1051
- /** Create a copy with the same property values. */
1052
- copy(): ZPP_Material;
1053
- /** Copy all property values from another ZPP_Material. */
1054
- set(x: ZPP_Material): void;
1055
- /** Notify all shapes using this material that properties changed. */
1056
- invalidate(x: number): void;
1046
+ /**
1047
+ * Initialise base constraint fields.
1048
+ * Extracted into a separate method because compiled joint subclasses
1049
+ * call `ZPP_Constraint.call(this)` — ES classes can't be invoked that
1050
+ * way, so the compiled wrapper delegates to this method instead.
1051
+ */
1052
+ _initBase(): void;
1053
+ clear(): void;
1054
+ activeBodies(): void;
1055
+ inactiveBodies(): void;
1056
+ clearcache(): void;
1057
+ validate(): void;
1058
+ wake_connected(): void;
1059
+ forest(): void;
1060
+ broken(): void;
1061
+ warmStart(): void;
1062
+ draw(_g: Any$O): void;
1063
+ pair_exists(_id: Any$O, _di: Any$O): boolean;
1064
+ preStep(_dt: number): boolean;
1065
+ applyImpulseVel(): boolean;
1066
+ applyImpulsePos(): boolean;
1067
+ copy(_dict?: Any$O, _todo?: Any$O): Any$O;
1068
+ immutable_midstep(name: string): void;
1069
+ setupcbTypes(): void;
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;
1074
+ alloc_cbSet(): void;
1075
+ dealloc_cbSet(): void;
1076
+ activate(): void;
1077
+ deactivate(): void;
1078
+ addedToSpace(): void;
1079
+ removedFromSpace(): void;
1080
+ activeInSpace(): void;
1081
+ inactiveOrOutSpace(): void;
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;
1057
1086
  }
1058
1087
 
1088
+ type Any$N = any;
1059
1089
  /**
1060
- * Physical material properties applied to shapes.
1061
- *
1062
- * Controls elasticity (bounciness), friction coefficients, density, and
1063
- * rolling friction. Internally wraps a ZPP_Material and is registered as
1064
- * the public `nape.phys.Material` class in the compiled namespace.
1090
+ * Base class for all constraints / joints.
1065
1091
  *
1066
- * Converted from nape-compiled.js lines 38254–38573.
1092
+ * Fully modernized uses ZPP_Constraint directly (extracted to TypeScript).
1093
+ * Not instantiated directly; only via joint subclasses.
1067
1094
  */
1068
- declare class Material {
1095
+ declare class Constraint {
1069
1096
  static __name__: string[];
1070
- /** @internal The internal ZPP_Material this wrapper owns. */
1071
- zpp_inner: ZPP_Material;
1097
+ /** Direct access to the extracted internal ZPP_Constraint. */
1098
+ zpp_inner: ZPP_Constraint;
1072
1099
  /**
1073
- * Backward-compatible accessor returns `this` so that compiled engine
1074
- * code that receives `material._inner` can still access `zpp_inner`.
1100
+ * Compiled joint reference for joint-specific methods (body1/body2/anchors etc.).
1101
+ * Joint subclasses set this to the compiled joint instance until those joints
1102
+ * are fully modernized. Also serves as backward compat for compiled code.
1075
1103
  * @internal
1076
1104
  */
1077
- get _inner(): NapeInner;
1078
- constructor(elasticity?: number, dynamicFriction?: number, staticFriction?: number, density?: number, rollingFriction?: number);
1079
- /** @internal Wrap a ZPP_Material (or legacy compiled Material) with caching. */
1080
- static _wrap(inner: any): Material;
1081
- get elasticity(): number;
1082
- set elasticity(value: number);
1083
- get dynamicFriction(): number;
1084
- set dynamicFriction(value: number);
1085
- get staticFriction(): number;
1086
- set staticFriction(value: number);
1087
- get density(): number;
1088
- set density(value: number);
1089
- get rollingFriction(): number;
1090
- set rollingFriction(value: number);
1105
+ _inner: Any$N;
1106
+ debugDraw: boolean;
1107
+ /** @internal */
1108
+ protected constructor();
1109
+ /** @internal */
1110
+ static _wrap(inner: Any$N): Constraint;
1111
+ get space(): Space | null;
1112
+ set space(value: Space | null);
1113
+ get compound(): Any$N;
1114
+ set compound(value: Any$N);
1115
+ get active(): boolean;
1116
+ set active(value: boolean);
1117
+ get ignore(): boolean;
1118
+ set ignore(value: boolean);
1119
+ get stiff(): boolean;
1120
+ set stiff(value: boolean);
1121
+ get frequency(): number;
1122
+ set frequency(value: number);
1123
+ get damping(): number;
1124
+ set damping(value: number);
1125
+ get maxForce(): number;
1126
+ set maxForce(value: number);
1127
+ get maxError(): number;
1128
+ set maxError(value: number);
1129
+ get breakUnderForce(): boolean;
1130
+ set breakUnderForce(value: boolean);
1131
+ get breakUnderError(): boolean;
1132
+ set breakUnderError(value: boolean);
1133
+ get removeOnBreak(): boolean;
1134
+ set removeOnBreak(value: boolean);
1135
+ get isSleeping(): boolean;
1091
1136
  get userData(): Record<string, unknown>;
1092
- copy(): Material;
1137
+ get cbTypes(): Any$N;
1138
+ impulse(): Any$N;
1139
+ bodyImpulse(_body: Body): Any$N;
1140
+ visitBodies(_fn: (body: Body) => void): void;
1141
+ copy(): Constraint;
1093
1142
  toString(): string;
1094
- static wood(): Material;
1095
- static steel(): Material;
1096
- static ice(): Material;
1097
- static rubber(): Material;
1098
- static glass(): Material;
1099
- static sand(): Material;
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;
1148
+ /** @internal */ get_isSleeping(): boolean;
1149
+ /** @internal */ get_active(): boolean;
1150
+ /** @internal */ set_active(v: boolean): boolean;
1151
+ /** @internal */ get_ignore(): boolean;
1152
+ /** @internal */ set_ignore(v: boolean): boolean;
1153
+ /** @internal */ get_stiff(): boolean;
1154
+ /** @internal */ set_stiff(v: boolean): boolean;
1155
+ /** @internal */ get_frequency(): number;
1156
+ /** @internal */ set_frequency(v: number): number;
1157
+ /** @internal */ get_damping(): number;
1158
+ /** @internal */ set_damping(v: number): number;
1159
+ /** @internal */ get_maxForce(): number;
1160
+ /** @internal */ set_maxForce(v: number): number;
1161
+ /** @internal */ get_maxError(): number;
1162
+ /** @internal */ set_maxError(v: number): number;
1163
+ /** @internal */ get_breakUnderForce(): boolean;
1164
+ /** @internal */ set_breakUnderForce(v: boolean): boolean;
1165
+ /** @internal */ get_breakUnderError(): boolean;
1166
+ /** @internal */ set_breakUnderError(v: boolean): boolean;
1167
+ /** @internal */ get_removeOnBreak(): boolean;
1168
+ /** @internal */ set_removeOnBreak(v: boolean): boolean;
1169
+ /** @internal */ get_cbTypes(): Any$N;
1100
1170
  }
1101
1171
 
1102
1172
  /**
1103
- * ZPP_FluidProperties — Internal fluid properties for the nape physics engine.
1173
+ * ZPP_Listener — Internal listener base class for the nape physics engine.
1104
1174
  *
1105
- * Stores density, viscosity, and per-fluid gravity override.
1106
- * Manages the list of shapes that reference these properties for invalidation.
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.
1107
1178
  *
1108
- * Converted from nape-compiled.js lines 8733587523, 135403.
1179
+ * Converted from nape-compiled.js lines 2725927304, 112053–112139.
1109
1180
  */
1110
- type Any$N = any;
1111
- declare class ZPP_FluidProperties {
1112
- static zpp_pool: ZPP_FluidProperties | null;
1181
+ type Any$M = any;
1182
+ declare class ZPP_Listener {
1113
1183
  static __name__: string[];
1114
- static _nape: Any$N;
1115
- static _zpp: Any$N;
1116
- static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$N) | null;
1117
- viscosity: number;
1118
- density: number;
1119
- gravityx: number;
1120
- gravityy: number;
1121
- wrap_gravity: Any$N;
1122
- shapes: Any$N;
1123
- wrap_shapes: Any$N;
1124
- outer: Any$N;
1125
- userData: Any$N;
1126
- next: ZPP_FluidProperties | null;
1127
- __class__: Any$N;
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;
1128
1199
  constructor();
1129
- /** Create/return the public nape.phys.FluidProperties wrapper. */
1130
- wrapper(): Any$N;
1131
- free(): void;
1132
- alloc(): void;
1133
- feature_cons(): void;
1134
- addShape(shape: Any$N): void;
1135
- remShape(shape: Any$N): void;
1136
- /** Copy with object pooling. */
1137
- copy(): ZPP_FluidProperties;
1138
- /** Called when gravity Vec2 wrapper is invalidated (user set new gravity). */
1139
- gravity_invalidate(x: Any$N): void;
1140
- /** Sync the gravity Vec2 wrapper with internal values. */
1141
- gravity_validate(): void;
1142
- /** Lazily create and return the gravity Vec2 wrapper. */
1143
- getgravity(): void;
1144
- /** Notify all shapes that fluid properties changed. */
1145
- invalidate(): void;
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;
1146
1206
  }
1147
1207
 
1148
1208
  /**
1149
- * Fluid properties for shapes that act as fluid regions.
1209
+ * Callback event types.
1150
1210
  *
1151
- * Controls density, viscosity, and per-fluid gravity override.
1152
- * Internally wraps a ZPP_FluidProperties and is registered as
1153
- * the public `nape.phys.FluidProperties` class in the compiled namespace.
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
1154
1218
  *
1155
- * Converted from nape-compiled.js lines 3700237511.
1219
+ * Converted from nape-compiled.js lines 516657.
1156
1220
  */
1157
- declare class FluidProperties {
1221
+ declare class CbEvent {
1158
1222
  static __name__: string[];
1159
- /** @internal The internal ZPP_FluidProperties this wrapper owns. */
1160
- zpp_inner: ZPP_FluidProperties;
1161
- /**
1162
- * Backward-compatible accessor — returns `this` so that compiled engine
1163
- * code that receives `fluidProps._inner` can still access `zpp_inner`.
1164
- * @internal
1165
- */
1166
- get _inner(): NapeInner;
1167
- constructor(density?: number, viscosity?: number);
1168
- /** @internal Wrap a ZPP_FluidProperties (or legacy compiled FluidProperties) with caching. */
1169
- static _wrap(inner: any): FluidProperties;
1170
- get density(): number;
1171
- set density(value: number);
1172
- get viscosity(): number;
1173
- set viscosity(value: number);
1174
- get gravity(): any;
1175
- set gravity(gravity: any);
1176
- get userData(): Record<string, unknown>;
1177
- get shapes(): any;
1178
- copy(): FluidProperties;
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;
1179
1238
  toString(): string;
1180
1239
  }
1181
1240
 
1182
1241
  /**
1183
- * ZPP_InteractionFilter Internal interaction filter for the nape physics engine.
1242
+ * Listener type classification.
1184
1243
  *
1185
- * Stores collision/sensor/fluid group and mask bitmasks that determine
1186
- * which shapes interact with each other.
1244
+ * - `BODY` — body event listener
1245
+ * - `CONSTRAINT` — constraint event listener
1246
+ * - `INTERACTION` — interaction event listener
1247
+ * - `PRE` — pre-interaction listener
1187
1248
  *
1188
- * Converted from nape-compiled.js lines 6325563366, 135329.
1249
+ * Converted from nape-compiled.js lines 25542646.
1189
1250
  */
1190
- type Any$M = any;
1191
- declare class ZPP_InteractionFilter {
1192
- static zpp_pool: ZPP_InteractionFilter | null;
1251
+ declare class ListenerType {
1193
1252
  static __name__: string[];
1194
- static _nape: Any$M;
1195
- static _zpp: Any$M;
1196
- static _wrapFn: ((zpp: ZPP_InteractionFilter) => Any$M) | null;
1197
- collisionGroup: number;
1198
- collisionMask: number;
1199
- sensorGroup: number;
1200
- sensorMask: number;
1201
- fluidGroup: number;
1202
- fluidMask: number;
1203
- shapes: Any$M;
1204
- wrap_shapes: Any$M;
1205
- outer: Any$M;
1206
- userData: Any$M;
1207
- next: ZPP_InteractionFilter | null;
1208
- __class__: Any$M;
1253
+ static BODY: ListenerType | null;
1254
+ static CONSTRAINT: ListenerType | null;
1255
+ static INTERACTION: ListenerType | null;
1256
+ static PRE: ListenerType | null;
1209
1257
  constructor();
1210
- /** Create/return the public nape.dynamics.InteractionFilter wrapper. */
1211
- wrapper(): Any$M;
1212
- free(): void;
1213
- alloc(): void;
1214
- feature_cons(): void;
1215
- addShape(shape: Any$M): void;
1216
- remShape(shape: Any$M): void;
1217
- /** Create a copy with object pooling. */
1218
- copy(): ZPP_InteractionFilter;
1219
- /** Test whether two filters allow collision between their shapes. */
1220
- shouldCollide(x: ZPP_InteractionFilter): boolean;
1221
- /** Test whether two filters allow sensor interaction. */
1222
- shouldSense(x: ZPP_InteractionFilter): boolean;
1223
- /** Test whether two filters allow fluid interaction. */
1224
- shouldFlow(x: ZPP_InteractionFilter): boolean;
1225
- /** Notify all shapes that the filter changed. */
1226
- invalidate(): void;
1227
- }
1228
-
1229
- /**
1230
- * Bit-mask based interaction filter for controlling which shapes
1231
- * collide, sense, or interact as fluids.
1232
- *
1233
- * Internally wraps a ZPP_InteractionFilter and is registered as
1234
- * the public `nape.dynamics.InteractionFilter` class in the compiled namespace.
1235
- *
1236
- * Converted from nape-compiled.js lines 14361–14640.
1237
- */
1238
- declare class InteractionFilter {
1239
- static __name__: string[];
1240
- /** @internal The internal ZPP_InteractionFilter this wrapper owns. */
1241
- zpp_inner: ZPP_InteractionFilter;
1242
- /**
1243
- * Backward-compatible accessor — returns `this` so that compiled engine
1244
- * code that receives `filter._inner` can still access `zpp_inner`.
1245
- * @internal
1246
- */
1247
- get _inner(): NapeInner;
1248
- constructor(collisionGroup?: number, collisionMask?: number, sensorGroup?: number, sensorMask?: number, fluidGroup?: number, fluidMask?: number);
1249
- /** @internal Wrap a ZPP_InteractionFilter (or legacy compiled InteractionFilter) with caching. */
1250
- static _wrap(inner: any): InteractionFilter;
1251
- get collisionGroup(): number;
1252
- set collisionGroup(value: number);
1253
- get collisionMask(): number;
1254
- set collisionMask(value: number);
1255
- get sensorGroup(): number;
1256
- set sensorGroup(value: number);
1257
- get sensorMask(): number;
1258
- set sensorMask(value: number);
1259
- get fluidGroup(): number;
1260
- set fluidGroup(value: number);
1261
- get fluidMask(): number;
1262
- set fluidMask(value: number);
1263
- get userData(): Record<string, unknown>;
1264
- get shapes(): any;
1265
- shouldCollide(filter: InteractionFilter): boolean;
1266
- shouldSense(filter: InteractionFilter): boolean;
1267
- shouldFlow(filter: InteractionFilter): boolean;
1268
- copy(): InteractionFilter;
1258
+ static get_BODY(): ListenerType;
1259
+ static get_CONSTRAINT(): ListenerType;
1260
+ static get_INTERACTION(): ListenerType;
1261
+ static get_PRE(): ListenerType;
1269
1262
  toString(): string;
1270
1263
  }
1271
1264
 
1272
1265
  /**
1273
- * ZPP_InteractionGroupInternal interaction group for the nape physics engine.
1266
+ * ListenerBase class for all physics event listeners.
1274
1267
  *
1275
- * Hierarchical groups that can override interaction filters. When two shapes
1276
- * share a common group with `ignore = true`, their interaction is suppressed.
1268
+ * Provides common properties (type, event, precedence, space) and
1269
+ * toString() for all listener subclasses.
1277
1270
  *
1278
- * Converted from nape-compiled.js lines 6336763463, 135330–135331.
1271
+ * Fully modernized from nape-compiled.js lines 231433.
1279
1272
  */
1273
+
1280
1274
  type Any$L = any;
1281
- declare class ZPP_InteractionGroup {
1282
- static SHAPE: number;
1283
- static BODY: number;
1275
+ declare class Listener {
1284
1276
  static __name__: string[];
1285
- static _zpp: Any$L;
1286
- static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$L) | null;
1287
- outer: Any$L;
1288
- ignore: boolean;
1289
- group: ZPP_InteractionGroup | null;
1290
- groups: Any$L;
1291
- wrap_groups: Any$L;
1292
- interactors: Any$L;
1293
- wrap_interactors: Any$L;
1294
- depth: number;
1295
- __class__: Any$L;
1277
+ zpp_inner: ZPP_Listener;
1278
+ get _inner(): Any$L;
1296
1279
  constructor();
1297
- /** Set or change the parent group. */
1298
- setGroup(group: ZPP_InteractionGroup | null): void;
1299
- /** Wake all interactors and propagate to child groups. */
1300
- invalidate(force?: boolean): void;
1301
- /** Add a child group. */
1302
- addGroup(group: ZPP_InteractionGroup): void;
1303
- /** Remove a child group. */
1304
- remGroup(group: ZPP_InteractionGroup): void;
1305
- /** Register an interactor in this group. */
1306
- addInteractor(intx: Any$L): void;
1307
- /** Unregister an interactor from this group. */
1308
- remInteractor(intx: Any$L, flag?: number): void;
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;
1309
1289
  }
1310
1290
 
1311
1291
  /**
1312
- * Hierarchical interaction group for controlling interactions
1313
- * between sets of interactors.
1314
- *
1315
- * Internally wraps a ZPP_InteractionGroup and is registered as
1316
- * the public `nape.dynamics.InteractionGroup` class in the compiled namespace.
1317
- *
1318
- * Converted from nape-compiled.js lines 14641–14733.
1292
+ * The physics world. Add bodies and constraints, then call `step()` each frame.
1293
+ */
1294
+ declare class Space {
1295
+ /** @internal */
1296
+ readonly _inner: NapeInner;
1297
+ constructor(gravity?: Vec2);
1298
+ /** @internal */
1299
+ static _wrap(inner: NapeInner): Space;
1300
+ get gravity(): Vec2;
1301
+ set gravity(value: Vec2);
1302
+ get worldLinearDrag(): number;
1303
+ set worldLinearDrag(value: number);
1304
+ get worldAngularDrag(): number;
1305
+ set worldAngularDrag(value: number);
1306
+ get sortContacts(): boolean;
1307
+ 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). */
1316
+ get world(): Body;
1317
+ get timeStamp(): number;
1318
+ get elapsedTime(): number;
1319
+ get broadphase(): NapeInner;
1320
+ get userData(): Record<string, unknown>;
1321
+ step(deltaTime: number, velocityIterations?: number, positionIterations?: number): void;
1322
+ 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;
1336
+ toString(): string;
1337
+ }
1338
+ /** @internal Helper type for filter-like parameters. */
1339
+ type InteractionFilterLike = {
1340
+ _inner: NapeInner;
1341
+ } | NapeInner | undefined;
1342
+
1343
+ /**
1344
+ * Body type enumeration.
1345
+ *
1346
+ * - `STATIC` — immovable, infinite mass (walls, floors)
1347
+ * - `DYNAMIC` — fully simulated (default)
1348
+ * - `KINEMATIC` — moves only via velocity, not affected by forces
1349
+ *
1350
+ * Converted from nape-compiled.js lines 24640–24705.
1351
+ */
1352
+ declare class BodyType {
1353
+ static __name__: string[];
1354
+ constructor();
1355
+ static get STATIC(): BodyType;
1356
+ static get DYNAMIC(): BodyType;
1357
+ static get KINEMATIC(): BodyType;
1358
+ static get_STATIC(): BodyType;
1359
+ static get_DYNAMIC(): BodyType;
1360
+ static get_KINEMATIC(): BodyType;
1361
+ toString(): string;
1362
+ }
1363
+
1364
+ /**
1365
+ * ZPP_InteractionGroup — Internal interaction group for the nape physics engine.
1366
+ *
1367
+ * Hierarchical groups that can override interaction filters. When two shapes
1368
+ * share a common group with `ignore = true`, their interaction is suppressed.
1369
+ *
1370
+ * Converted from nape-compiled.js lines 63367–63463, 135330–135331.
1371
+ */
1372
+ type Any$K = any;
1373
+ declare class ZPP_InteractionGroup {
1374
+ static SHAPE: number;
1375
+ static BODY: number;
1376
+ static __name__: string[];
1377
+ static _zpp: Any$K;
1378
+ static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$K) | null;
1379
+ outer: Any$K;
1380
+ ignore: boolean;
1381
+ group: ZPP_InteractionGroup | null;
1382
+ groups: Any$K;
1383
+ wrap_groups: Any$K;
1384
+ interactors: Any$K;
1385
+ wrap_interactors: Any$K;
1386
+ depth: number;
1387
+ __class__: Any$K;
1388
+ constructor();
1389
+ /** Set or change the parent group. */
1390
+ setGroup(group: ZPP_InteractionGroup | null): void;
1391
+ /** Wake all interactors and propagate to child groups. */
1392
+ invalidate(force?: boolean): void;
1393
+ /** Add a child group. */
1394
+ addGroup(group: ZPP_InteractionGroup): void;
1395
+ /** Remove a child group. */
1396
+ remGroup(group: ZPP_InteractionGroup): void;
1397
+ /** Register an interactor in this group. */
1398
+ addInteractor(intx: Any$K): void;
1399
+ /** Unregister an interactor from this group. */
1400
+ remInteractor(intx: Any$K, flag?: number): void;
1401
+ }
1402
+
1403
+ /**
1404
+ * Hierarchical interaction group for controlling interactions
1405
+ * between sets of interactors.
1406
+ *
1407
+ * Internally wraps a ZPP_InteractionGroup and is registered as
1408
+ * the public `nape.dynamics.InteractionGroup` class in the compiled namespace.
1409
+ *
1410
+ * Converted from nape-compiled.js lines 14641–14733.
1319
1411
  */
1320
1412
  declare class InteractionGroup {
1321
1413
  static __name__: string[];
@@ -1391,834 +1483,777 @@ declare class Interactor {
1391
1483
  }
1392
1484
 
1393
1485
  /**
1394
- * Shape type classification.
1395
- *
1396
- * - `CIRCLE` — circle shape
1397
- * - `POLYGON` — polygon shape
1486
+ * ZPP_Body Internal body representation for the nape physics engine.
1398
1487
  *
1399
- * Converted from nape-compiled.js lines 30435–30482.
1400
- */
1401
- declare class ShapeType {
1402
- static __name__: string[];
1403
- constructor();
1404
- static get CIRCLE(): ShapeType;
1405
- static get POLYGON(): ShapeType;
1406
- static get_CIRCLE(): ShapeType;
1407
- static get_POLYGON(): ShapeType;
1408
- toString(): string;
1409
- }
1410
-
1411
- /**
1412
- * Base class for physics shapes (Circle, Polygon).
1488
+ * Core physics body managing position, velocity, mass, inertia, shapes, and
1489
+ * CCD (continuous collision detection) sweep integration.
1490
+ * Extends ZPP_Interactor (still in compiled code — methods copied at init time).
1413
1491
  *
1414
- * Fully modernized all getters/setters access the ZPP_Shape inner directly.
1492
+ * Converted from nape-compiled.js lines 52431–54547.
1415
1493
  */
1416
- declare class Shape extends Interactor {
1417
- /** @internal – shapes are created via Circle or Polygon constructors. */
1418
- protected constructor();
1419
- /** @internal */
1420
- static _wrap(inner: NapeInner): Shape;
1421
- get type(): ShapeType;
1422
- isCircle(): boolean;
1423
- isPolygon(): boolean;
1424
- get body(): Body;
1425
- set body(value: Body | null);
1426
- get castCircle(): Shape | null;
1427
- get castPolygon(): Shape | null;
1428
- get worldCOM(): Vec2;
1429
- get localCOM(): Vec2;
1430
- set localCOM(value: Vec2);
1431
- get area(): number;
1432
- get inertia(): number;
1433
- get angDrag(): number;
1434
- get material(): Material;
1435
- set material(value: Material);
1436
- get filter(): InteractionFilter;
1437
- set filter(value: InteractionFilter);
1438
- get fluidProperties(): FluidProperties;
1439
- set fluidProperties(value: FluidProperties);
1440
- /** Callback types assigned to this shape. */
1441
- get cbTypes(): CbTypeSet;
1442
- get fluidEnabled(): boolean;
1443
- set fluidEnabled(value: boolean);
1444
- get sensorEnabled(): boolean;
1445
- set sensorEnabled(value: boolean);
1446
- get bounds(): AABB;
1447
- translate(translation: Vec2): Shape;
1448
- scale(scaleX: number, scaleY: number): Shape;
1449
- rotate(angle: number): Shape;
1450
- transform(matrix: {
1451
- _inner: NapeInner;
1452
- }): Shape;
1453
- contains(point: Vec2): boolean;
1454
- copy(): Shape;
1455
- toString(): string;
1456
- /** @internal */ get_type(): ShapeType;
1457
- /** @internal */ get_body(): Body;
1458
- /** @internal */ set_body(v: Body | null): void;
1459
- /** @internal */ get_castCircle(): Shape | null;
1460
- /** @internal */ get_castPolygon(): Shape | null;
1461
- /** @internal */ get_worldCOM(): Vec2;
1462
- /** @internal */ get_localCOM(): Vec2;
1463
- /** @internal */ set_localCOM(v: Vec2): void;
1464
- /** @internal */ get_area(): number;
1465
- /** @internal */ get_inertia(): number;
1466
- /** @internal */ get_angDrag(): number;
1467
- /** @internal */ get_material(): Material;
1468
- /** @internal */ set_material(v: Material): void;
1469
- /** @internal */ get_filter(): InteractionFilter;
1470
- /** @internal */ set_filter(v: InteractionFilter): void;
1471
- /** @internal */ get_fluidProperties(): FluidProperties;
1472
- /** @internal */ set_fluidProperties(v: FluidProperties): void;
1473
- /** @internal */ get_fluidEnabled(): boolean;
1474
- /** @internal */ set_fluidEnabled(v: boolean): void;
1475
- /** @internal */ get_sensorEnabled(): boolean;
1476
- /** @internal */ set_sensorEnabled(v: boolean): void;
1477
- /** @internal */ get_bounds(): AABB;
1478
- /** Setup worldCOM lazy Vec2 wrapper */
1479
- private _setupWorldCOM;
1480
- }
1481
- /** Lightweight typed interface for the callback type set on a shape. */
1482
- interface CbTypeSet {
1483
- readonly _inner: NapeInner;
1484
- add(cbType: {
1485
- _inner: NapeInner;
1486
- }): void;
1487
- remove(cbType: {
1488
- _inner: NapeInner;
1489
- }): void;
1490
- has(cbType: {
1491
- _inner: NapeInner;
1492
- }): boolean;
1493
- clear(): void;
1494
- readonly length: number;
1495
- }
1496
1494
 
1497
- /**
1498
- * ZPP_Constraint — Internal base class for all constraints / joints.
1499
- *
1500
- * Manages activation/deactivation, callback types, space integration,
1501
- * and provides stubs for solver methods overridden by joint subclasses.
1502
- *
1503
- * Converted from nape-compiled.js lines 21424–21827.
1504
- */
1505
- type Any$K = any;
1506
- declare class ZPP_Constraint {
1495
+ type Any$J = any;
1496
+ declare class ZPP_Body {
1507
1497
  static __name__: string[];
1498
+ static __super__: Any$J;
1508
1499
  /**
1509
1500
  * Namespace references, set by the compiled module after import.
1510
- * _nape = the `nape` public namespace (for CbTypeIterator in copyto)
1511
- * _zpp = the `zpp_nape` internal namespace (for ZNPList_*, ZPP_CbSet, etc.)
1501
+ * _nape = the `nape` public namespace
1502
+ * _zpp = the `zpp_nape` internal namespace
1512
1503
  */
1513
- static _nape: Any$K;
1514
- static _zpp: Any$K;
1515
- outer: Any$K;
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;
1509
+ 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;
1516
1513
  id: number;
1517
- userData: Any$K;
1518
- compound: Any$K;
1519
- space: Any$K;
1520
- active: boolean;
1521
- stiff: boolean;
1522
- frequency: number;
1523
- damping: number;
1524
- maxForce: number;
1525
- maxError: number;
1526
- breakUnderForce: boolean;
1527
- breakUnderError: boolean;
1528
- removeOnBreak: boolean;
1529
- component: Any$K;
1530
- ignore: boolean;
1531
- __velocity: boolean;
1532
- cbTypes: Any$K;
1533
- cbSet: Any$K;
1534
- wrap_cbTypes: Any$K;
1535
- pre_dt: number;
1536
- __class__: Any$K;
1537
- constructor();
1538
- /**
1539
- * Initialise base constraint fields.
1540
- * Extracted into a separate method because compiled joint subclasses
1541
- * call `ZPP_Constraint.call(this)` — ES classes can't be invoked that
1542
- * way, so the compiled wrapper delegates to this method instead.
1543
- */
1544
- _initBase(): void;
1545
- clear(): void;
1546
- activeBodies(): void;
1547
- inactiveBodies(): void;
1548
- clearcache(): void;
1549
- validate(): void;
1550
- wake_connected(): void;
1551
- forest(): void;
1552
- broken(): void;
1553
- warmStart(): void;
1554
- draw(_g: Any$K): void;
1555
- pair_exists(_id: Any$K, _di: Any$K): boolean;
1556
- preStep(_dt: number): boolean;
1557
- applyImpulseVel(): boolean;
1558
- applyImpulsePos(): boolean;
1559
- copy(_dict?: Any$K, _todo?: Any$K): Any$K;
1560
- immutable_midstep(name: string): void;
1561
- setupcbTypes(): void;
1562
- immutable_cbTypes(): void;
1563
- wrap_cbTypes_subber(pcb: Any$K): void;
1564
- wrap_cbTypes_adder(cb: Any$K): boolean;
1565
- insert_cbtype(cb: Any$K): void;
1566
- alloc_cbSet(): void;
1567
- dealloc_cbSet(): void;
1568
- activate(): void;
1569
- deactivate(): void;
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;
1524
+ world: boolean;
1525
+ 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;
1535
+ graph_depth: number;
1536
+ sweepTime: number;
1537
+ sweep_angvel: number;
1538
+ sweepFrozen: boolean;
1539
+ sweepRadius: number;
1540
+ bullet: boolean;
1541
+ bulletEnabled: boolean;
1542
+ disableCCD: boolean;
1543
+ pre_posx: number;
1544
+ pre_posy: number;
1545
+ posx: number;
1546
+ posy: number;
1547
+ wrap_pos: Any$J;
1548
+ velx: number;
1549
+ vely: number;
1550
+ wrap_vel: Any$J;
1551
+ forcex: number;
1552
+ forcey: number;
1553
+ wrap_force: Any$J;
1554
+ kinvelx: number;
1555
+ kinvely: number;
1556
+ wrap_kinvel: Any$J;
1557
+ svelx: number;
1558
+ svely: number;
1559
+ wrap_svel: Any$J;
1560
+ wrapcvel: Any$J;
1561
+ angvel: number;
1562
+ torque: number;
1563
+ kinangvel: number;
1564
+ pre_rot: number;
1565
+ rot: number;
1566
+ axisx: number;
1567
+ axisy: number;
1568
+ zip_axis: boolean;
1569
+ kinematicDelaySleep: boolean;
1570
+ mass: number;
1571
+ zip_mass: boolean;
1572
+ massMode: number;
1573
+ imass: number;
1574
+ smass: number;
1575
+ cmass: number;
1576
+ nomove: boolean;
1577
+ gravMass: number;
1578
+ zip_gravMass: boolean;
1579
+ gravMassMode: number;
1580
+ gravMassScale: number;
1581
+ zip_gravMassScale: boolean;
1582
+ inertiaMode: number;
1583
+ inertia: number;
1584
+ zip_inertia: boolean;
1585
+ cinertia: number;
1586
+ iinertia: number;
1587
+ sinertia: number;
1588
+ norotate: boolean;
1589
+ aabb: ZPP_AABB;
1590
+ zip_aabb: boolean;
1591
+ localCOMx: number;
1592
+ localCOMy: number;
1593
+ zip_localCOM: boolean;
1594
+ worldCOMx: number;
1595
+ worldCOMy: number;
1596
+ zip_worldCOM: boolean;
1597
+ wrap_localCOM: Any$J;
1598
+ wrap_worldCOM: Any$J;
1599
+ __class__: Any$J;
1600
+ constructor();
1601
+ isStatic(): boolean;
1602
+ isDynamic(): boolean;
1603
+ isKinematic(): boolean;
1604
+ invalidate_type(): void;
1605
+ invalidate_shapes(): void;
1606
+ 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;
1610
+ atRest(dt: number): boolean;
1611
+ refreshArbiters(): void;
1612
+ sweepIntegrate(dt: number): void;
1613
+ sweepValidate(s: Any$J): void;
1614
+ invalidate_pos(): void;
1615
+ pos_invalidate(pos: Any$J): void;
1616
+ pos_validate(): void;
1617
+ vel_invalidate(vel: Any$J): void;
1618
+ vel_validate(): void;
1619
+ kinvel_invalidate(vel: Any$J): void;
1620
+ kinvel_validate(): void;
1621
+ svel_invalidate(vel: Any$J): void;
1622
+ svel_validate(): void;
1623
+ force_invalidate(force: Any$J): void;
1624
+ force_validate(): void;
1625
+ private _setupVec2Wrapper;
1626
+ setupPosition(): void;
1627
+ setupVelocity(): void;
1628
+ setupkinvel(): void;
1629
+ setupsvel(): void;
1630
+ setupForce(): void;
1631
+ cvel_validate(): void;
1632
+ setup_cvel(): void;
1633
+ invalidate_rot(): void;
1634
+ validate_axis(): void;
1635
+ quick_validate_axis(): void;
1636
+ delta_rot(dr: number): void;
1637
+ invalidate_mass(): void;
1638
+ validate_mass(): void;
1639
+ invalidate_gravMass(): void;
1640
+ validate_gravMass(): void;
1641
+ invalidate_gravMassScale(): void;
1642
+ validate_gravMassScale(): void;
1643
+ invalidate_inertia(): void;
1644
+ validate_inertia(): void;
1645
+ invalidate_wake(): void;
1646
+ invalidate_aabb(): void;
1647
+ validate_aabb(): void;
1648
+ private _validateCircleAABB;
1649
+ private _validatePolygonAABB;
1650
+ aabb_validate(): void;
1651
+ invalidate_localCOM(): void;
1652
+ invalidate_worldCOM(): void;
1653
+ private _computePolygonLocalCOM;
1654
+ validate_localCOM(): void;
1655
+ validate_worldCOM(): void;
1656
+ getlocalCOM(): void;
1657
+ getworldCOM(): void;
1658
+ __immutable_midstep(): void;
1659
+ clear(): void;
1660
+ shapes_adder(s: Any$J): boolean;
1661
+ shapes_subber(s: Any$J): void;
1662
+ shapes_invalidate(_param: Any$J): void;
1663
+ shapes_modifiable(): void;
1570
1664
  addedToSpace(): void;
1571
1665
  removedFromSpace(): void;
1572
- activeInSpace(): void;
1573
- inactiveOrOutSpace(): void;
1574
- wake(): void;
1575
- copyto(ret: Any$K): void;
1576
- static _findRoot(comp: Any$K): Any$K;
1577
- static _unionComponents(a: Any$K, b: Any$K): void;
1666
+ private _removeArbiterFromList;
1667
+ copy(): Any$J;
1668
+ wake: () => void;
1669
+ __iaddedToSpace: () => void;
1670
+ __iremovedFromSpace: () => void;
1671
+ immutable_midstep: (name: string) => void;
1672
+ copyto: (ret: Any$J) => void;
1673
+ insert_cbtype: (cb: Any$J) => void;
1674
+ alloc_cbSet: () => void;
1675
+ dealloc_cbSet: () => void;
1676
+ setupcbTypes: () => void;
1677
+ 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;
1683
+ isShape: () => boolean;
1684
+ isBody: () => boolean;
1685
+ isCompound: () => boolean;
1686
+ static _initialized: boolean;
1687
+ static _init(zpp: Any$J, nape: Any$J): void;
1578
1688
  }
1579
1689
 
1580
- type Any$J = any;
1690
+ type Any$I = any;
1581
1691
  /**
1582
- * Base class for all constraints / joints.
1692
+ * A rigid body in the physics simulation.
1583
1693
  *
1584
- * Fully modernized — uses ZPP_Constraint directly (extracted to TypeScript).
1585
- * Not instantiated directly; only via joint subclasses.
1694
+ * Fully modernized — all methods implemented directly using ZPP_Body.
1586
1695
  */
1587
- declare class Constraint {
1696
+ declare class Body extends Interactor {
1588
1697
  static __name__: string[];
1589
- /** Direct access to the extracted internal ZPP_Constraint. */
1590
- zpp_inner: ZPP_Constraint;
1591
- /**
1592
- * Compiled joint reference for joint-specific methods (body1/body2/anchors etc.).
1593
- * Joint subclasses set this to the compiled joint instance until those joints
1594
- * are fully modernized. Also serves as backward compat for compiled code.
1595
- * @internal
1596
- */
1597
- _inner: Any$J;
1698
+ static __super__: Any$I;
1699
+ /** Direct access to the extracted internal ZPP_Body. */
1700
+ zpp_inner: ZPP_Body;
1598
1701
  debugDraw: boolean;
1702
+ constructor(type?: BodyType, position?: Vec2);
1599
1703
  /** @internal */
1600
- protected constructor();
1601
- /** @internal */
1602
- static _wrap(inner: Any$J): Constraint;
1603
- get space(): Space | null;
1604
- set space(value: Space | null);
1605
- get compound(): Any$J;
1606
- set compound(value: Any$J);
1607
- get active(): boolean;
1608
- set active(value: boolean);
1609
- get ignore(): boolean;
1610
- set ignore(value: boolean);
1611
- get stiff(): boolean;
1612
- set stiff(value: boolean);
1613
- get frequency(): number;
1614
- set frequency(value: number);
1615
- get damping(): number;
1616
- set damping(value: number);
1617
- get maxForce(): number;
1618
- set maxForce(value: number);
1619
- get maxError(): number;
1620
- set maxError(value: number);
1621
- get breakUnderForce(): boolean;
1622
- set breakUnderForce(value: boolean);
1623
- get breakUnderError(): boolean;
1624
- set breakUnderError(value: boolean);
1625
- get removeOnBreak(): boolean;
1626
- set removeOnBreak(value: boolean);
1704
+ static _wrap(inner: NapeInner): Body;
1705
+ get type(): BodyType;
1706
+ set type(value: BodyType);
1707
+ isStatic(): boolean;
1708
+ isDynamic(): boolean;
1709
+ isKinematic(): boolean;
1710
+ get position(): Vec2;
1711
+ set position(value: Vec2);
1712
+ get rotation(): number;
1713
+ set rotation(value: number);
1714
+ get velocity(): Vec2;
1715
+ set velocity(value: Vec2);
1716
+ get angularVel(): number;
1717
+ set angularVel(value: number);
1718
+ get kinematicVel(): Vec2;
1719
+ set kinematicVel(value: Vec2);
1720
+ get kinAngVel(): number;
1721
+ set kinAngVel(value: number);
1722
+ get surfaceVel(): Vec2;
1723
+ set surfaceVel(value: Vec2);
1724
+ get force(): Vec2;
1725
+ set force(value: Vec2);
1726
+ get torque(): number;
1727
+ set torque(value: number);
1728
+ get mass(): number;
1729
+ set mass(value: number);
1730
+ get inertia(): number;
1731
+ set inertia(value: number);
1732
+ get constraintMass(): number;
1733
+ get constraintInertia(): number;
1734
+ get gravMass(): number;
1735
+ set gravMass(value: number);
1736
+ get gravMassScale(): number;
1737
+ set gravMassScale(value: number);
1738
+ get isBullet(): boolean;
1739
+ set isBullet(value: boolean);
1740
+ get disableCCD(): boolean;
1741
+ set disableCCD(value: boolean);
1742
+ get allowMovement(): boolean;
1743
+ set allowMovement(value: boolean);
1744
+ get allowRotation(): boolean;
1745
+ set allowRotation(value: boolean);
1627
1746
  get isSleeping(): boolean;
1628
- get userData(): Record<string, unknown>;
1629
- get cbTypes(): Any$J;
1630
- impulse(): Any$J;
1631
- bodyImpulse(_body: Body): Any$J;
1632
- visitBodies(_fn: (body: Body) => void): void;
1633
- copy(): Constraint;
1747
+ get shapes(): NapeList<Shape>;
1748
+ get space(): Space;
1749
+ set space(value: Space | null);
1750
+ get compound(): Any$I;
1751
+ set compound(value: Any$I);
1752
+ get bounds(): AABB;
1753
+ get constraintVelocity(): Vec2;
1754
+ get localCOM(): Vec2;
1755
+ 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);
1762
+ copy(): Body;
1634
1763
  toString(): string;
1635
- /** @internal */ get_userData(): Any$J;
1636
- /** @internal */ get_compound(): Any$J;
1637
- /** @internal */ set_compound(v: Any$J): Any$J;
1638
- /** @internal */ get_space(): Any$J;
1639
- /** @internal */ set_space(v: Any$J): Any$J;
1640
- /** @internal */ get_isSleeping(): boolean;
1641
- /** @internal */ get_active(): boolean;
1642
- /** @internal */ set_active(v: boolean): boolean;
1643
- /** @internal */ get_ignore(): boolean;
1644
- /** @internal */ set_ignore(v: boolean): boolean;
1645
- /** @internal */ get_stiff(): boolean;
1646
- /** @internal */ set_stiff(v: boolean): boolean;
1647
- /** @internal */ get_frequency(): number;
1648
- /** @internal */ set_frequency(v: number): number;
1649
- /** @internal */ get_damping(): number;
1650
- /** @internal */ set_damping(v: number): number;
1651
- /** @internal */ get_maxForce(): number;
1652
- /** @internal */ set_maxForce(v: number): number;
1653
- /** @internal */ get_maxError(): number;
1654
- /** @internal */ set_maxError(v: number): number;
1655
- /** @internal */ get_breakUnderForce(): boolean;
1656
- /** @internal */ set_breakUnderForce(v: boolean): boolean;
1657
- /** @internal */ get_breakUnderError(): boolean;
1658
- /** @internal */ set_breakUnderError(v: boolean): boolean;
1659
- /** @internal */ get_removeOnBreak(): boolean;
1660
- /** @internal */ set_removeOnBreak(v: boolean): boolean;
1661
- /** @internal */ get_cbTypes(): Any$J;
1764
+ get_type(): Any$I;
1765
+ set_type(type: Any$I): Any$I;
1766
+ get_shapes(): Any$I;
1767
+ get_isBullet(): boolean;
1768
+ set_isBullet(v: boolean): boolean;
1769
+ get_disableCCD(): boolean;
1770
+ 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;
1775
+ get_rotation(): number;
1776
+ set_rotation(rotation: number): number;
1777
+ get_angularVel(): number;
1778
+ set_angularVel(angularVel: number): number;
1779
+ get_kinematicVel(): Any$I;
1780
+ set_kinematicVel(kinematicVel: Any$I): Any$I;
1781
+ get_kinAngVel(): number;
1782
+ 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;
1787
+ get_torque(): number;
1788
+ set_torque(torque: number): number;
1789
+ get_bounds(): Any$I;
1790
+ get_constraintVelocity(): Any$I;
1791
+ get_constraintMass(): number;
1792
+ get_constraintInertia(): number;
1793
+ get_allowMovement(): boolean;
1794
+ set_allowMovement(allowMovement: boolean): boolean;
1795
+ get_allowRotation(): boolean;
1796
+ set_allowRotation(allowRotation: boolean): boolean;
1797
+ 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;
1806
+ get_mass(): number;
1807
+ set_mass(mass: number): number;
1808
+ get_gravMassMode(): Any$I;
1809
+ set_gravMassMode(gravMassMode: Any$I): Any$I;
1810
+ get_gravMass(): number;
1811
+ set_gravMass(gravMass: number): number;
1812
+ get_gravMassScale(): number;
1813
+ set_gravMassScale(gravMassScale: number): number;
1814
+ get_inertiaMode(): Any$I;
1815
+ set_inertiaMode(inertiaMode: Any$I): Any$I;
1816
+ get_inertia(): number;
1817
+ set_inertia(inertia: number): number;
1818
+ get_localCOM(): Any$I;
1819
+ get_worldCOM(): Any$I;
1820
+ integrate(deltaTime: number): Body;
1821
+ localPointToWorld(point: Vec2, weak?: boolean): Vec2;
1822
+ worldPointToLocal(point: Vec2, weak?: boolean): Vec2;
1823
+ localVectorToWorld(vector: Vec2, weak?: boolean): Vec2;
1824
+ worldVectorToLocal(vector: Vec2, weak?: boolean): Vec2;
1825
+ applyImpulse(impulse: Vec2, pos?: Vec2, sleepable?: boolean): Body;
1826
+ applyAngularImpulse(impulse: number, sleepable?: boolean): Body;
1827
+ setVelocityFromTarget(targetPosition: Vec2, targetRotation: number, deltaTime: number): Body;
1828
+ translateShapes(translation: Vec2): Body;
1829
+ rotateShapes(angle: number): Body;
1830
+ scaleShapes(scaleX: number, scaleY: number): Body;
1831
+ transformShapes(matrix: Any$I): Body;
1832
+ align(): Body;
1833
+ rotate(centre: Vec2, angle: number): Body;
1834
+ setShapeMaterials(material: Any$I): Body;
1835
+ setShapeFilters(filter: Any$I): Body;
1836
+ setShapeFluidProperties(fluidProperties: Any$I): Body;
1837
+ 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;
1847
+ constraintsImpulse(): Vec3;
1848
+ totalImpulse(body?: Any$I, freshOnly?: boolean): Vec3;
1849
+ crushFactor(): number;
1850
+ private _arbiterImpulseQuery;
1662
1851
  }
1663
1852
 
1664
1853
  /**
1665
- * ZPP_Listener — Internal listener base class for the nape physics engine.
1854
+ * ZPP_Material — Internal material representation for the nape physics engine.
1666
1855
  *
1667
- * Base class for ZPP_BodyListener, ZPP_ConstraintListener, and
1668
- * ZPP_InteractionListener. Holds common properties (space, precedence,
1669
- * event type, listener type) and provides stub methods for subclass override.
1856
+ * Stores physical material properties (friction, elasticity, density) and
1857
+ * manages the list of shapes that reference this material for invalidation.
1670
1858
  *
1671
- * Converted from nape-compiled.js lines 2725927304, 112053112139.
1859
+ * Converted from nape-compiled.js lines 8752387601, 135477135481.
1672
1860
  */
1673
- type Any$I = any;
1674
- declare class ZPP_Listener {
1861
+ type Any$H = any;
1862
+ declare class ZPP_Material {
1863
+ static zpp_pool: ZPP_Material | null;
1864
+ static WAKE: number;
1865
+ static PROPS: number;
1866
+ static ANGDRAG: number;
1867
+ static ARBITERS: number;
1675
1868
  static __name__: string[];
1676
- static _nape: Any$I;
1677
- static _zpp: Any$I;
1678
- static internal: boolean;
1679
- static types: Any$I[];
1680
- static events: Any$I[];
1681
- space: Any$I;
1682
- interaction: Any$I;
1683
- constraint: Any$I;
1684
- body: Any$I;
1685
- precedence: number;
1686
- event: number;
1687
- type: number;
1688
- id: number;
1689
- outer: Any$I;
1690
- __class__: Any$I;
1869
+ /**
1870
+ * Namespace references, set by the compiled module after import.
1871
+ * _nape = the `nape` public namespace (for wrapper creation)
1872
+ * _zpp = the `zpp_nape` internal namespace (for ZNPList_ZPP_Shape)
1873
+ */
1874
+ static _nape: Any$H;
1875
+ static _zpp: Any$H;
1876
+ /**
1877
+ * Wrapper factory callback, registered by the modernized Material class.
1878
+ * When set, wrapper() uses this instead of creating a compiled Material.
1879
+ */
1880
+ static _wrapFn: ((zpp: ZPP_Material) => Any$H) | null;
1881
+ elasticity: number;
1882
+ dynamicFriction: number;
1883
+ staticFriction: number;
1884
+ density: number;
1885
+ rollingFriction: number;
1886
+ shapes: Any$H;
1887
+ wrap_shapes: Any$H;
1888
+ outer: Any$H;
1889
+ userData: Any$H;
1890
+ next: ZPP_Material | null;
1891
+ __class__: Any$H;
1691
1892
  constructor();
1692
- /** Sort comparator: higher precedence first, then by id descending. */
1693
- static setlt(a: ZPP_Listener, b: ZPP_Listener): boolean;
1694
- swapEvent(_event?: number): void;
1695
- invalidate_precedence(): void;
1696
- addedToSpace(): void;
1697
- removedFromSpace(): void;
1893
+ /** Create/return the public nape.phys.Material wrapper for this internal object. */
1894
+ wrapper(): Any$H;
1895
+ /** Called when this object is returned to the pool. */
1896
+ free(): void;
1897
+ /** Called when this object is taken from the pool. */
1898
+ alloc(): void;
1899
+ /** Initialize the shapes list (called during feature construction). */
1900
+ feature_cons(): void;
1901
+ /** Register a shape that uses this material. */
1902
+ addShape(shape: Any$H): void;
1903
+ /** Unregister a shape that no longer uses this material. */
1904
+ remShape(shape: Any$H): void;
1905
+ /** Create a copy with the same property values. */
1906
+ copy(): ZPP_Material;
1907
+ /** Copy all property values from another ZPP_Material. */
1908
+ set(x: ZPP_Material): void;
1909
+ /** Notify all shapes using this material that properties changed. */
1910
+ invalidate(x: number): void;
1698
1911
  }
1699
1912
 
1700
1913
  /**
1701
- * Callback event types.
1914
+ * Physical material properties applied to shapes.
1702
1915
  *
1703
- * - `BEGIN` — interaction just started
1704
- * - `ONGOING` interaction continues
1705
- * - `END` interaction just ended
1706
- * - `WAKE` — body/constraint woke up
1707
- * - `SLEEP` — body/constraint went to sleep
1708
- * - `BREAK` — constraint was broken
1709
- * - `PRE` — pre-interaction callback
1916
+ * Controls elasticity (bounciness), friction coefficients, density, and
1917
+ * rolling friction. Internally wraps a ZPP_Material and is registered as
1918
+ * the public `nape.phys.Material` class in the compiled namespace.
1710
1919
  *
1711
- * Converted from nape-compiled.js lines 516657.
1920
+ * Converted from nape-compiled.js lines 3825438573.
1712
1921
  */
1713
- declare class CbEvent {
1922
+ declare class Material {
1714
1923
  static __name__: string[];
1715
- constructor();
1716
- static get BEGIN(): CbEvent;
1717
- static get ONGOING(): CbEvent;
1718
- static get END(): CbEvent;
1719
- static get WAKE(): CbEvent;
1720
- static get SLEEP(): CbEvent;
1721
- static get BREAK(): CbEvent;
1722
- static get PRE(): CbEvent;
1723
- static get_BEGIN(): CbEvent;
1724
- static get_ONGOING(): CbEvent;
1725
- static get_END(): CbEvent;
1726
- static get_WAKE(): CbEvent;
1727
- static get_SLEEP(): CbEvent;
1728
- static get_BREAK(): CbEvent;
1729
- static get_PRE(): CbEvent;
1924
+ /** @internal The internal ZPP_Material this wrapper owns. */
1925
+ zpp_inner: ZPP_Material;
1926
+ /**
1927
+ * Backward-compatible accessor — returns `this` so that compiled engine
1928
+ * code that receives `material._inner` can still access `zpp_inner`.
1929
+ * @internal
1930
+ */
1931
+ get _inner(): NapeInner;
1932
+ constructor(elasticity?: number, dynamicFriction?: number, staticFriction?: number, density?: number, rollingFriction?: number);
1933
+ /** @internal Wrap a ZPP_Material (or legacy compiled Material) with caching. */
1934
+ static _wrap(inner: any): Material;
1935
+ get elasticity(): number;
1936
+ set elasticity(value: number);
1937
+ get dynamicFriction(): number;
1938
+ set dynamicFriction(value: number);
1939
+ get staticFriction(): number;
1940
+ set staticFriction(value: number);
1941
+ get density(): number;
1942
+ set density(value: number);
1943
+ get rollingFriction(): number;
1944
+ set rollingFriction(value: number);
1945
+ get userData(): Record<string, unknown>;
1946
+ copy(): Material;
1730
1947
  toString(): string;
1948
+ static wood(): Material;
1949
+ static steel(): Material;
1950
+ static ice(): Material;
1951
+ static rubber(): Material;
1952
+ static glass(): Material;
1953
+ static sand(): Material;
1731
1954
  }
1732
1955
 
1733
1956
  /**
1734
- * Listener type classification.
1957
+ * ZPP_FluidProperties Internal fluid properties for the nape physics engine.
1735
1958
  *
1736
- * - `BODY` — body event listener
1737
- * - `CONSTRAINT` — constraint event listener
1738
- * - `INTERACTION` — interaction event listener
1739
- * - `PRE` — pre-interaction listener
1959
+ * Stores density, viscosity, and per-fluid gravity override.
1960
+ * Manages the list of shapes that reference these properties for invalidation.
1740
1961
  *
1741
- * Converted from nape-compiled.js lines 25542646.
1962
+ * Converted from nape-compiled.js lines 8733587523, 135403.
1742
1963
  */
1743
- declare class ListenerType {
1964
+ type Any$G = any;
1965
+ declare class ZPP_FluidProperties {
1966
+ static zpp_pool: ZPP_FluidProperties | null;
1744
1967
  static __name__: string[];
1745
- static BODY: ListenerType | null;
1746
- static CONSTRAINT: ListenerType | null;
1747
- static INTERACTION: ListenerType | null;
1748
- static PRE: ListenerType | null;
1968
+ static _nape: Any$G;
1969
+ static _zpp: Any$G;
1970
+ static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$G) | null;
1971
+ viscosity: number;
1972
+ density: number;
1973
+ gravityx: number;
1974
+ gravityy: number;
1975
+ wrap_gravity: Any$G;
1976
+ shapes: Any$G;
1977
+ wrap_shapes: Any$G;
1978
+ outer: Any$G;
1979
+ userData: Any$G;
1980
+ next: ZPP_FluidProperties | null;
1981
+ __class__: Any$G;
1749
1982
  constructor();
1750
- static get_BODY(): ListenerType;
1751
- static get_CONSTRAINT(): ListenerType;
1752
- static get_INTERACTION(): ListenerType;
1753
- static get_PRE(): ListenerType;
1754
- toString(): string;
1983
+ /** Create/return the public nape.phys.FluidProperties wrapper. */
1984
+ wrapper(): Any$G;
1985
+ free(): void;
1986
+ alloc(): void;
1987
+ feature_cons(): void;
1988
+ addShape(shape: Any$G): void;
1989
+ remShape(shape: Any$G): void;
1990
+ /** Copy with object pooling. */
1991
+ copy(): ZPP_FluidProperties;
1992
+ /** Called when gravity Vec2 wrapper is invalidated (user set new gravity). */
1993
+ gravity_invalidate(x: Any$G): void;
1994
+ /** Sync the gravity Vec2 wrapper with internal values. */
1995
+ gravity_validate(): void;
1996
+ /** Lazily create and return the gravity Vec2 wrapper. */
1997
+ getgravity(): void;
1998
+ /** Notify all shapes that fluid properties changed. */
1999
+ invalidate(): void;
1755
2000
  }
1756
2001
 
1757
2002
  /**
1758
- * Listener Base class for all physics event listeners.
2003
+ * Fluid properties for shapes that act as fluid regions.
1759
2004
  *
1760
- * Provides common properties (type, event, precedence, space) and
1761
- * toString() for all listener subclasses.
2005
+ * Controls density, viscosity, and per-fluid gravity override.
2006
+ * Internally wraps a ZPP_FluidProperties and is registered as
2007
+ * the public `nape.phys.FluidProperties` class in the compiled namespace.
1762
2008
  *
1763
- * Fully modernized from nape-compiled.js lines 231433.
2009
+ * Converted from nape-compiled.js lines 3700237511.
1764
2010
  */
1765
-
1766
- type Any$H = any;
1767
- declare class Listener {
2011
+ declare class FluidProperties {
1768
2012
  static __name__: string[];
1769
- zpp_inner: ZPP_Listener;
1770
- get _inner(): Any$H;
1771
- constructor();
1772
- static _wrap(inner: Any$H): Listener;
1773
- get type(): ListenerType;
1774
- get event(): CbEvent;
1775
- set event(event: CbEvent);
1776
- get precedence(): number;
1777
- set precedence(precedence: number);
1778
- get space(): Space | null;
1779
- set space(space: Space | Any$H | null);
1780
- toString(): string;
1781
- }
1782
-
1783
- /**
1784
- * The physics world. Add bodies and constraints, then call `step()` each frame.
1785
- */
1786
- declare class Space {
1787
- /** @internal */
1788
- readonly _inner: NapeInner;
1789
- constructor(gravity?: Vec2);
1790
- /** @internal */
1791
- static _wrap(inner: NapeInner): Space;
1792
- get gravity(): Vec2;
1793
- set gravity(value: Vec2);
1794
- get worldLinearDrag(): number;
1795
- set worldLinearDrag(value: number);
1796
- get worldAngularDrag(): number;
1797
- set worldAngularDrag(value: number);
1798
- get sortContacts(): boolean;
1799
- set sortContacts(value: boolean);
1800
- get bodies(): NapeList<Body>;
1801
- get liveBodies(): NapeList<Body>;
1802
- get constraints(): NapeList<Constraint>;
1803
- get liveConstraints(): NapeList<Constraint>;
1804
- get arbiters(): NapeInner;
1805
- get listeners(): NapeList<Listener>;
1806
- get compounds(): NapeInner;
1807
- /** The static world body (always present, immovable). */
1808
- get world(): Body;
1809
- get timeStamp(): number;
1810
- get elapsedTime(): number;
1811
- get broadphase(): NapeInner;
2013
+ /** @internal The internal ZPP_FluidProperties this wrapper owns. */
2014
+ zpp_inner: ZPP_FluidProperties;
2015
+ /**
2016
+ * Backward-compatible accessor — returns `this` so that compiled engine
2017
+ * code that receives `fluidProps._inner` can still access `zpp_inner`.
2018
+ * @internal
2019
+ */
2020
+ get _inner(): NapeInner;
2021
+ constructor(density?: number, viscosity?: number);
2022
+ /** @internal Wrap a ZPP_FluidProperties (or legacy compiled FluidProperties) with caching. */
2023
+ static _wrap(inner: any): FluidProperties;
2024
+ get density(): number;
2025
+ set density(value: number);
2026
+ get viscosity(): number;
2027
+ set viscosity(value: number);
2028
+ get gravity(): any;
2029
+ set gravity(gravity: any);
1812
2030
  get userData(): Record<string, unknown>;
1813
- step(deltaTime: number, velocityIterations?: number, positionIterations?: number): void;
1814
- clear(): void;
1815
- visitBodies(fn: (body: Body) => void): void;
1816
- visitConstraints(fn: (constraint: Constraint) => void): void;
1817
- visitCompounds(fn: (compound: NapeInner) => void): void;
1818
- shapesUnderPoint(point: Vec2, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1819
- bodiesUnderPoint(point: Vec2, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1820
- shapesInAABB(aabb: AABB, containment?: boolean, strict?: boolean, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1821
- bodiesInAABB(aabb: AABB, containment?: boolean, strict?: boolean, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
1822
- rayCast(ray: {
1823
- _inner: NapeInner;
1824
- } | NapeInner, inner?: boolean, filter?: InteractionFilterLike): NapeInner;
1825
- rayMultiCast(ray: {
1826
- _inner: NapeInner;
1827
- } | NapeInner, inner?: boolean, filter?: InteractionFilterLike, output?: NapeInner): NapeInner;
2031
+ get shapes(): any;
2032
+ copy(): FluidProperties;
1828
2033
  toString(): string;
1829
2034
  }
1830
- /** @internal Helper type for filter-like parameters. */
1831
- type InteractionFilterLike = {
1832
- _inner: NapeInner;
1833
- } | NapeInner | undefined;
1834
2035
 
1835
2036
  /**
1836
- * Body type enumeration.
2037
+ * ZPP_InteractionFilter Internal interaction filter for the nape physics engine.
1837
2038
  *
1838
- * - `STATIC` — immovable, infinite mass (walls, floors)
1839
- * - `DYNAMIC` — fully simulated (default)
1840
- * - `KINEMATIC` — moves only via velocity, not affected by forces
2039
+ * Stores collision/sensor/fluid group and mask bitmasks that determine
2040
+ * which shapes interact with each other.
1841
2041
  *
1842
- * Converted from nape-compiled.js lines 2464024705.
2042
+ * Converted from nape-compiled.js lines 6325563366, 135329.
1843
2043
  */
1844
- declare class BodyType {
2044
+ type Any$F = any;
2045
+ declare class ZPP_InteractionFilter {
2046
+ static zpp_pool: ZPP_InteractionFilter | null;
1845
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;
1846
2063
  constructor();
1847
- static get STATIC(): BodyType;
1848
- static get DYNAMIC(): BodyType;
1849
- static get KINEMATIC(): BodyType;
1850
- static get_STATIC(): BodyType;
1851
- static get_DYNAMIC(): BodyType;
1852
- static get_KINEMATIC(): BodyType;
1853
- toString(): string;
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;
1854
2081
  }
1855
2082
 
1856
2083
  /**
1857
- * ZPP_Body Internal body representation for the nape physics engine.
2084
+ * Bit-mask based interaction filter for controlling which shapes
2085
+ * collide, sense, or interact as fluids.
1858
2086
  *
1859
- * Core physics body managing position, velocity, mass, inertia, shapes, and
1860
- * CCD (continuous collision detection) sweep integration.
1861
- * Extends ZPP_Interactor (still in compiled code — methods copied at init time).
2087
+ * Internally wraps a ZPP_InteractionFilter and is registered as
2088
+ * the public `nape.dynamics.InteractionFilter` class in the compiled namespace.
1862
2089
  *
1863
- * Converted from nape-compiled.js lines 5243154547.
2090
+ * Converted from nape-compiled.js lines 1436114640.
1864
2091
  */
1865
-
1866
- type Any$G = any;
1867
- declare class ZPP_Body {
2092
+ declare class InteractionFilter {
1868
2093
  static __name__: string[];
1869
- static __super__: Any$G;
2094
+ /** @internal The internal ZPP_InteractionFilter this wrapper owns. */
2095
+ zpp_inner: ZPP_InteractionFilter;
1870
2096
  /**
1871
- * Namespace references, set by the compiled module after import.
1872
- * _nape = the `nape` public namespace
1873
- * _zpp = the `zpp_nape` internal namespace
2097
+ * Backward-compatible accessor returns `this` so that compiled engine
2098
+ * code that receives `filter._inner` can still access `zpp_inner`.
2099
+ * @internal
1874
2100
  */
1875
- static _nape: Any$G;
1876
- static _zpp: Any$G;
1877
- static types: Any$G[];
1878
- static bodystack: Any$G;
1879
- static bodyset: Any$G;
1880
- static cur_graph_depth: number;
1881
- static bodysetlt(a: Any$G, b: Any$G): boolean;
1882
- static __static(): Any$G;
1883
- outer_i: Any$G;
1884
- id: number;
1885
- userData: Any$G;
1886
- ishape: Any$G;
1887
- ibody: Any$G;
1888
- icompound: Any$G;
1889
- wrap_cbTypes: Any$G;
1890
- cbSet: Any$G;
1891
- cbTypes: Any$G;
1892
- group: Any$G;
1893
- cbsets: Any$G;
1894
- outer: Any$G;
1895
- world: boolean;
1896
- type: number;
1897
- compound: Any$G;
1898
- shapes: Any$G;
1899
- wrap_shapes: Any$G;
1900
- space: Any$G;
1901
- arbiters: Any$G;
1902
- wrap_arbiters: Any$G;
1903
- constraints: Any$G;
1904
- wrap_constraints: Any$G;
1905
- component: Any$G;
1906
- graph_depth: number;
1907
- sweepTime: number;
1908
- sweep_angvel: number;
1909
- sweepFrozen: boolean;
1910
- sweepRadius: number;
1911
- bullet: boolean;
1912
- bulletEnabled: boolean;
1913
- disableCCD: boolean;
1914
- pre_posx: number;
1915
- pre_posy: number;
1916
- posx: number;
1917
- posy: number;
1918
- wrap_pos: Any$G;
1919
- velx: number;
1920
- vely: number;
1921
- wrap_vel: Any$G;
1922
- forcex: number;
1923
- forcey: number;
1924
- wrap_force: Any$G;
1925
- kinvelx: number;
1926
- kinvely: number;
1927
- wrap_kinvel: Any$G;
1928
- svelx: number;
1929
- svely: number;
1930
- wrap_svel: Any$G;
1931
- wrapcvel: Any$G;
1932
- angvel: number;
1933
- torque: number;
1934
- kinangvel: number;
1935
- pre_rot: number;
1936
- rot: number;
1937
- axisx: number;
1938
- axisy: number;
1939
- zip_axis: boolean;
1940
- kinematicDelaySleep: boolean;
1941
- mass: number;
1942
- zip_mass: boolean;
1943
- massMode: number;
1944
- imass: number;
1945
- smass: number;
1946
- cmass: number;
1947
- nomove: boolean;
1948
- gravMass: number;
1949
- zip_gravMass: boolean;
1950
- gravMassMode: number;
1951
- gravMassScale: number;
1952
- zip_gravMassScale: boolean;
1953
- inertiaMode: number;
1954
- inertia: number;
1955
- zip_inertia: boolean;
1956
- cinertia: number;
1957
- iinertia: number;
1958
- sinertia: number;
1959
- norotate: boolean;
1960
- aabb: ZPP_AABB;
1961
- zip_aabb: boolean;
1962
- localCOMx: number;
1963
- localCOMy: number;
1964
- zip_localCOM: boolean;
1965
- worldCOMx: number;
1966
- worldCOMy: number;
1967
- zip_worldCOM: boolean;
1968
- wrap_localCOM: Any$G;
1969
- wrap_worldCOM: Any$G;
1970
- __class__: Any$G;
1971
- constructor();
1972
- isStatic(): boolean;
1973
- isDynamic(): boolean;
1974
- isKinematic(): boolean;
1975
- invalidate_type(): void;
1976
- invalidate_shapes(): void;
1977
- init_bodysetlist(): void;
1978
- connectedBodies_cont(b: Any$G): void;
1979
- connectedBodies(depth: number, output: Any$G): Any$G;
1980
- interactingBodies(type: number, output: Any$G): Any$G;
1981
- atRest(dt: number): boolean;
1982
- refreshArbiters(): void;
1983
- sweepIntegrate(dt: number): void;
1984
- sweepValidate(s: Any$G): void;
1985
- invalidate_pos(): void;
1986
- pos_invalidate(pos: Any$G): void;
1987
- pos_validate(): void;
1988
- vel_invalidate(vel: Any$G): void;
1989
- vel_validate(): void;
1990
- kinvel_invalidate(vel: Any$G): void;
1991
- kinvel_validate(): void;
1992
- svel_invalidate(vel: Any$G): void;
1993
- svel_validate(): void;
1994
- force_invalidate(force: Any$G): void;
1995
- force_validate(): void;
1996
- private _setupVec2Wrapper;
1997
- setupPosition(): void;
1998
- setupVelocity(): void;
1999
- setupkinvel(): void;
2000
- setupsvel(): void;
2001
- setupForce(): void;
2002
- cvel_validate(): void;
2003
- setup_cvel(): void;
2004
- invalidate_rot(): void;
2005
- validate_axis(): void;
2006
- quick_validate_axis(): void;
2007
- delta_rot(dr: number): void;
2008
- invalidate_mass(): void;
2009
- validate_mass(): void;
2010
- invalidate_gravMass(): void;
2011
- validate_gravMass(): void;
2012
- invalidate_gravMassScale(): void;
2013
- validate_gravMassScale(): void;
2014
- invalidate_inertia(): void;
2015
- validate_inertia(): void;
2016
- invalidate_wake(): void;
2017
- invalidate_aabb(): void;
2018
- validate_aabb(): void;
2019
- private _validateCircleAABB;
2020
- private _validatePolygonAABB;
2021
- aabb_validate(): void;
2022
- invalidate_localCOM(): void;
2023
- invalidate_worldCOM(): void;
2024
- private _computePolygonLocalCOM;
2025
- validate_localCOM(): void;
2026
- validate_worldCOM(): void;
2027
- getlocalCOM(): void;
2028
- getworldCOM(): void;
2029
- __immutable_midstep(): void;
2030
- clear(): void;
2031
- shapes_adder(s: Any$G): boolean;
2032
- shapes_subber(s: Any$G): void;
2033
- shapes_invalidate(_param: Any$G): void;
2034
- shapes_modifiable(): void;
2035
- addedToSpace(): void;
2036
- removedFromSpace(): void;
2037
- private _removeArbiterFromList;
2038
- copy(): Any$G;
2039
- wake: () => void;
2040
- __iaddedToSpace: () => void;
2041
- __iremovedFromSpace: () => void;
2042
- immutable_midstep: (name: string) => void;
2043
- copyto: (ret: Any$G) => void;
2044
- insert_cbtype: (cb: Any$G) => void;
2045
- alloc_cbSet: () => void;
2046
- dealloc_cbSet: () => void;
2047
- setupcbTypes: () => void;
2048
- immutable_cbTypes: () => void;
2049
- wrap_cbTypes_subber: (pcb: Any$G) => void;
2050
- wrap_cbTypes_adder: (cb: Any$G) => void;
2051
- setGroup: (group: Any$G) => void;
2052
- lookup_group: () => Any$G;
2053
- getSpace: () => Any$G;
2054
- isShape: () => boolean;
2055
- isBody: () => boolean;
2056
- isCompound: () => boolean;
2057
- static _initialized: boolean;
2058
- static _init(zpp: Any$G, nape: Any$G): void;
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;
2059
2124
  }
2060
2125
 
2061
- type Any$F = any;
2062
2126
  /**
2063
- * A rigid body in the physics simulation.
2127
+ * Shape type classification.
2064
2128
  *
2065
- * Fully modernized all methods implemented directly using ZPP_Body.
2129
+ * - `CIRCLE` circle shape
2130
+ * - `POLYGON` — polygon shape
2131
+ *
2132
+ * Converted from nape-compiled.js lines 30435–30482.
2066
2133
  */
2067
- declare class Body extends Interactor {
2134
+ declare class ShapeType {
2068
2135
  static __name__: string[];
2069
- static __super__: Any$F;
2070
- /** Direct access to the extracted internal ZPP_Body. */
2071
- zpp_inner: ZPP_Body;
2072
- debugDraw: boolean;
2073
- constructor(type?: BodyType, position?: Vec2);
2136
+ constructor();
2137
+ static get CIRCLE(): ShapeType;
2138
+ static get POLYGON(): ShapeType;
2139
+ static get_CIRCLE(): ShapeType;
2140
+ static get_POLYGON(): ShapeType;
2141
+ toString(): string;
2142
+ }
2143
+
2144
+ /**
2145
+ * Base class for physics shapes (Circle, Polygon).
2146
+ *
2147
+ * Fully modernized — all getters/setters access the ZPP_Shape inner directly.
2148
+ */
2149
+ declare class Shape extends Interactor {
2150
+ /** @internal – shapes are created via Circle or Polygon constructors. */
2151
+ protected constructor();
2074
2152
  /** @internal */
2075
- static _wrap(inner: NapeInner): Body;
2076
- get type(): BodyType;
2077
- set type(value: BodyType);
2078
- isStatic(): boolean;
2079
- isDynamic(): boolean;
2080
- isKinematic(): boolean;
2081
- get position(): Vec2;
2082
- set position(value: Vec2);
2083
- get rotation(): number;
2084
- set rotation(value: number);
2085
- get velocity(): Vec2;
2086
- set velocity(value: Vec2);
2087
- get angularVel(): number;
2088
- set angularVel(value: number);
2089
- get kinematicVel(): Vec2;
2090
- set kinematicVel(value: Vec2);
2091
- get kinAngVel(): number;
2092
- set kinAngVel(value: number);
2093
- get surfaceVel(): Vec2;
2094
- set surfaceVel(value: Vec2);
2095
- get force(): Vec2;
2096
- set force(value: Vec2);
2097
- get torque(): number;
2098
- set torque(value: number);
2099
- get mass(): number;
2100
- set mass(value: number);
2153
+ static _wrap(inner: NapeInner): Shape;
2154
+ get type(): ShapeType;
2155
+ isCircle(): boolean;
2156
+ isPolygon(): boolean;
2157
+ get body(): Body;
2158
+ set body(value: Body | null);
2159
+ get castCircle(): Shape | null;
2160
+ get castPolygon(): Shape | null;
2161
+ get worldCOM(): Vec2;
2162
+ get localCOM(): Vec2;
2163
+ set localCOM(value: Vec2);
2164
+ get area(): number;
2101
2165
  get inertia(): number;
2102
- set inertia(value: number);
2103
- get constraintMass(): number;
2104
- get constraintInertia(): number;
2105
- get gravMass(): number;
2106
- set gravMass(value: number);
2107
- get gravMassScale(): number;
2108
- set gravMassScale(value: number);
2109
- get isBullet(): boolean;
2110
- set isBullet(value: boolean);
2111
- get disableCCD(): boolean;
2112
- set disableCCD(value: boolean);
2113
- get allowMovement(): boolean;
2114
- set allowMovement(value: boolean);
2115
- get allowRotation(): boolean;
2116
- set allowRotation(value: boolean);
2117
- get isSleeping(): boolean;
2118
- get shapes(): NapeList<Shape>;
2119
- get space(): Space;
2120
- set space(value: Space | null);
2121
- get compound(): Any$F;
2122
- set compound(value: Any$F);
2166
+ get angDrag(): number;
2167
+ get material(): Material;
2168
+ set material(value: Material);
2169
+ get filter(): InteractionFilter;
2170
+ set filter(value: InteractionFilter);
2171
+ get fluidProperties(): FluidProperties;
2172
+ set fluidProperties(value: FluidProperties);
2173
+ /** Callback types assigned to this shape. */
2174
+ get cbTypes(): CbTypeSet;
2175
+ get fluidEnabled(): boolean;
2176
+ set fluidEnabled(value: boolean);
2177
+ get sensorEnabled(): boolean;
2178
+ set sensorEnabled(value: boolean);
2123
2179
  get bounds(): AABB;
2124
- get constraintVelocity(): Vec2;
2125
- get localCOM(): Vec2;
2126
- get worldCOM(): Vec2;
2127
- get massMode(): Any$F;
2128
- set massMode(value: Any$F);
2129
- get inertiaMode(): Any$F;
2130
- set inertiaMode(value: Any$F);
2131
- get gravMassMode(): Any$F;
2132
- set gravMassMode(value: Any$F);
2133
- copy(): Body;
2134
- toString(): string;
2135
- get_type(): Any$F;
2136
- set_type(type: Any$F): Any$F;
2137
- get_shapes(): Any$F;
2138
- get_isBullet(): boolean;
2139
- set_isBullet(v: boolean): boolean;
2140
- get_disableCCD(): boolean;
2141
- set_disableCCD(v: boolean): boolean;
2142
- get_position(): Any$F;
2143
- set_position(position: Any$F): Any$F;
2144
- get_velocity(): Any$F;
2145
- set_velocity(velocity: Any$F): Any$F;
2146
- get_rotation(): number;
2147
- set_rotation(rotation: number): number;
2148
- get_angularVel(): number;
2149
- set_angularVel(angularVel: number): number;
2150
- get_kinematicVel(): Any$F;
2151
- set_kinematicVel(kinematicVel: Any$F): Any$F;
2152
- get_kinAngVel(): number;
2153
- set_kinAngVel(kinAngVel: number): number;
2154
- get_surfaceVel(): Any$F;
2155
- set_surfaceVel(surfaceVel: Any$F): Any$F;
2156
- get_force(): Any$F;
2157
- set_force(force: Any$F): Any$F;
2158
- get_torque(): number;
2159
- set_torque(torque: number): number;
2160
- get_bounds(): Any$F;
2161
- get_constraintVelocity(): Any$F;
2162
- get_constraintMass(): number;
2163
- get_constraintInertia(): number;
2164
- get_allowMovement(): boolean;
2165
- set_allowMovement(allowMovement: boolean): boolean;
2166
- get_allowRotation(): boolean;
2167
- set_allowRotation(allowRotation: boolean): boolean;
2168
- get_isSleeping(): boolean;
2169
- get_compound(): Any$F;
2170
- set_compound(compound: Any$F): Any$F;
2171
- get_space(): Any$F;
2172
- set_space(space: Any$F): Any$F;
2173
- get_arbiters(): Any$F;
2174
- get_constraints(): Any$F;
2175
- get_massMode(): Any$F;
2176
- set_massMode(massMode: Any$F): Any$F;
2177
- get_mass(): number;
2178
- set_mass(mass: number): number;
2179
- get_gravMassMode(): Any$F;
2180
- set_gravMassMode(gravMassMode: Any$F): Any$F;
2181
- get_gravMass(): number;
2182
- set_gravMass(gravMass: number): number;
2183
- get_gravMassScale(): number;
2184
- set_gravMassScale(gravMassScale: number): number;
2185
- get_inertiaMode(): Any$F;
2186
- set_inertiaMode(inertiaMode: Any$F): Any$F;
2187
- get_inertia(): number;
2188
- set_inertia(inertia: number): number;
2189
- get_localCOM(): Any$F;
2190
- get_worldCOM(): Any$F;
2191
- integrate(deltaTime: number): Body;
2192
- localPointToWorld(point: Vec2, weak?: boolean): Vec2;
2193
- worldPointToLocal(point: Vec2, weak?: boolean): Vec2;
2194
- localVectorToWorld(vector: Vec2, weak?: boolean): Vec2;
2195
- worldVectorToLocal(vector: Vec2, weak?: boolean): Vec2;
2196
- applyImpulse(impulse: Vec2, pos?: Vec2, sleepable?: boolean): Body;
2197
- applyAngularImpulse(impulse: number, sleepable?: boolean): Body;
2198
- setVelocityFromTarget(targetPosition: Vec2, targetRotation: number, deltaTime: number): Body;
2199
- translateShapes(translation: Vec2): Body;
2200
- rotateShapes(angle: number): Body;
2201
- scaleShapes(scaleX: number, scaleY: number): Body;
2202
- transformShapes(matrix: Any$F): Body;
2203
- align(): Body;
2204
- rotate(centre: Vec2, angle: number): Body;
2205
- setShapeMaterials(material: Any$F): Body;
2206
- setShapeFilters(filter: Any$F): Body;
2207
- setShapeFluidProperties(fluidProperties: Any$F): Body;
2180
+ translate(translation: Vec2): Shape;
2181
+ scale(scaleX: number, scaleY: number): Shape;
2182
+ rotate(angle: number): Shape;
2183
+ transform(matrix: {
2184
+ _inner: NapeInner;
2185
+ }): Shape;
2208
2186
  contains(point: Vec2): boolean;
2209
- connectedBodies(depth?: number, output?: Any$F): Any$F;
2210
- interactingBodies(type?: Any$F, depth?: number, output?: Any$F): Any$F;
2211
- normalImpulse(body?: Any$F, freshOnly?: boolean): Vec3;
2212
- tangentImpulse(body?: Any$F, freshOnly?: boolean): Vec3;
2213
- totalContactsImpulse(body?: Any$F, freshOnly?: boolean): Vec3;
2214
- rollingImpulse(body?: Any$F, freshOnly?: boolean): number;
2215
- buoyancyImpulse(body?: Any$F): Vec3;
2216
- dragImpulse(body?: Any$F): Vec3;
2217
- totalFluidImpulse(body?: Any$F): Vec3;
2218
- constraintsImpulse(): Vec3;
2219
- totalImpulse(body?: Any$F, freshOnly?: boolean): Vec3;
2220
- crushFactor(): number;
2221
- private _arbiterImpulseQuery;
2187
+ copy(): Shape;
2188
+ toString(): string;
2189
+ /** @internal */ get_type(): ShapeType;
2190
+ /** @internal */ get_body(): Body;
2191
+ /** @internal */ set_body(v: Body | null): void;
2192
+ /** @internal */ get_castCircle(): Shape | null;
2193
+ /** @internal */ get_castPolygon(): Shape | null;
2194
+ /** @internal */ get_worldCOM(): Vec2;
2195
+ /** @internal */ get_localCOM(): Vec2;
2196
+ /** @internal */ set_localCOM(v: Vec2): void;
2197
+ /** @internal */ get_area(): number;
2198
+ /** @internal */ get_inertia(): number;
2199
+ /** @internal */ get_angDrag(): number;
2200
+ /** @internal */ get_material(): Material;
2201
+ /** @internal */ set_material(v: Material): void;
2202
+ /** @internal */ get_filter(): InteractionFilter;
2203
+ /** @internal */ set_filter(v: InteractionFilter): void;
2204
+ /** @internal */ get_fluidProperties(): FluidProperties;
2205
+ /** @internal */ set_fluidProperties(v: FluidProperties): void;
2206
+ /** @internal */ get_fluidEnabled(): boolean;
2207
+ /** @internal */ set_fluidEnabled(v: boolean): void;
2208
+ /** @internal */ get_sensorEnabled(): boolean;
2209
+ /** @internal */ set_sensorEnabled(v: boolean): void;
2210
+ /** @internal */ get_bounds(): AABB;
2211
+ /** Setup worldCOM lazy Vec2 wrapper */
2212
+ private _setupWorldCOM;
2213
+ }
2214
+ /** Lightweight typed interface for the callback type set on a shape. */
2215
+ interface CbTypeSet {
2216
+ readonly _inner: NapeInner;
2217
+ add(cbType: {
2218
+ _inner: NapeInner;
2219
+ }): void;
2220
+ remove(cbType: {
2221
+ _inner: NapeInner;
2222
+ }): void;
2223
+ has(cbType: {
2224
+ _inner: NapeInner;
2225
+ }): boolean;
2226
+ clear(): void;
2227
+ readonly length: number;
2228
+ }
2229
+
2230
+ /**
2231
+ * Static utility class for geometric queries between shapes and bodies.
2232
+ *
2233
+ * Fully modernized — calls ZPP_Geom, ZPP_SweepDistance, and ZPP_Collide directly.
2234
+ */
2235
+ declare class Geom {
2236
+ static __name__: string[];
2237
+ /**
2238
+ * Calculate minimum distance between two bodies and return closest points.
2239
+ */
2240
+ static distanceBody(body1: Body, body2: Body, out1: Vec2, out2: Vec2): number;
2241
+ /**
2242
+ * Calculate minimum distance between two shapes and return closest points.
2243
+ */
2244
+ static distance(shape1: Shape, shape2: Shape, out1: Vec2, out2: Vec2): number;
2245
+ /**
2246
+ * Test if two bodies intersect (any of their shapes overlap).
2247
+ */
2248
+ static intersectsBody(body1: Body, body2: Body): boolean;
2249
+ /**
2250
+ * Test if two shapes intersect.
2251
+ */
2252
+ static intersects(shape1: Shape, shape2: Shape): boolean;
2253
+ /**
2254
+ * Test if shape1 fully contains shape2.
2255
+ */
2256
+ static contains(shape1: Shape, shape2: Shape): boolean;
2222
2257
  }
2223
2258
 
2224
2259
  /**