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, 3 insertions, 1 deletions
diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs
index dc7381f..2332bc3 100644
--- a/src/control/character_controller.rs
+++ b/src/control/character_controller.rs
@@ -519,7 +519,9 @@ impl KinematicCharacterController {
) -> bool {
let normal = -(character_pos * manifold.local_n1);
- if normal.dot(&self.up) >= 1.0e-5 {
+ // For the controller to be grounded, the angle between the contact normal and the up vector
+ // has to be smaller than acos(1.0e-3) = 89.94 degrees.
+ if normal.dot(&self.up) >= 1.0e-3 {
let prediction = self.predict_ground(dims.y);
for contact in &manifold.points {
if contact.dist <= prediction {