From eaa3d8e259925903584780f11cbfe7dcc297ac5b Mon Sep 17 00:00:00 2001 From: Jan Nils Ferner Date: Fri, 27 Jan 2023 14:10:14 +0100 Subject: Remove unnecessary clamp --- src/control/character_controller.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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, hit: &TOI, offset: Real) -> Vector { - 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 } -- cgit