@newkrok/nape-js 3.9.1 → 3.10.1

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.
@@ -1803,6 +1803,24 @@ declare abstract class DebugDraw {
1803
1803
  * @param colour - Optional ARGB colour hint.
1804
1804
  */
1805
1805
  drawSolidPolygon(vertices: DebugVec2[], colour?: number): void;
1806
+ /**
1807
+ * Draw a capsule outline (two semicircles connected by straight segments).
1808
+ * Used for: static/kinematic capsule shapes.
1809
+ * @param spine1 - World-space first spine endpoint.
1810
+ * @param spine2 - World-space second spine endpoint.
1811
+ * @param radius - End-cap radius.
1812
+ * @param colour - Optional ARGB colour hint.
1813
+ */
1814
+ drawCapsule(spine1: DebugVec2, spine2: DebugVec2, radius: number, colour?: number): void;
1815
+ /**
1816
+ * Draw a filled capsule.
1817
+ * Used for: dynamic capsule shapes.
1818
+ * @param spine1 - World-space first spine endpoint.
1819
+ * @param spine2 - World-space second spine endpoint.
1820
+ * @param radius - End-cap radius.
1821
+ * @param colour - Optional ARGB colour hint.
1822
+ */
1823
+ drawSolidCapsule(spine1: DebugVec2, spine2: DebugVec2, radius: number, colour?: number): void;
1806
1824
  /**
1807
1825
  * Draw a point marker.
1808
1826
  * Used for: contact points, centre-of-mass markers.
@@ -2520,6 +2538,7 @@ declare class ShapeType {
2520
2538
  constructor();
2521
2539
  static get CIRCLE(): ShapeType;
2522
2540
  static get POLYGON(): ShapeType;
2541
+ static get CAPSULE(): ShapeType;
2523
2542
  toString(): string;
2524
2543
  }
2525
2544
 
@@ -2534,6 +2553,8 @@ declare class Shape extends Interactor {
2534
2553
  isCircle(): boolean;
2535
2554
  /** Returns true if this is a Polygon shape. */
2536
2555
  isPolygon(): boolean;
2556
+ /** Returns true if this is a Capsule shape. */
2557
+ isCapsule(): boolean;
2537
2558
  /**
2538
2559
  * The Body this shape belongs to. Setting moves the shape between bodies.
2539
2560
  */
@@ -2543,6 +2564,8 @@ declare class Shape extends Interactor {
2543
2564
  get castCircle(): Shape | null;
2544
2565
  /** Cast to Polygon, or null if this is not a polygon. */
2545
2566
  get castPolygon(): Shape | null;
2567
+ /** Cast to Capsule, or null if this is not a capsule. */
2568
+ get castCapsule(): Shape | null;
2546
2569
  /** World-space centre of mass of this shape (read-only, lazy-computed). */
2547
2570
  get worldCOM(): Vec2;
2548
2571
  /**
@@ -1803,6 +1803,24 @@ declare abstract class DebugDraw {
1803
1803
  * @param colour - Optional ARGB colour hint.
1804
1804
  */
1805
1805
  drawSolidPolygon(vertices: DebugVec2[], colour?: number): void;
1806
+ /**
1807
+ * Draw a capsule outline (two semicircles connected by straight segments).
1808
+ * Used for: static/kinematic capsule shapes.
1809
+ * @param spine1 - World-space first spine endpoint.
1810
+ * @param spine2 - World-space second spine endpoint.
1811
+ * @param radius - End-cap radius.
1812
+ * @param colour - Optional ARGB colour hint.
1813
+ */
1814
+ drawCapsule(spine1: DebugVec2, spine2: DebugVec2, radius: number, colour?: number): void;
1815
+ /**
1816
+ * Draw a filled capsule.
1817
+ * Used for: dynamic capsule shapes.
1818
+ * @param spine1 - World-space first spine endpoint.
1819
+ * @param spine2 - World-space second spine endpoint.
1820
+ * @param radius - End-cap radius.
1821
+ * @param colour - Optional ARGB colour hint.
1822
+ */
1823
+ drawSolidCapsule(spine1: DebugVec2, spine2: DebugVec2, radius: number, colour?: number): void;
1806
1824
  /**
1807
1825
  * Draw a point marker.
1808
1826
  * Used for: contact points, centre-of-mass markers.
@@ -2520,6 +2538,7 @@ declare class ShapeType {
2520
2538
  constructor();
2521
2539
  static get CIRCLE(): ShapeType;
2522
2540
  static get POLYGON(): ShapeType;
2541
+ static get CAPSULE(): ShapeType;
2523
2542
  toString(): string;
2524
2543
  }
2525
2544
 
@@ -2534,6 +2553,8 @@ declare class Shape extends Interactor {
2534
2553
  isCircle(): boolean;
2535
2554
  /** Returns true if this is a Polygon shape. */
2536
2555
  isPolygon(): boolean;
2556
+ /** Returns true if this is a Capsule shape. */
2557
+ isCapsule(): boolean;
2537
2558
  /**
2538
2559
  * The Body this shape belongs to. Setting moves the shape between bodies.
2539
2560
  */
@@ -2543,6 +2564,8 @@ declare class Shape extends Interactor {
2543
2564
  get castCircle(): Shape | null;
2544
2565
  /** Cast to Polygon, or null if this is not a polygon. */
2545
2566
  get castPolygon(): Shape | null;
2567
+ /** Cast to Capsule, or null if this is not a capsule. */
2568
+ get castCapsule(): Shape | null;
2546
2569
  /** World-space centre of mass of this shape (read-only, lazy-computed). */
2547
2570
  get worldCOM(): Vec2;
2548
2571
  /**