@newkrok/nape-js 3.16.2 → 3.17.0

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.
@@ -1866,6 +1866,25 @@ declare class Space {
1866
1866
  */
1867
1867
  get deterministic(): boolean;
1868
1868
  set deterministic(value: boolean);
1869
+ /**
1870
+ * Number of sub-steps performed per `step()` call. Each sub-step uses
1871
+ * `deltaTime / subSteps` and the same velocity/position iteration counts.
1872
+ *
1873
+ * Higher values improve simulation stability (stacking, fast objects, joint
1874
+ * stiffness) at the cost of proportionally more CPU time.
1875
+ *
1876
+ * - `1` (default) — standard single-step behaviour, zero overhead.
1877
+ * - `4` — good balance between quality and performance for most games.
1878
+ * - `8+` — high-precision, useful for stiff constraints or very fast objects.
1879
+ *
1880
+ * **Performance:** cost scales linearly — `subSteps = 4` ≈ 4× solver work.
1881
+ * Tip: you can lower `velocityIterations` to compensate (e.g. 10 iter × 1 step
1882
+ * → 3 iter × 4 sub-steps ≈ similar quality at ~1.2× cost).
1883
+ *
1884
+ * @throws If set to a value less than 1 or NaN.
1885
+ */
1886
+ get subSteps(): number;
1887
+ set subSteps(value: number);
1869
1888
  /**
1870
1889
  * Global angular drag coefficient applied to all bodies.
1871
1890
  * @throws If set to NaN.
@@ -1866,6 +1866,25 @@ declare class Space {
1866
1866
  */
1867
1867
  get deterministic(): boolean;
1868
1868
  set deterministic(value: boolean);
1869
+ /**
1870
+ * Number of sub-steps performed per `step()` call. Each sub-step uses
1871
+ * `deltaTime / subSteps` and the same velocity/position iteration counts.
1872
+ *
1873
+ * Higher values improve simulation stability (stacking, fast objects, joint
1874
+ * stiffness) at the cost of proportionally more CPU time.
1875
+ *
1876
+ * - `1` (default) — standard single-step behaviour, zero overhead.
1877
+ * - `4` — good balance between quality and performance for most games.
1878
+ * - `8+` — high-precision, useful for stiff constraints or very fast objects.
1879
+ *
1880
+ * **Performance:** cost scales linearly — `subSteps = 4` ≈ 4× solver work.
1881
+ * Tip: you can lower `velocityIterations` to compensate (e.g. 10 iter × 1 step
1882
+ * → 3 iter × 4 sub-steps ≈ similar quality at ~1.2× cost).
1883
+ *
1884
+ * @throws If set to a value less than 1 or NaN.
1885
+ */
1886
+ get subSteps(): number;
1887
+ set subSteps(value: number);
1869
1888
  /**
1870
1889
  * Global angular drag coefficient applied to all bodies.
1871
1890
  * @throws If set to NaN.