HHS81 / c182s

Cessna C182S (1996 model) for FlightGear
GNU General Public License v2.0
26 stars 9 forks source link

Parachuters: add wind effect #555

Open hbeni opened 9 months ago

hbeni commented 9 months ago

Currently parachuters fall straight down, but they should be affected by the wind.

hbeni commented 8 months ago

Just peeked at this; I already had foreseen this. https://github.com/HHS81/c182s/blob/4a42a1a96c7838f77f435cce262dd14bf5d29d47/Nasal/mp-parachuters.nas#L123-L125

Currently the whole drop down phase is done as two interpolations (one for the freefall phase, one for the glide down phase). For wind to take effect, we need to add a calculation of the the wind factor and resulting target position (because the altitude at that location may be different). Also, the travel distance is not linear anymore, because the travelling path could be slanted, so we need to take that into account in the timing calculation. That simple approach is probably enough, but has the disadvantage that the wind effect will be calculated at the start and then applied linearly to the entire glide down. That is however (in my opinion) "good enough" for our purpose here.

It may, however, be easier, to split up (at least) the glide down phase into small chunks until earth is hit, and run a nasal loop calculation just for the the next interpolation step (lasting delta-time secs; I would say, one second as a start?).