From 1d2de93b9e7ab86df937bee6359ecce72b2d30fb Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 6 Nov 2023 19:09:54 -0800 Subject: [PATCH] normalize normal --- src/physics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics.rs b/src/physics.rs index 576a0ed..26dd961 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1064,7 +1064,7 @@ impl PhysicsState { JumpDirection::FromContactNormal=>self.models.mesh(walk_state.contact.model_id).face_nd(walk_state.contact.face_id).0, &JumpDirection::Exactly(dir)=>dir, }; - let mut v=self.body.velocity+n*self.style.get_jump_deltav(); + let mut v=self.body.velocity+n*(self.style.get_jump_deltav()/n.length()); self.touching.constrain_velocity(&self.models,&mut v); self.body.velocity=v; let moving_away=Planar64::ZERO