From 8153f1d085c17a633bda68acb4cc01bbbc279615 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 13:10:05 +0400 Subject: fix(player): walk through cut terrain into factory basements Use the same BAS cut surfaces for the walking sweep and the scene. The hero can descend along the building mesh and recover ground support on the way back. The stock Constructor route passes in both directions, the Firing Range bridge retains clearance, and the walk replay completes in the Vulkan window. --- crates/fparkan-runtime/src/player_motion.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crates/fparkan-runtime/src') diff --git a/crates/fparkan-runtime/src/player_motion.rs b/crates/fparkan-runtime/src/player_motion.rs index 881b4b5f..19ce9718 100644 --- a/crates/fparkan-runtime/src/player_motion.rs +++ b/crates/fparkan-runtime/src/player_motion.rs @@ -50,6 +50,20 @@ pub struct PlayerMotionStep { } impl PlayerMotionStep { + /// Uses the scene's terrain after foundation cuts and fills. + #[must_use] + pub fn with_scene_terrain(mut self, previous: Option, next: Option) -> Self { + self.previous_terrain_height = previous; + self.terrain_height = next; + if let Some([from, to]) = self.sweep.as_mut() { + to[2] = previous + .zip(next) + .map_or(from[2], |(previous, next)| next + (from[2] - previous)); + self.pose.position[2] = (to[2] - 0.5).to_bits(); + } + self + } + /// Vertical segment for finding a nearby building floor at the proposed XY. #[must_use] pub fn floor_probe(self) -> Option<[[f32; 3]; 2]> { -- cgit v1.2.3