Skip to content

Commit

Permalink
update(systems): wasm adjust animation for steering
Browse files Browse the repository at this point in the history
  • Loading branch information
Revyn112 committed Nov 29, 2023
1 parent 6577ff5 commit 9e81eef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ max_castering_angle = 1.309 ; Defines the maximum angle a free castering wheel c
;15 Airspeed above which gear is damaged, in kias.
;16 The exponential constant for springs
; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
point.0= 1, 53.232288, 0, -14.5, 1281.1, 0, 1.4, 75, 1.0, 1.15, 0.85, 10, 12, 0, 0, 0, 2
point.0= 1, 53.232288, 0, -14.5, 1281.1, 0, 1.4, 95, 1.0, 1.15, 0.85, 10, 12, 0, 0, 0, 2
point.1= 1, -33, -17.851249, -16.89, 1574.8, 1, 2.5, 0, 1.4, 2.1, 0.86, 17, 17, 2, 0, 0, 2
point.2= 1, -33, 17.851249, -16.89, 1574.8, 2, 2.5, 0, 1.4, 2.1, 0.86, 17, 17, 3, 0, 0, 2
point.3= 2, 76.214219, 0.000001, 0.800021, 787.4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ fn recenter_when_close_to_center(value: f64, increment: f64) -> f64 {
}
}

const MAX_CONTROLLABLE_STEERING_ANGLE_DEGREES: f64 = 70.;
const MAX_CONTROLLABLE_STEERING_ANGLE_DEGREES: f64 = 75.;

fn steering_animation_to_msfs_from_steering_angle(nose_wheel_position: f64) -> f64 {
const STEERING_ANIMATION_TOTAL_RANGE_DEGREES: f64 = 140.;
const STEERING_ANIMATION_TOTAL_RANGE_DEGREES: f64 = 360.;

((nose_wheel_position * MAX_CONTROLLABLE_STEERING_ANGLE_DEGREES
/ (STEERING_ANIMATION_TOTAL_RANGE_DEGREES / 2.))
Expand All @@ -168,7 +168,7 @@ fn steering_demand_to_msfs_from_steering_angle(
nose_wheel_position: f64,
rudder_position: f64,
) -> f64 {
const MAX_MSFS_STEERING_ANGLE_DEGREES: f64 = 75.;
const MAX_MSFS_STEERING_ANGLE_DEGREES: f64 = 90.;

// Steering in msfs is the max we want rescaled to the max in msfs
let steering_ratio_converted = nose_wheel_position * MAX_CONTROLLABLE_STEERING_ANGLE_DEGREES
Expand Down

0 comments on commit 9e81eef

Please sign in to comment.