diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-03-29 17:21:49 +0200 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-03-29 17:21:49 +0200 |
| commit | a733f97028f5cd532212572f9561ab64e09f002b (patch) | |
| tree | 7b776c21660f1069ad472dd17e7e6fa9083cbd8f /src/dynamics/integration_parameters.rs | |
| parent | 8173e7ada2e3f5c99de53b532adc085a26c1cefd (diff) | |
| download | rapier-a733f97028f5cd532212572f9561ab64e09f002b.tar.gz rapier-a733f97028f5cd532212572f9561ab64e09f002b.tar.bz2 rapier-a733f97028f5cd532212572f9561ab64e09f002b.zip | |
Implement the ability to run multiple CCD substeps.
Diffstat (limited to 'src/dynamics/integration_parameters.rs')
| -rw-r--r-- | src/dynamics/integration_parameters.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dynamics/integration_parameters.rs b/src/dynamics/integration_parameters.rs index 136e345..615bfee 100644 --- a/src/dynamics/integration_parameters.rs +++ b/src/dynamics/integration_parameters.rs @@ -6,6 +6,17 @@ use crate::math::Real; pub struct IntegrationParameters { /// The timestep length (default: `1.0 / 60.0`) pub dt: Real, + /// Minimum timestep size when using CCD with multiple substeps (default `1.0 / 60.0 / 100.0`) + /// + /// When CCD with multiple substeps is enabled, the timestep is subdivided + /// into smaller pieces. This timestep subdivision won't generate timestep + /// lengths smaller than `min_dt`. + /// + /// Setting this to a large value will reduce the opportunity to performing + /// CCD substepping, resulting in potentially more time dropped by the + /// motion-clamping mechanism. Setting this to an very small value may lead + /// to numerical instabilities. + pub min_ccd_dt: Real, // /// If `true` and if rapier is compiled with the `parallel` feature, this will enable rayon-based multithreading (default: `true`). // /// @@ -195,6 +206,7 @@ impl Default for IntegrationParameters { fn default() -> Self { Self { dt: 1.0 / 60.0, + min_ccd_dt: 1.0 / 60.0 / 100.0, // multithreading_enabled: true, return_after_ccd_substep: false, erp: 0.2, |
