From 39998e96e8f887afdf79c02c7873d7c70bf1530c Mon Sep 17 00:00:00 2001 From: Jan Hohenheim Date: Sat, 4 Feb 2023 20:27:27 +0100 Subject: Fix grounded false positives when normal is [0, 0] --- src/control/character_controller.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/control') diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs index 5467a4a..49373d1 100644 --- a/src/control/character_controller.rs +++ b/src/control/character_controller.rs @@ -404,7 +404,7 @@ impl KinematicCharacterController { for m in &manifolds { let normal = -(character_pos * m.local_n1); - if normal.dot(&self.up) >= -1.0e-5 { + if normal.dot(&self.up) >= 1.0e-5 { grounded = true; } -- cgit