diff options
| author | Jan Hohenheim <jan@hohenheim.ch> | 2023-02-04 21:41:50 +0100 |
|---|---|---|
| committer | Jan Hohenheim <jan@hohenheim.ch> | 2023-02-04 21:41:50 +0100 |
| commit | 7e1fb6f8770ee41a2f5a66ee2c8b15e61ddac6a4 (patch) | |
| tree | 3f5fdd1e6609cf22ff473b74b9a0dcfda8bb7512 /src/control | |
| parent | e69f7534d7e80a4158b63783f531576404e06c1b (diff) | |
| download | rapier-7e1fb6f8770ee41a2f5a66ee2c8b15e61ddac6a4.tar.gz rapier-7e1fb6f8770ee41a2f5a66ee2c8b15e61ddac6a4.tar.bz2 rapier-7e1fb6f8770ee41a2f5a66ee2c8b15e61ddac6a4.zip | |
Fix snap to ground being triggered on exactly perpendicular movement
Diffstat (limited to 'src/control')
| -rw-r--r-- | src/control/character_controller.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs index b6d2dcc..7b60e82 100644 --- a/src/control/character_controller.rs +++ b/src/control/character_controller.rs @@ -324,7 +324,7 @@ impl KinematicCharacterController { result: &mut EffectiveCharacterMovement, ) -> Option<(ColliderHandle, TOI)> { if let Some(snap_distance) = self.snap_to_ground { - if result.translation.dot(&self.up) < 1.0e-5 { + if result.translation.dot(&self.up) < -1.0e-5 { let snap_distance = snap_distance.eval(dims.y); let offset = self.offset.eval(dims.y); if let Some((hit_handle, hit)) = queries.cast_shape( |
