From 3ce719abee28552356408b88162ea38b578e052a Mon Sep 17 00:00:00 2001 From: vtroc7 Date: Sun, 11 Oct 2026 13:41:32 +0300 Subject: [PATCH] Keep snapped movement tangent to the landing surface --- crates/movement_iw4/src/contact_solver.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/movement_iw4/src/contact_solver.rs b/crates/movement_iw4/src/contact_solver.rs index 31379de..cc5da93 100644 --- a/crates/movement_iw4/src/contact_solver.rs +++ b/crates/movement_iw4/src/contact_solver.rs @@ -304,9 +304,11 @@ fn land( if n[2] <= 0. || !(hit.walkable || n[2] >= threshold) { return None; } + let mut velocity = m.velocity; + project_ground(&mut velocity, &hit.normal); Some(Motion { origin: p, - velocity: project(m.velocity, &[hit.normal]), + velocity: project(velocity, &[hit.normal]), }) } pub(crate) fn traverse(