diff options
| author | Jan Nils Ferner <contact@jnferner.com> | 2023-01-28 00:03:50 +0100 |
|---|---|---|
| committer | Jan Nils Ferner <contact@jnferner.com> | 2023-01-28 00:03:50 +0100 |
| commit | 9daa741af2d2efa0358db5ce94a4879e7e437b84 (patch) | |
| tree | 69d9e78e7151b85e7129296eab6327898f60d41b /src | |
| parent | 337a963ce39a05f3a20b7e94ac834a2e40ea0885 (diff) | |
| download | rapier-9daa741af2d2efa0358db5ce94a4879e7e437b84.tar.gz rapier-9daa741af2d2efa0358db5ce94a4879e7e437b84.tar.bz2 rapier-9daa741af2d2efa0358db5ce94a4879e7e437b84.zip | |
Fix missing ground assignment
Diffstat (limited to 'src')
| -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; |
