diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-03 16:57:40 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-03 16:57:40 +0300 |
| commit | ca66e64b3995229ca7c8771b75ca26a60c3e344f (patch) | |
| tree | afd011b8db83dc5a7e3d0585631eae8135aefc94 /crates/fparkan-runtime/src/manual_flight.rs | |
| parent | e8978cf0a7f66fd36a3f47c5a616fbfd3a9d20b0 (diff) | |
| download | fparkan-ca66e64b3995229ca7c8771b75ca26a60c3e344f.tar.xz fparkan-ca66e64b3995229ca7c8771b75ca26a60c3e344f.zip | |
feat(ui): show cockpit speed and Control limit
Diffstat (limited to 'crates/fparkan-runtime/src/manual_flight.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/manual_flight.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/manual_flight.rs b/crates/fparkan-runtime/src/manual_flight.rs index cac50b41..f4f2a118 100644 --- a/crates/fparkan-runtime/src/manual_flight.rs +++ b/crates/fparkan-runtime/src/manual_flight.rs @@ -252,6 +252,12 @@ mod tests { .unwrap() .unwrap(); assert_eq!(vehicle.handle, helicopter); + let reading = |engine: &Engine| { + crate::cockpit_speedometer::cockpit_speedometer(engine, vehicle) + .unwrap() + .speed + }; + assert_eq!(reading(&engine), 0); let [x, y, z] = position(&engine, vehicle); let step = plan_player_motion(&engine, vehicle, up).unwrap().unwrap(); assert!(step.sweep.is_some()); @@ -260,6 +266,7 @@ mod tests { let [_, _, climb_z] = position(&engine, vehicle); assert!((8.0..16.0).contains(&(climb_z - z))); assert_eq!(position(&engine, hero), [x, y, climb_z]); + assert!(reading(&engine) > 0); let coast = PlayerMotion { delta_seconds: 1.0, @@ -274,6 +281,7 @@ mod tests { assert!(plan_player_motion(&engine, vehicle, coast) .unwrap() .is_none()); + assert_eq!(reading(&engine), 0); let forward = PlayerMotion { climb: 0.0, @@ -288,6 +296,7 @@ mod tests { let [fx, fy, fz] = position(&engine, vehicle); assert!(((fx - x).hypot(fy - y) - 1.25).abs() < 0.0001); assert_eq!(fz, hover_z); + assert_eq!(reading(&engine), 36); let down = PlayerMotion { climb: -1.0, |
