Add params.velocity_based_erp_inv_dt() helper
This commit is contained in:
@@ -64,6 +64,8 @@ impl VelocityGroundConstraint {
|
||||
push: bool,
|
||||
) {
|
||||
let inv_dt = params.inv_dt();
|
||||
let velocity_based_erp_inv_dt = params.velocity_based_erp_inv_dt();
|
||||
|
||||
let mut rb1 = &bodies[manifold.data.body_pair.body1];
|
||||
let mut rb2 = &bodies[manifold.data.body_pair.body2];
|
||||
let flipped = manifold.data.relative_dominance < 0;
|
||||
@@ -162,10 +164,7 @@ impl VelocityGroundConstraint {
|
||||
* (vel1 - vel2).dot(&force_dir1);
|
||||
rhs += manifold_point.dist.max(0.0) * inv_dt;
|
||||
rhs *= params.velocity_solve_fraction;
|
||||
rhs += is_resting
|
||||
* params.velocity_based_erp
|
||||
* inv_dt
|
||||
* manifold_point.dist.min(0.0);
|
||||
rhs += is_resting * velocity_based_erp_inv_dt * manifold_point.dist.min(0.0);
|
||||
|
||||
constraint.elements[k].normal_part = VelocityGroundConstraintElementPart {
|
||||
gcross2,
|
||||
|
||||
Reference in New Issue
Block a user