From 176aaa069c73798d46d9b6aafe6229e0bb656add Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 7 Nov 2023 20:22:33 -0800 Subject: [PATCH] fix walk friction --- src/physics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics.rs b/src/physics.rs index 130635b..1c1b667 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1108,7 +1108,7 @@ impl PhysicsState { let mut a; let mut v=self.style.get_walk_target_velocity(&self.camera,self.controls,&self.next_mouse,self.time); self.touching.constrain_velocity(&self.models,&mut v); - let normal_accel=-n.dot(gravity); + let normal_accel=-n.dot(gravity)/n.length(); (*state,a)=WalkEnum::with_target_velocity(&self.body,&self.style,v,&n,self.style.walk_speed,normal_accel); self.touching.constrain_acceleration(&self.models,&mut a); Some(a)