phoboslab / wipeout-rewrite

2.59k stars 198 forks source link

Analog control #77

Open mickski56 opened 10 months ago

mickski56 commented 10 months ago

An issue with using an analog controller with the game as is, is that if you hold the controller at a constant non zero position an angular acceleration is applied every time the ship update function is run. Resulting in an ever increasing rate of turn.

This pull request addresses that by introducing a turn rate target (which can be thought of as a measure of the desired rate of turn). This is compared to the current rate of turn and a positive or negative angular acceleration is applied according to the result. This results in being able to hold a constant radius turn by keeping the control at a constant angle.

The pow() in the turn rate target calculation is just introducing a little non linear response to the input Removed as unnecessary

Cures the "balancing an egg" thing too.