aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/integration_parameters.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-03-19 16:10:49 +0100
committerSébastien Crozet <sebastien@crozet.re>2022-03-20 21:49:16 +0100
commitdb6a8c526d939a125485c89cfb6e540422fe6b4b (patch)
tree32738172c6bd27e07ed9a4b8f90f5fbbfc07fd5e /src/dynamics/integration_parameters.rs
parente2e6fc787112ab35a3d4858aa2cf83fcf41c16a2 (diff)
downloadrapier-db6a8c526d939a125485c89cfb6e540422fe6b4b.tar.gz
rapier-db6a8c526d939a125485c89cfb6e540422fe6b4b.tar.bz2
rapier-db6a8c526d939a125485c89cfb6e540422fe6b4b.zip
Fix warnings and add comments.
Diffstat (limited to 'src/dynamics/integration_parameters.rs')
-rw-r--r--src/dynamics/integration_parameters.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dynamics/integration_parameters.rs b/src/dynamics/integration_parameters.rs
index e66f72d..84c8117 100644
--- a/src/dynamics/integration_parameters.rs
+++ b/src/dynamics/integration_parameters.rs
@@ -20,10 +20,7 @@ pub struct IntegrationParameters {
/// 0-1: multiplier for how much of the constraint violation (e.g. contact penetration)
/// will be compensated for during the velocity solve.
- /// If zero, you need to enable the positional solver.
- /// If non-zero, you do not need the positional solver.
- /// A good non-zero value is around `0.2`.
- /// (default `0.0`).
+ /// (default `0.8`).
pub erp: Real,
/// 0-1: the damping ratio used by the springs for Baumgarte constraints stabilization.
/// Lower values make the constraints more compliant (more "springy", allowing more visible penetrations
@@ -31,7 +28,13 @@ pub struct IntegrationParameters {
/// (default `0.25`).
pub damping_ratio: Real,
+ /// 0-1: multiplier for how much of the joint violation
+ /// will be compensated for during the velocity solve.
+ /// (default `1.0`).
pub joint_erp: Real,
+
+ /// The fraction of critical damping applied to the joint for constraints regularization.
+ /// (default `0.25`).
pub joint_damping_ratio: Real,
/// Amount of penetration the engine wont attempt to correct (default: `0.001m`).
@@ -131,6 +134,7 @@ impl IntegrationParameters {
1.0 / (1.0 + cfm_coeff)
}
+ /// The CFM (constranits force mixing) coefficient applied to all joints for constraints regularization
pub fn joint_cfm_coeff(&self) -> Real {
// Compute CFM assuming a critically damped spring multiplied by the damping ratio.
let inv_erp_minus_one = 1.0 / self.joint_erp - 1.0;