diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
| commit | 1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4 (patch) | |
| tree | 9ef8276c399e238a2a692862de09f54bf5dcee65 /apps/fparkan-game/src/player_fire.rs | |
| parent | 077bead07a76908ac4e0e2b84de3940256cf6fd1 (diff) | |
| download | fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.tar.xz fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.zip | |
feat(ui): enable manual control from the bunker list
Use the active Control camera record and its separate CPT origin and direction for the fixed turret. The original hand control opens the cockpit, its two weapon slots and aim tracks while leaving the operator at the command post.
Verified from the stock Two Fortresses start against the GOG cockpit with Vulkan validation. The licensed tests cover the native camera pose, mounted weapon selection and stationary bunker and operator.
Diffstat (limited to 'apps/fparkan-game/src/player_fire.rs')
| -rw-r--r-- | apps/fparkan-game/src/player_fire.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/fparkan-game/src/player_fire.rs b/apps/fparkan-game/src/player_fire.rs index 96123e2d..5473f3a6 100644 --- a/apps/fparkan-game/src/player_fire.rs +++ b/apps/fparkan-game/src/player_fire.rs @@ -147,6 +147,10 @@ impl StaticVulkanApp { let vector = orientation.try_transform_scaled_point(vector, scale)?; projectile_sight_target(engine, cockpit.handle, origin, vector) })(); + let fixed_turret = self + .mission_engine + .as_ref() + .is_some_and(|engine| fparkan_runtime::bunker_control::aim(engine, cockpit).is_some()); let mut firing_effects = Vec::new(); for (slot, barrel) in shots { let weapon = &weapons.weapons()[slot]; @@ -156,7 +160,7 @@ impl StaticVulkanApp { rotate_unit_vector(barrel.position, pose.rotation), ); let muzzle = transform.try_transform_scaled_point(point, scale)?; - let direction = if weapon.has_deployment_tracks() { + let direction = if fixed_turret || weapon.has_deployment_tracks() { let axis = rotate_unit_vector(barrel.direction, pose.rotation); orientation.try_transform_scaled_point(axis, scale)? } else { |
