diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 20:10:24 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 20:10:24 +0300 |
| commit | 75dcc70912d4e6feb14d9370452914ff826849f7 (patch) | |
| tree | 06c5577b02e92daff7deb4c1cd544ebd210323ed /apps/fparkan-game/src/main.rs | |
| parent | 07a90f035ebd935ad9705a5f8a8916638a4a8f4f (diff) | |
| download | fparkan-75dcc70912d4e6feb14d9370452914ff826849f7.tar.xz fparkan-75dcc70912d4e6feb14d9370452914ff826849f7.zip | |
fix(input): use the original hero turret elevation range
Apply the World3D mouse Y filter and reverse setting, update the normalized turret request, and use the authored neutral and span to share pitch with the cockpit and elevation tracks. Original World3D dispatch and Control manual mode confirmed the gain and clamp. Stock Firing Range captures show both endpoints and the licensed Constructor test checks the camera and turret together.
Diffstat (limited to 'apps/fparkan-game/src/main.rs')
| -rw-r--r-- | apps/fparkan-game/src/main.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index dfd7be88..45d076fc 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -15879,7 +15879,9 @@ mod tests { Some(frame_with_player_motion(&mut engine, 32, cockpit, aimed, false).unwrap()); app.update_mission_camera(0.016, [800.0, 600.0]).unwrap(); assert_eq!(app.view_camera.position, moved); - assert!((app.view_camera.forward[2] - 0.5_f32.sin()).abs() < 1e-6); + let pitch = f32::from_bits(app.mission_frame.as_ref().unwrap().player_pitch_bits); + assert!((pitch.abs().to_degrees() - 18.81).abs() < 1e-4); + assert!((app.view_camera.forward[2] - pitch.sin()).abs() < 1e-6); let mut instances = vec![Vec::new(); cockpit.object_index + 1]; instances[cockpit.object_index].resize_with(cockpit.component_index + 1, || None); @@ -15934,14 +15936,11 @@ mod tests { &mut instances, &mut app.component_pose_buffers, 32, - Some(( - cockpit, - f32::from_bits(app.mission_frame.as_ref().unwrap().player_pitch_bits), - )), + Some((cockpit, pitch)), ) .unwrap(); assert_ne!(turret_pose(&app, 34).rotation, target.rotation); - assert!(target_elevation(turret_pose(&app, 34)) > target_elevation(target)); + assert!((target_elevation(turret_pose(&app, 34)) - target_elevation(target)) * pitch > 0.0); assert_ne!(turret_pose(&app, 12).translation, gun.translation); assert_eq!(turret_pose(&app, 1), base); let aimed_mesh = geometry_for_turret( |
