Always apply the predictive contact term, even for bouncing contacts
This commit is contained in:
@@ -239,11 +239,10 @@ impl VelocityConstraint {
|
||||
+ gcross1.gdot(gcross1)
|
||||
+ gcross2.gdot(gcross2));
|
||||
|
||||
let rhs = if manifold_point.is_bouncy() {
|
||||
(1.0 + manifold_point.restitution) * (vel1 - vel2).dot(&force_dir1)
|
||||
} else {
|
||||
(vel1 - vel2).dot(&force_dir1) + manifold_point.dist.max(0.0) * inv_dt
|
||||
};
|
||||
let is_bouncy = manifold_point.is_bouncy() as u32 as Real;
|
||||
let rhs = (1.0 + is_bouncy * manifold_point.restitution)
|
||||
* (vel1 - vel2).dot(&force_dir1)
|
||||
+ manifold_point.dist.max(0.0) * inv_dt;
|
||||
|
||||
let impulse = manifold_point.data.impulse * warmstart_coeff;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user