aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/integration_parameters.rs
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2021-03-28 11:26:53 +0200
committerCrozet Sébastien <developer@crozet.re>2021-03-28 11:27:07 +0200
commit7306821c460ca3f77e697c89a79393e61c126624 (patch)
treec8aa2a4d7d2c381706ee7edb60245bfd7bac7a07 /src/dynamics/integration_parameters.rs
parent710dd8d71ed53d2f52f15cdd19ee2f1248b62a96 (diff)
downloadrapier-7306821c460ca3f77e697c89a79393e61c126624.tar.gz
rapier-7306821c460ca3f77e697c89a79393e61c126624.tar.bz2
rapier-7306821c460ca3f77e697c89a79393e61c126624.zip
Attenuate the warmstart impulse for CCD contacts.
CCD contacts result in very strong, instantaneous, impulses. So it is preferable to attenuate their contribution to subsequent timesteps to avoid overshooting.
Diffstat (limited to 'src/dynamics/integration_parameters.rs')
-rw-r--r--src/dynamics/integration_parameters.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dynamics/integration_parameters.rs b/src/dynamics/integration_parameters.rs
index 8c0f26c..136e345 100644
--- a/src/dynamics/integration_parameters.rs
+++ b/src/dynamics/integration_parameters.rs
@@ -27,6 +27,8 @@ pub struct IntegrationParameters {
/// Each cached impulse are multiplied by this coefficient in `[0, 1]`
/// when they are re-used to initialize the solver (default `1.0`).
pub warmstart_coeff: Real,
+ /// Correction factor to avoid large warmstart impulse after a strong impact.
+ pub warmstart_correction_slope: Real,
/// 0-1: how much of the velocity to dampen out in the constraint solver?
/// (default `1.0`).
@@ -200,6 +202,7 @@ impl Default for IntegrationParameters {
velocity_solve_fraction: 1.0,
velocity_based_erp: 0.0,
warmstart_coeff: 1.0,
+ warmstart_correction_slope: 1.0,
allowed_linear_error: 0.005,
prediction_distance: 0.002,
allowed_angular_error: 0.001,