aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/manual_flight.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src/manual_flight.rs')
-rw-r--r--crates/fparkan-runtime/src/manual_flight.rs9
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,