diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 13:00:09 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 13:00:09 +0300 |
| commit | 514136ca97191672ecd24173d1836cdc4d26493b (patch) | |
| tree | 2f7f21d8d7e6182ec283636e6c1d9a340fba62eb /apps/fparkan-game/src/main.rs | |
| parent | 5ad056292d91bd6a38299c5d890a975a435c8422 (diff) | |
| download | fparkan-514136ca97191672ecd24173d1836cdc4d26493b.tar.xz fparkan-514136ca97191672ecd24173d1836cdc4d26493b.zip | |
feat(player): bob the cockpit view when walking
Use the 0.45 second vertical cycle observed in the GOG hero camera. The stock Firing Range window shows lift on an accepted walk and settles on release. The body and muzzle still use their own poses.
Diffstat (limited to 'apps/fparkan-game/src/main.rs')
| -rw-r--r-- | apps/fparkan-game/src/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index cbd81e22..f06b5d05 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -10523,9 +10523,13 @@ impl StaticVulkanApp { let pose = mount.map_or(pose, |mount| compose_unit_pose(mount, pose)); let offset = rotate_unit_vector(cockpit.node_point, pose.rotation); let point = std::array::from_fn(|axis| pose.translation[axis] + offset[axis]); + let mut translation = state.position.map(f32::from_bits); + if let Some(engine) = &self.mission_engine { + translation[2] += fparkan_runtime::player_walk_camera_lift(engine, cockpit); + } let camera = fparkan_render::forward_cockpit_camera( LegacyIron3dEulerTransform { - translation: state.position.map(f32::from_bits), + translation, orientation_radians: state.orientation.map(f32::from_bits), }, state.scale.map(f32::from_bits), |
