diff options
| author | Thierry Berger <contact@thierryberger.com> | 2024-06-17 16:51:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-17 16:51:06 +0200 |
| commit | 84b66d63e39cb6182974b8f674684748c7c4d594 (patch) | |
| tree | 57f98aa79ab78f2b565c070d5361a8bd9e0df682 /src | |
| parent | 5c6d34aa09254574dffbd7c95f1ab01a99ec2e53 (diff) | |
| download | rapier-84b66d63e39cb6182974b8f674684748c7c4d594.tar.gz rapier-84b66d63e39cb6182974b8f674684748c7c4d594.tar.bz2 rapier-84b66d63e39cb6182974b8f674684748c7c4d594.zip | |
fix: character controller: walls less likely to trigger ground detection (#655)
Diffstat (limited to 'src')
| -rw-r--r-- | src/control/character_controller.rs | 4 |
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 { |
