aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Nils Ferner <contact@jnferner.com>2023-01-27 14:10:14 +0100
committerJan Nils Ferner <contact@jnferner.com>2023-01-27 14:10:14 +0100
commiteaa3d8e259925903584780f11cbfe7dcc297ac5b (patch)
treecc198744f70e934f8824095cef2f3a1d68b28e81
parent942cf76150c410048c13b29f1ca084896cf57f0f (diff)
downloadrapier-eaa3d8e259925903584780f11cbfe7dcc297ac5b.tar.gz
rapier-eaa3d8e259925903584780f11cbfe7dcc297ac5b.tar.bz2
rapier-eaa3d8e259925903584780f11cbfe7dcc297ac5b.zip
Remove unnecessary clamp
-rw-r--r--src/control/character_controller.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs
index 39fa9b0..1b5a792 100644
--- a/src/control/character_controller.rs
+++ b/src/control/character_controller.rs
@@ -738,6 +738,6 @@ impl KinematicCharacterController {
}
fn subtract_hit(translation: Vector<Real>, hit: &TOI, offset: Real) -> Vector<Real> {
- let hit_normal = (translation.dot(&hit.normal1) * (1.0 + offset)).min(0.0);
- translation - *hit.normal1 * hit_normal
+ let surface_correction = translation.dot(&hit.normal1) * (1.0 + offset);
+ translation - *hit.normal1 * surface_correction
}