aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Nils Ferner <contact@jnferner.com>2023-01-26 20:41:48 +0100
committerJan Nils Ferner <contact@jnferner.com>2023-01-26 20:41:48 +0100
commit4fcbd53bfe7c1d624e939a72fa25b44ebf67eb98 (patch)
tree9486476bd192daf7d319f2f72c95ac94554eddf7 /src
parentecd57a651905c54c2bddb8dcb64770da089e9ba5 (diff)
downloadrapier-4fcbd53bfe7c1d624e939a72fa25b44ebf67eb98.tar.gz
rapier-4fcbd53bfe7c1d624e939a72fa25b44ebf67eb98.tar.bz2
rapier-4fcbd53bfe7c1d624e939a72fa25b44ebf67eb98.zip
Refactor variable
Diffstat (limited to 'src')
-rw-r--r--src/control/character_controller.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/control/character_controller.rs b/src/control/character_controller.rs
index fe355a4..19943f6 100644
--- a/src/control/character_controller.rs
+++ b/src/control/character_controller.rs
@@ -736,5 +736,6 @@ impl KinematicCharacterController {
}
fn subtract_hit(translation: Vector<Real>, hit: &TOI, offset: Real) -> Vector<Real> {
- translation - *hit.normal1 * ((translation).dot(&hit.normal1) * (1.0 + offset)).min(0.0)
+ let hit_normal = (translation.dot(&hit.normal1) * (1.0 + offset)).min(0.0);
+ translation - *hit.normal1 * hit_normal
}