@newkrok/nape-js 3.3.13 → 3.3.14

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
@@ -25,13 +25,13 @@ declare function getNape(): any;
25
25
  *
26
26
  * Converted from nape-compiled.js lines 83820–84273, 134996.
27
27
  */
28
- type Any$x = any;
28
+ type Any$A = any;
29
29
  declare class ZPP_Vec2 {
30
30
  static zpp_pool: ZPP_Vec2 | null;
31
31
  static __name__: string[];
32
- static _nape: Any$x;
33
- static _zpp: Any$x;
34
- static _wrapFn: ((zpp: ZPP_Vec2) => Any$x) | null;
32
+ static _nape: Any$A;
33
+ static _zpp: Any$A;
34
+ static _wrapFn: ((zpp: ZPP_Vec2) => Any$A) | null;
35
35
  x: number;
36
36
  y: number;
37
37
  next: ZPP_Vec2 | null;
@@ -40,18 +40,18 @@ declare class ZPP_Vec2 {
40
40
  pushmod: boolean;
41
41
  _inuse: boolean;
42
42
  weak: boolean;
43
- outer: Any$x;
43
+ outer: Any$A;
44
44
  _immutable: boolean;
45
45
  _isimmutable: (() => void) | null;
46
46
  _validate: (() => void) | null;
47
47
  _invalidate: ((self: ZPP_Vec2) => void) | null;
48
- __class__: Any$x;
48
+ __class__: Any$A;
49
49
  /** Static factory with optional pooling and immutability. */
50
50
  static get(x: number, y: number, immutable?: boolean): ZPP_Vec2;
51
51
  validate(): void;
52
52
  invalidate(): void;
53
53
  immutable(): void;
54
- wrapper(): Any$x;
54
+ wrapper(): Any$A;
55
55
  free(): void;
56
56
  alloc(): void;
57
57
  elem(): ZPP_Vec2;
@@ -203,20 +203,20 @@ type NapeInner = any;
203
203
  *
204
204
  * Converted from nape-compiled.js lines 83412–83434.
205
205
  */
206
- type Any$w = any;
206
+ type Any$z = any;
207
207
  declare class ZPP_Vec3 {
208
208
  static __name__: string[];
209
- static _zpp: Any$w;
210
- static _wrapFn: ((zpp: ZPP_Vec3) => Any$w) | null;
211
- outer: Any$w;
209
+ static _zpp: Any$z;
210
+ static _wrapFn: ((zpp: ZPP_Vec3) => Any$z) | null;
211
+ outer: Any$z;
212
212
  x: number;
213
213
  y: number;
214
214
  z: number;
215
215
  immutable: boolean;
216
216
  _validate: (() => void) | null;
217
- __class__: Any$w;
217
+ __class__: Any$z;
218
218
  validate(): void;
219
- wrapper(): Any$w;
219
+ wrapper(): Any$z;
220
220
  }
221
221
 
222
222
  /**
@@ -280,13 +280,13 @@ declare class Vec3 {
280
280
  *
281
281
  * Converted from nape-compiled.js lines 73495–73561, 133826.
282
282
  */
283
- type Any$v = any;
283
+ type Any$y = any;
284
284
  declare class ZPP_Mat23 {
285
285
  static __name__: string[];
286
- static _nape: Any$v;
287
- static _wrapFn: ((zpp: ZPP_Mat23) => Any$v) | null;
286
+ static _nape: Any$y;
287
+ static _wrapFn: ((zpp: ZPP_Mat23) => Any$y) | null;
288
288
  static zpp_pool: ZPP_Mat23 | null;
289
- outer: Any$v;
289
+ outer: Any$y;
290
290
  a: number;
291
291
  b: number;
292
292
  c: number;
@@ -295,13 +295,13 @@ declare class ZPP_Mat23 {
295
295
  ty: number;
296
296
  _invalidate: (() => void) | null;
297
297
  next: ZPP_Mat23 | null;
298
- __class__: Any$v;
298
+ __class__: Any$y;
299
299
  /** Static factory with pooling. */
300
300
  static get(): ZPP_Mat23;
301
301
  /** Create an identity matrix from pool. */
302
302
  static identity(): ZPP_Mat23;
303
303
  /** Create a public wrapper, recycling any existing inner. */
304
- wrapper(): Any$v;
304
+ wrapper(): Any$y;
305
305
  invalidate(): void;
306
306
  set(m: ZPP_Mat23): void;
307
307
  setas(a: number, b: number, c: number, d: number, tx: number, ty: number): void;
@@ -362,13 +362,13 @@ declare class Mat23 {
362
362
  *
363
363
  * Converted from nape-compiled.js lines 69554–69563.
364
364
  */
365
- type Any$u = any;
365
+ type Any$x = any;
366
366
  declare class ZPP_GeomPoly {
367
367
  static __name__: string[];
368
- outer: Any$u;
369
- vertices: Any$u;
370
- __class__: Any$u;
371
- constructor(outer?: Any$u);
368
+ outer: Any$x;
369
+ vertices: Any$x;
370
+ __class__: Any$x;
371
+ constructor(outer?: Any$x);
372
372
  }
373
373
 
374
374
  /**
@@ -392,7 +392,7 @@ declare class Winding {
392
392
  toString(): string;
393
393
  }
394
394
 
395
- type Any$t = any;
395
+ type Any$w = any;
396
396
  /**
397
397
  * A polygon represented as a circular doubly-linked list of vertices.
398
398
  *
@@ -407,8 +407,8 @@ declare class GeomPoly {
407
407
  zpp_inner: ZPP_GeomPoly;
408
408
  zpp_pool: GeomPoly | null;
409
409
  zpp_disp: boolean;
410
- get _inner(): Any$t;
411
- constructor(vertices?: Any$t);
410
+ get _inner(): Any$w;
411
+ constructor(vertices?: Any$w);
412
412
  private _checkDisposed;
413
413
  /** @internal Get compiled ZPP_GeomVert class */
414
414
  private static _gvClass;
@@ -434,12 +434,12 @@ declare class GeomPoly {
434
434
  private static _addVertices;
435
435
  /** @internal After copying, dispose weak Vec2 inputs */
436
436
  private static _disposeWeakInputs;
437
- static get(vertices?: Any$t): GeomPoly;
437
+ static get(vertices?: Any$w): GeomPoly;
438
438
  empty(): boolean;
439
439
  size(): number;
440
- iterator(): Any$t;
441
- forwardIterator(): Any$t;
442
- backwardsIterator(): Any$t;
440
+ iterator(): Any$w;
441
+ forwardIterator(): Any$w;
442
+ backwardsIterator(): Any$w;
443
443
  current(): Vec2;
444
444
  push(vertex: Vec2): this;
445
445
  pop(): this;
@@ -452,7 +452,7 @@ declare class GeomPoly {
452
452
  copy(): GeomPoly;
453
453
  dispose(): void;
454
454
  area(): number;
455
- winding(): Any$t;
455
+ winding(): Any$w;
456
456
  contains(point: Vec2): boolean;
457
457
  isClockwise(): boolean;
458
458
  isConvex(): boolean;
@@ -460,14 +460,14 @@ declare class GeomPoly {
460
460
  isMonotone(): boolean;
461
461
  isDegenerate(): boolean;
462
462
  simplify(epsilon: number): GeomPoly;
463
- simpleDecomposition(output?: Any$t): Any$t;
464
- monotoneDecomposition(output?: Any$t): Any$t;
465
- convexDecomposition(delaunay?: boolean, output?: Any$t): Any$t;
466
- triangularDecomposition(delaunay?: boolean, output?: Any$t): Any$t;
463
+ simpleDecomposition(output?: Any$w): Any$w;
464
+ monotoneDecomposition(output?: Any$w): Any$w;
465
+ convexDecomposition(delaunay?: boolean, output?: Any$w): Any$w;
466
+ triangularDecomposition(delaunay?: boolean, output?: Any$w): Any$w;
467
467
  inflate(inflation: number): GeomPoly;
468
- cut(start: Vec2, end: Vec2, boundedStart?: boolean, boundedEnd?: boolean, output?: Any$t): Any$t;
469
- transform(matrix: Any$t): this;
470
- bounds(): Any$t;
468
+ cut(start: Vec2, end: Vec2, boundedStart?: boolean, boundedEnd?: boolean, output?: Any$w): Any$w;
469
+ transform(matrix: Any$w): this;
470
+ bounds(): Any$w;
471
471
  top(): Vec2;
472
472
  bottom(): Vec2;
473
473
  left(): Vec2;
@@ -483,30 +483,30 @@ declare class GeomPoly {
483
483
  *
484
484
  * Converted from nape-compiled.js lines 63546–63965, 134951.
485
485
  */
486
- type Any$s = any;
486
+ type Any$v = any;
487
487
  declare class ZPP_AABB {
488
488
  static zpp_pool: ZPP_AABB | null;
489
489
  static __name__: string[];
490
- static _nape: Any$s;
491
- static _zpp: Any$s;
492
- static _wrapFn: ((zpp: ZPP_AABB) => Any$s) | null;
490
+ static _nape: Any$v;
491
+ static _zpp: Any$v;
492
+ static _wrapFn: ((zpp: ZPP_AABB) => Any$v) | null;
493
493
  _invalidate: ((self: ZPP_AABB) => void) | null;
494
494
  _validate: (() => void) | null;
495
495
  _immutable: boolean;
496
- outer: Any$s;
496
+ outer: Any$v;
497
497
  next: ZPP_AABB | null;
498
498
  minx: number;
499
499
  miny: number;
500
500
  maxx: number;
501
501
  maxy: number;
502
- wrap_min: Any$s;
503
- wrap_max: Any$s;
504
- __class__: Any$s;
502
+ wrap_min: Any$v;
503
+ wrap_max: Any$v;
504
+ __class__: Any$v;
505
505
  /** Static factory with pooling. */
506
506
  static get(minx: number, miny: number, maxx: number, maxy: number): ZPP_AABB;
507
507
  validate(): void;
508
508
  invalidate(): void;
509
- wrapper(): Any$s;
509
+ wrapper(): Any$v;
510
510
  alloc(): void;
511
511
  free(): void;
512
512
  copy(): ZPP_AABB;
@@ -517,10 +517,10 @@ declare class ZPP_AABB {
517
517
  private static _makeVec2Wrapper;
518
518
  getmin(): void;
519
519
  dom_min(): void;
520
- mod_min(min: Any$s): void;
520
+ mod_min(min: Any$v): void;
521
521
  getmax(): void;
522
522
  dom_max(): void;
523
- mod_max(max: Any$s): void;
523
+ mod_max(max: Any$v): void;
524
524
  intersectX(x: ZPP_AABB): boolean;
525
525
  intersectY(x: ZPP_AABB): boolean;
526
526
  intersect(x: ZPP_AABB): boolean;
@@ -584,18 +584,18 @@ declare class AABB {
584
584
  *
585
585
  * Converted from nape-compiled.js lines 72949–72972.
586
586
  */
587
- type Any$r = any;
587
+ type Any$u = any;
588
588
  declare class ZPP_MatMN {
589
589
  static __name__: string[];
590
- outer: Any$r;
590
+ outer: Any$u;
591
591
  m: number;
592
592
  n: number;
593
593
  x: number[];
594
- __class__: Any$r;
594
+ __class__: Any$u;
595
595
  constructor(m: number, n: number);
596
596
  }
597
597
 
598
- type Any$q = any;
598
+ type Any$t = any;
599
599
  /**
600
600
  * Variable-sized M×N matrix.
601
601
  *
@@ -606,7 +606,7 @@ declare class MatMN {
606
606
  zpp_inner: ZPP_MatMN;
607
607
  get _inner(): NapeInner;
608
608
  constructor(rows: number, cols: number);
609
- static _wrap(inner: Any$q): MatMN;
609
+ static _wrap(inner: Any$t): MatMN;
610
610
  get rows(): number;
611
611
  get cols(): number;
612
612
  x(row: number, col: number): number;
@@ -616,7 +616,7 @@ declare class MatMN {
616
616
  mul(matrix: MatMN): MatMN;
617
617
  }
618
618
 
619
- type Any$p = any;
619
+ type Any$s = any;
620
620
  /**
621
621
  * Isosurface extraction using the marching squares algorithm.
622
622
  *
@@ -639,7 +639,7 @@ declare class MarchingSquares {
639
639
  * @param output - Optional GeomPolyList to populate. If null, a new one is created.
640
640
  * @returns The populated GeomPolyList.
641
641
  */
642
- static run(iso: (x: number, y: number) => number, bounds: AABB, cellsize: Vec2, quality?: number, subgrid?: Vec2 | null, combine?: boolean, output?: Any$p): Any$p;
642
+ static run(iso: (x: number, y: number) => number, bounds: AABB, cellsize: Vec2, quality?: number, subgrid?: Vec2 | null, combine?: boolean, output?: Any$s): Any$s;
643
643
  }
644
644
 
645
645
  /**
@@ -667,50 +667,84 @@ declare class Ray {
667
667
  copy(): Ray;
668
668
  }
669
669
 
670
- type Any$o = any;
670
+ /**
671
+ * ZPP_ConvexRayResult — Internal result object for ray-cast and convex-cast queries.
672
+ *
673
+ * Serves as the shared internal type for both RayResult and ConvexResult public wrappers.
674
+ * Uses separate pools for ray results vs convex results.
675
+ *
676
+ * Converted from nape-compiled.js lines 38897–39076, 86860–86862.
677
+ */
678
+ type Any$r = any;
679
+ declare class ZPP_ConvexRayResult {
680
+ static __name__: string[];
681
+ static rayPool: ZPP_ConvexRayResult | null;
682
+ static convexPool: ZPP_ConvexRayResult | null;
683
+ static internal: boolean;
684
+ static _createRayResult: (() => Any$r) | null;
685
+ static _createConvexResult: (() => Any$r) | null;
686
+ normal: Any$r;
687
+ shape: Any$r;
688
+ convex: Any$r;
689
+ position: Any$r;
690
+ ray: Any$r;
691
+ inner: boolean;
692
+ next: ZPP_ConvexRayResult | null;
693
+ toiDistance: number;
694
+ __class__: Any$r;
695
+ static getRay(normal: Any$r, time: number, inner: boolean, shape: Any$r): Any$r;
696
+ static getConvex(normal: Any$r, position: Any$r, toiDistance: number, shape: Any$r): Any$r;
697
+ disposed(): void;
698
+ free(): void;
699
+ private static _disposeVec2;
700
+ }
701
+
702
+ type Any$q = any;
671
703
  /**
672
704
  * Result from a convex-cast query.
673
705
  *
674
- * Thin wrapper delegates to compiled ZPP_ConvexRayResult (not yet extracted).
706
+ * Provides the contact normal, position, time-of-impact, and shape hit.
707
+ * Instances are pooled — call `dispose()` when done to return to pool.
675
708
  */
676
709
  declare class ConvexResult {
677
710
  static __name__: string[];
678
711
  /** @internal */
679
- zpp_inner: Any$o;
712
+ zpp_inner: ZPP_ConvexRayResult;
680
713
  /** @internal Backward-compat: compiled code accesses `obj.zpp_inner`. */
681
714
  get _inner(): NapeInner;
682
715
  constructor();
683
716
  /** @internal */
684
- static _wrap(inner: Any$o): ConvexResult;
717
+ static _wrap(inner: Any$q): ConvexResult;
685
718
  get normal(): Vec2;
686
719
  get position(): Vec2;
687
720
  get toi(): number;
688
- get shape(): Any$o;
721
+ get shape(): Any$q;
689
722
  dispose(): void;
690
723
  toString(): string;
691
724
  /** @internal */
692
725
  private _disposed;
693
726
  }
694
727
 
695
- type Any$n = any;
728
+ type Any$p = any;
696
729
  /**
697
730
  * Result from a raycast query.
698
731
  *
699
- * Thin wrapper delegates to compiled ZPP_ConvexRayResult (not yet extracted).
732
+ * Provides the contact normal, distance, inside-flag, and shape hit.
733
+ * Instances are pooled — call `dispose()` when done to return to pool.
700
734
  */
701
735
  declare class RayResult {
702
736
  static __name__: string[];
703
737
  /** @internal */
704
- zpp_inner: Any$n;
738
+ zpp_inner: ZPP_ConvexRayResult;
705
739
  /** @internal Backward-compat: compiled code accesses `obj.zpp_inner`. */
706
740
  get _inner(): NapeInner;
707
741
  constructor();
708
742
  /** @internal */
709
- static _wrap(inner: Any$n): RayResult;
743
+ static _wrap(inner: Any$p): RayResult;
710
744
  get normal(): Vec2;
711
745
  get distance(): number;
712
746
  get inner(): boolean;
713
- get shape(): Any$n;
747
+ get shape(): Any$p;
714
748
  dispose(): void;
715
749
  toString(): string;
716
750
  /** @internal */
@@ -778,7 +812,7 @@ declare class NapeList<T> implements Iterable<T> {
778
812
  *
779
813
  * Converted from nape-compiled.js lines 87523–87601, 135477–135481.
780
814
  */
781
- type Any$m = any;
815
+ type Any$o = any;
782
816
  declare class ZPP_Material {
783
817
  static zpp_pool: ZPP_Material | null;
784
818
  static WAKE: number;
@@ -791,27 +825,27 @@ declare class ZPP_Material {
791
825
  * _nape = the `nape` public namespace (for wrapper creation)
792
826
  * _zpp = the `zpp_nape` internal namespace (for ZNPList_ZPP_Shape)
793
827
  */
794
- static _nape: Any$m;
795
- static _zpp: Any$m;
828
+ static _nape: Any$o;
829
+ static _zpp: Any$o;
796
830
  /**
797
831
  * Wrapper factory callback, registered by the modernized Material class.
798
832
  * When set, wrapper() uses this instead of creating a compiled Material.
799
833
  */
800
- static _wrapFn: ((zpp: ZPP_Material) => Any$m) | null;
834
+ static _wrapFn: ((zpp: ZPP_Material) => Any$o) | null;
801
835
  elasticity: number;
802
836
  dynamicFriction: number;
803
837
  staticFriction: number;
804
838
  density: number;
805
839
  rollingFriction: number;
806
- shapes: Any$m;
807
- wrap_shapes: Any$m;
808
- outer: Any$m;
809
- userData: Any$m;
840
+ shapes: Any$o;
841
+ wrap_shapes: Any$o;
842
+ outer: Any$o;
843
+ userData: Any$o;
810
844
  next: ZPP_Material | null;
811
- __class__: Any$m;
845
+ __class__: Any$o;
812
846
  constructor();
813
847
  /** Create/return the public nape.phys.Material wrapper for this internal object. */
814
- wrapper(): Any$m;
848
+ wrapper(): Any$o;
815
849
  /** Called when this object is returned to the pool. */
816
850
  free(): void;
817
851
  /** Called when this object is taken from the pool. */
@@ -819,9 +853,9 @@ declare class ZPP_Material {
819
853
  /** Initialize the shapes list (called during feature construction). */
820
854
  feature_cons(): void;
821
855
  /** Register a shape that uses this material. */
822
- addShape(shape: Any$m): void;
856
+ addShape(shape: Any$o): void;
823
857
  /** Unregister a shape that no longer uses this material. */
824
- remShape(shape: Any$m): void;
858
+ remShape(shape: Any$o): void;
825
859
  /** Create a copy with the same property values. */
826
860
  copy(): ZPP_Material;
827
861
  /** Copy all property values from another ZPP_Material. */
@@ -881,36 +915,36 @@ declare class Material {
881
915
  *
882
916
  * Converted from nape-compiled.js lines 87335–87523, 135403.
883
917
  */
884
- type Any$l = any;
918
+ type Any$n = any;
885
919
  declare class ZPP_FluidProperties {
886
920
  static zpp_pool: ZPP_FluidProperties | null;
887
921
  static __name__: string[];
888
- static _nape: Any$l;
889
- static _zpp: Any$l;
890
- static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$l) | null;
922
+ static _nape: Any$n;
923
+ static _zpp: Any$n;
924
+ static _wrapFn: ((zpp: ZPP_FluidProperties) => Any$n) | null;
891
925
  viscosity: number;
892
926
  density: number;
893
927
  gravityx: number;
894
928
  gravityy: number;
895
- wrap_gravity: Any$l;
896
- shapes: Any$l;
897
- wrap_shapes: Any$l;
898
- outer: Any$l;
899
- userData: Any$l;
929
+ wrap_gravity: Any$n;
930
+ shapes: Any$n;
931
+ wrap_shapes: Any$n;
932
+ outer: Any$n;
933
+ userData: Any$n;
900
934
  next: ZPP_FluidProperties | null;
901
- __class__: Any$l;
935
+ __class__: Any$n;
902
936
  constructor();
903
937
  /** Create/return the public nape.phys.FluidProperties wrapper. */
904
- wrapper(): Any$l;
938
+ wrapper(): Any$n;
905
939
  free(): void;
906
940
  alloc(): void;
907
941
  feature_cons(): void;
908
- addShape(shape: Any$l): void;
909
- remShape(shape: Any$l): void;
942
+ addShape(shape: Any$n): void;
943
+ remShape(shape: Any$n): void;
910
944
  /** Copy with object pooling. */
911
945
  copy(): ZPP_FluidProperties;
912
946
  /** Called when gravity Vec2 wrapper is invalidated (user set new gravity). */
913
- gravity_invalidate(x: Any$l): void;
947
+ gravity_invalidate(x: Any$n): void;
914
948
  /** Sync the gravity Vec2 wrapper with internal values. */
915
949
  gravity_validate(): void;
916
950
  /** Lazily create and return the gravity Vec2 wrapper. */
@@ -961,33 +995,33 @@ declare class FluidProperties {
961
995
  *
962
996
  * Converted from nape-compiled.js lines 63255–63366, 135329.
963
997
  */
964
- type Any$k = any;
998
+ type Any$m = any;
965
999
  declare class ZPP_InteractionFilter {
966
1000
  static zpp_pool: ZPP_InteractionFilter | null;
967
1001
  static __name__: string[];
968
- static _nape: Any$k;
969
- static _zpp: Any$k;
970
- static _wrapFn: ((zpp: ZPP_InteractionFilter) => Any$k) | null;
1002
+ static _nape: Any$m;
1003
+ static _zpp: Any$m;
1004
+ static _wrapFn: ((zpp: ZPP_InteractionFilter) => Any$m) | null;
971
1005
  collisionGroup: number;
972
1006
  collisionMask: number;
973
1007
  sensorGroup: number;
974
1008
  sensorMask: number;
975
1009
  fluidGroup: number;
976
1010
  fluidMask: number;
977
- shapes: Any$k;
978
- wrap_shapes: Any$k;
979
- outer: Any$k;
980
- userData: Any$k;
1011
+ shapes: Any$m;
1012
+ wrap_shapes: Any$m;
1013
+ outer: Any$m;
1014
+ userData: Any$m;
981
1015
  next: ZPP_InteractionFilter | null;
982
- __class__: Any$k;
1016
+ __class__: Any$m;
983
1017
  constructor();
984
1018
  /** Create/return the public nape.dynamics.InteractionFilter wrapper. */
985
- wrapper(): Any$k;
1019
+ wrapper(): Any$m;
986
1020
  free(): void;
987
1021
  alloc(): void;
988
1022
  feature_cons(): void;
989
- addShape(shape: Any$k): void;
990
- remShape(shape: Any$k): void;
1023
+ addShape(shape: Any$m): void;
1024
+ remShape(shape: Any$m): void;
991
1025
  /** Create a copy with object pooling. */
992
1026
  copy(): ZPP_InteractionFilter;
993
1027
  /** Test whether two filters allow collision between their shapes. */
@@ -1051,22 +1085,22 @@ declare class InteractionFilter {
1051
1085
  *
1052
1086
  * Converted from nape-compiled.js lines 63367–63463, 135330–135331.
1053
1087
  */
1054
- type Any$j = any;
1088
+ type Any$l = any;
1055
1089
  declare class ZPP_InteractionGroup {
1056
1090
  static SHAPE: number;
1057
1091
  static BODY: number;
1058
1092
  static __name__: string[];
1059
- static _zpp: Any$j;
1060
- static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$j) | null;
1061
- outer: Any$j;
1093
+ static _zpp: Any$l;
1094
+ static _wrapFn: ((zpp: ZPP_InteractionGroup) => Any$l) | null;
1095
+ outer: Any$l;
1062
1096
  ignore: boolean;
1063
1097
  group: ZPP_InteractionGroup | null;
1064
- groups: Any$j;
1065
- wrap_groups: Any$j;
1066
- interactors: Any$j;
1067
- wrap_interactors: Any$j;
1098
+ groups: Any$l;
1099
+ wrap_groups: Any$l;
1100
+ interactors: Any$l;
1101
+ wrap_interactors: Any$l;
1068
1102
  depth: number;
1069
- __class__: Any$j;
1103
+ __class__: Any$l;
1070
1104
  constructor();
1071
1105
  /** Set or change the parent group. */
1072
1106
  setGroup(group: ZPP_InteractionGroup | null): void;
@@ -1077,9 +1111,9 @@ declare class ZPP_InteractionGroup {
1077
1111
  /** Remove a child group. */
1078
1112
  remGroup(group: ZPP_InteractionGroup): void;
1079
1113
  /** Register an interactor in this group. */
1080
- addInteractor(intx: Any$j): void;
1114
+ addInteractor(intx: Any$l): void;
1081
1115
  /** Unregister an interactor from this group. */
1082
- remInteractor(intx: Any$j, flag?: number): void;
1116
+ remInteractor(intx: Any$l, flag?: number): void;
1083
1117
  }
1084
1118
 
1085
1119
  /**
@@ -1286,24 +1320,24 @@ declare class Constraint {
1286
1320
  *
1287
1321
  * Converted from nape-compiled.js lines 27259–27304, 112053–112139.
1288
1322
  */
1289
- type Any$i = any;
1323
+ type Any$k = any;
1290
1324
  declare class ZPP_Listener {
1291
1325
  static __name__: string[];
1292
- static _nape: Any$i;
1293
- static _zpp: Any$i;
1326
+ static _nape: Any$k;
1327
+ static _zpp: Any$k;
1294
1328
  static internal: boolean;
1295
- static types: Any$i[];
1296
- static events: Any$i[];
1297
- space: Any$i;
1298
- interaction: Any$i;
1299
- constraint: Any$i;
1300
- body: Any$i;
1329
+ static types: Any$k[];
1330
+ static events: Any$k[];
1331
+ space: Any$k;
1332
+ interaction: Any$k;
1333
+ constraint: Any$k;
1334
+ body: Any$k;
1301
1335
  precedence: number;
1302
1336
  event: number;
1303
1337
  type: number;
1304
1338
  id: number;
1305
- outer: Any$i;
1306
- __class__: Any$i;
1339
+ outer: Any$k;
1340
+ __class__: Any$k;
1307
1341
  constructor();
1308
1342
  /** Sort comparator: higher precedence first, then by id descending. */
1309
1343
  static setlt(a: ZPP_Listener, b: ZPP_Listener): boolean;
@@ -1379,20 +1413,20 @@ declare class ListenerType {
1379
1413
  * Fully modernized from nape-compiled.js lines 231–433.
1380
1414
  */
1381
1415
 
1382
- type Any$h = any;
1416
+ type Any$j = any;
1383
1417
  declare class Listener {
1384
1418
  static __name__: string[];
1385
1419
  zpp_inner: ZPP_Listener;
1386
- get _inner(): Any$h;
1420
+ get _inner(): Any$j;
1387
1421
  constructor();
1388
- static _wrap(inner: Any$h): Listener;
1422
+ static _wrap(inner: Any$j): Listener;
1389
1423
  get type(): ListenerType;
1390
1424
  get event(): CbEvent;
1391
1425
  set event(event: CbEvent);
1392
1426
  get precedence(): number;
1393
1427
  set precedence(precedence: number);
1394
1428
  get space(): Space | null;
1395
- set space(space: Space | Any$h | null);
1429
+ set space(space: Space | Any$j | null);
1396
1430
  toString(): string;
1397
1431
  }
1398
1432
 
@@ -1551,6 +1585,48 @@ declare class Body extends Interactor {
1551
1585
  toString(): string;
1552
1586
  }
1553
1587
 
1588
+ type Any$i = any;
1589
+ /**
1590
+ * A compound physics object — a hierarchical grouping of Bodies, Constraints,
1591
+ * and other Compounds.
1592
+ *
1593
+ * Thin wrapper — delegates to compiled nape.phys.Compound (ZPP_Compound not extracted).
1594
+ */
1595
+ declare class Compound extends Interactor {
1596
+ constructor();
1597
+ /** @internal */
1598
+ static _wrap(inner: NapeInner): Compound;
1599
+ /** Bodies in this compound. */
1600
+ get bodies(): Any$i;
1601
+ /** Constraints in this compound. */
1602
+ get constraints(): Any$i;
1603
+ /** Child compounds in this compound. */
1604
+ get compounds(): Any$i;
1605
+ /** Parent compound, or null if this is a root compound. */
1606
+ get compound(): Compound | null;
1607
+ set compound(value: Compound | null);
1608
+ /** Space this compound belongs to (only settable on root compounds). */
1609
+ get space(): Space | null;
1610
+ set space(value: Space | null);
1611
+ /** Deep copy of this compound and all its children. */
1612
+ copy(): Compound;
1613
+ /** Distribute all children to the parent compound or space, then remove this compound. */
1614
+ breakApart(): void;
1615
+ /** Recursively visit all bodies in this compound and its sub-compounds. */
1616
+ visitBodies(lambda: (body: Body) => void): void;
1617
+ /** Recursively visit all constraints in this compound and its sub-compounds. */
1618
+ visitConstraints(lambda: (constraint: Any$i) => void): void;
1619
+ /** Recursively visit all sub-compounds in this compound. */
1620
+ visitCompounds(lambda: (compound: Compound) => void): void;
1621
+ /** Calculate the center of mass of all bodies in this compound. */
1622
+ COM(weak?: boolean): Vec2;
1623
+ /** Translate all bodies in this compound by the given vector. */
1624
+ translate(translation: Vec2): Compound;
1625
+ /** Rotate all bodies in this compound around the given centre point. */
1626
+ rotate(centre: Vec2, angle: number): Compound;
1627
+ toString(): string;
1628
+ }
1629
+
1554
1630
  /**
1555
1631
  * Gravity mass mode for a body.
1556
1632
  *
@@ -1704,6 +1780,63 @@ declare class ArbiterType {
1704
1780
  toString(): string;
1705
1781
  }
1706
1782
 
1783
+ type Any$h = any;
1784
+ /**
1785
+ * Represents a contact point between two colliding shapes.
1786
+ *
1787
+ * Contacts are pooled internally by the engine — they cannot be created directly.
1788
+ * Access contacts via `CollisionArbiter.contacts`.
1789
+ *
1790
+ * Thin wrapper — delegates to compiled ZPP_Contact (not yet extracted).
1791
+ */
1792
+ declare class Contact {
1793
+ static __name__: string[];
1794
+ /** @internal */
1795
+ zpp_inner: Any$h;
1796
+ /** @internal Backward-compat: compiled code accesses `obj.zpp_inner`. */
1797
+ get _inner(): NapeInner;
1798
+ constructor();
1799
+ /** The collision arbiter this contact belongs to, or null. */
1800
+ get arbiter(): Any$h;
1801
+ /** Penetration depth of this contact (positive = overlapping). */
1802
+ get penetration(): number;
1803
+ /** World-space position of this contact point. */
1804
+ get position(): Vec2;
1805
+ /** Whether this contact was newly created in the current step. */
1806
+ get fresh(): boolean;
1807
+ /** Friction value for this contact. */
1808
+ get friction(): number;
1809
+ /**
1810
+ * Normal impulse at this contact point.
1811
+ * @param body - If null, returns world-frame impulse. Otherwise returns
1812
+ * impulse on the given body (must be one of the two in contact).
1813
+ */
1814
+ normalImpulse(body?: Any$h): Vec3;
1815
+ /**
1816
+ * Tangent impulse at this contact point.
1817
+ * @param body - If null, returns world-frame impulse. Otherwise returns
1818
+ * impulse on the given body.
1819
+ */
1820
+ tangentImpulse(body?: Any$h): Vec3;
1821
+ /**
1822
+ * Rolling impulse at this contact point.
1823
+ * @param body - If null, returns total rolling impulse. Otherwise returns
1824
+ * rolling impulse on the given body.
1825
+ */
1826
+ rollingImpulse(body?: Any$h): number;
1827
+ /**
1828
+ * Total impulse (normal + tangent + rolling) at this contact point.
1829
+ * @param body - If null, returns world-frame impulse. Otherwise returns
1830
+ * impulse on the given body.
1831
+ */
1832
+ totalImpulse(body?: Any$h): Vec3;
1833
+ toString(): string;
1834
+ /** @internal */
1835
+ private _inactiveCheck;
1836
+ /** @internal */
1837
+ private _checkBody;
1838
+ }
1839
+
1707
1840
  /**
1708
1841
  * ZPP_CbType — Internal callback type for the nape physics engine.
1709
1842
  *
@@ -2349,4 +2482,4 @@ declare class PulleyJoint extends Constraint {
2349
2482
 
2350
2483
  declare const VERSION = "3.3.6";
2351
2484
 
2352
- export { AABB, AngleJoint, ArbiterType, Body, BodyCallback, BodyListener, BodyType, Broadphase, Callback, CbEvent, CbType, Circle, Constraint, ConstraintCallback, ConstraintListener, ConvexResult, DistanceJoint, FluidProperties, GeomPoly, GravMassMode, InertiaMode, InteractionCallback, InteractionFilter, InteractionGroup, InteractionListener, InteractionType, Interactor, LineJoint, Listener, ListenerType, MarchingSquares, MassMode, Mat23, MatMN, Material, MotorJoint, NapeList, OptionType, PivotJoint, Polygon, PreCallback, PreFlag, PreListener, PulleyJoint, Ray, RayResult, Shape, ShapeType, Space, VERSION, ValidationResult, Vec2, Vec3, WeldJoint, Winding, getNape };
2485
+ export { AABB, AngleJoint, ArbiterType, Body, BodyCallback, BodyListener, BodyType, Broadphase, Callback, CbEvent, CbType, Circle, Compound, Constraint, ConstraintCallback, ConstraintListener, Contact, ConvexResult, DistanceJoint, FluidProperties, GeomPoly, GravMassMode, InertiaMode, InteractionCallback, InteractionFilter, InteractionGroup, InteractionListener, InteractionType, Interactor, LineJoint, Listener, ListenerType, MarchingSquares, MassMode, Mat23, MatMN, Material, MotorJoint, NapeList, OptionType, PivotJoint, Polygon, PreCallback, PreFlag, PreListener, PulleyJoint, Ray, RayResult, Shape, ShapeType, Space, VERSION, ValidationResult, Vec2, Vec3, WeldJoint, Winding, getNape };