aboutsummaryrefslogtreecommitdiff
path: root/src/control
diff options
context:
space:
mode:
Diffstat (limited to 'src/control')
-rw-r--r--src/control/character_controller.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs
index 1211d2b..438eab1 100644
--- a/src/control/character_controller.rs
+++ b/src/control/character_controller.rs
@@ -428,6 +428,10 @@ impl KinematicCharacterController {
manifold_center += contact_point.coords;
*translation_remaining += normal
* (normal_target_mvt - normal_current_mvt);
+
+ if normal.dot(&self.up) <= 1.0e-5 {
+ grounded = true;
+ }
}
}