diff options
| -rw-r--r-- | src/control/character_controller.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs index defa48f..2649193 100644 --- a/src/control/character_controller.rs +++ b/src/control/character_controller.rs @@ -410,6 +410,9 @@ impl KinematicCharacterController { for m in &manifolds { let normal = -(character_pos * m.local_n1); + if normal.dot(&self.up) >= -1e-5 { + grounded = true; + } if let Some(kinematic_parent) = kinematic_parent { let mut num_active_contacts = 0; @@ -456,7 +459,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 { for contact in &m.points { if contact.dist <= prediction { grounded = true; |
