aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/player_fire.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 21:29:37 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 21:29:37 +0300
commit2259ef230be7940a2bd64846e5d3001fa14a772c (patch)
treecb4e6b7f0e0c81613f33b73dd824aeb63ad5b808 /apps/fparkan-game/src/player_fire.rs
parentd8166352578d9305f15c9fb1ea9d686f4640d970 (diff)
downloadfparkan-2259ef230be7940a2bd64846e5d3001fa14a772c.tar.xz
fparkan-2259ef230be7940a2bd64846e5d3001fa14a772c.zip
fix(combat): keep shots aligned with the sights during free look
Preserve the turret aim before applying cockpit look offsets. On a stock Firing Range start the view turns under Shift while the cannon keeps the same projectile heading. The Constructor camera regression checks the same separation with a pitched turret. Control and Ngi32 confirm the CPT direction transform. The original choice of world matrix for the barrel remains open.
Diffstat (limited to 'apps/fparkan-game/src/player_fire.rs')
-rw-r--r--apps/fparkan-game/src/player_fire.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/fparkan-game/src/player_fire.rs b/apps/fparkan-game/src/player_fire.rs
index b1be6551..719c6d3b 100644
--- a/apps/fparkan-game/src/player_fire.rs
+++ b/apps/fparkan-game/src/player_fire.rs
@@ -73,9 +73,10 @@ impl StaticVulkanApp {
orientation_radians: state.orientation.map(f32::from_bits),
};
let scale = state.scale.map(f32::from_bits);
- // shortcut: the camera supplies a shared aim direction until native
- // per-weapon CPT direction and turret alignment agree in world space.
- let direction = self.view_camera.forward;
+ // shortcut: use the turret sights until the native barrel matrix is resolved.
+ let Some(direction) = self.player_aim_direction else {
+ return;
+ };
for (slot, barrel) in shots {
let weapon = &weapons.weapons()[slot];
let hierarchy = self