From 78a63745f471c028c0ed67f133de9034e901c905 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 21:21:49 +0400 Subject: feat(camera): free look with left Shift from the cockpit Route shifted mouse samples to the independent Control camera phases, apply yaw then pitch at the existing cockpit point, and recenter on Shift release or right click. Original World3D dispatch and Control camera calls verified wrapping, clamping, recentering, and the transform. A stock Firing Range window showed the view move and return with hull yaw and turret pitch unchanged. --- crates/fparkan-runtime/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/fparkan-runtime/src/lib.rs') diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index f62c0784..3aa78bbe 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -1408,6 +1408,8 @@ pub struct FrameResult { pub clan_notices: Vec, /// Vertical aim of the controlled hero as an IEEE-754 radian value. pub player_pitch_bits: u32, + /// View-only yaw and pitch relative to the sights, encoded as radians. + pub player_view_offset_bits: [u32; 2], /// Footstep from the accepted player motion, if this tick reached a footfall. pub player_footstep: Option, /// Autonomous combat events during the step. @@ -2990,6 +2992,9 @@ pub fn step_headless( .loaded .as_ref() .map_or(0, |mission| mission.player_pitch_bits), + player_view_offset_bits: engine.loaded.as_ref().map_or([0; 2], |mission| { + mission.hero_look.camera_offset().map(f32::to_bits) + }), }) } @@ -3045,6 +3050,7 @@ pub fn frame_with_player_motion( motion, blocked || drowned || landing.is_some(), ); + frame.player_view_offset_bits = mission.hero_look.camera_offset().map(f32::to_bits); if !blocked && !drowned && landing.is_none() @@ -17987,6 +17993,7 @@ mod tests { mouse_x: 100.0, mouse_y: -500.0, delta_seconds: 0.1, + ..Default::default() }; let proposed = plan_player_motion(&engine, cockpit, input) .unwrap() -- cgit v1.2.3