Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analog control #77

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Analog control #77

wants to merge 35 commits into from

Conversation

mickski56
Copy link

@mickski56 mickski56 commented Sep 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant