diff options
| author | Jan Hohenheim <jan@hohenheim.ch> | 2023-02-04 20:11:04 +0100 |
|---|---|---|
| committer | Jan Hohenheim <jan@hohenheim.ch> | 2023-02-04 20:11:04 +0100 |
| commit | 52910c9c59f91bd2c37d0608e3cd7269edef1da2 (patch) | |
| tree | ab862f2c97dca41169e8712cc0af491b6a4875b2 /src/control | |
| parent | 7a2759c52feae6379da51fbf44584ea2c0b76c0c (diff) | |
| download | rapier-52910c9c59f91bd2c37d0608e3cd7269edef1da2.tar.gz rapier-52910c9c59f91bd2c37d0608e3cd7269edef1da2.tar.bz2 rapier-52910c9c59f91bd2c37d0608e3cd7269edef1da2.zip | |
Optimistically add normalization
Diffstat (limited to 'src/control')
| -rw-r--r-- | src/control/character_controller.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs index 5467a4a..e72e5b3 100644 --- a/src/control/character_controller.rs +++ b/src/control/character_controller.rs @@ -403,7 +403,7 @@ impl KinematicCharacterController { .filter(|rb| rb.is_kinematic()); for m in &manifolds { - let normal = -(character_pos * m.local_n1); + let normal = -(character_pos * m.local_n1).normalize(); if normal.dot(&self.up) >= -1.0e-5 { grounded = true; } @@ -450,7 +450,7 @@ impl KinematicCharacterController { *kinematic_friction_translation - init_kinematic_friction_translation; } else { for m in &manifolds { - let normal = character_pos * m.local_n1; + let normal = (character_pos * m.local_n1).normalize(); if normal.dot(&self.up) <= 1.0e-5 { for contact in &m.points { |
