-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Positional audio isn't correct #4
Comments
I believe you are overcomplicating your approach to calculating the angle between the "at" and the "position". I think the correct way is to do the following:
|
|
Actually the above code might not always work, you need to clamp the thing you put into SDL_acosf from -1 to 1 otherwise you get NaN issues when the float rounding goes ever so slightly above 1 sometimes. |
Upon further reflection, I think the right code would look like this:
|
A person made a fork with an alternative calculation that appears related to this |
As for the transition: yes, this code also has problems. It's already an extremely naive approach, and on top of that, there's clearly some incorrect math somewhere causing that jarring transition. Fixing that is on the TODO list (but I'm going to split this comment into a second bug so there's an actual place we're tracking that change).
Originally posted by @icculus in #2 (comment)
The text was updated successfully, but these errors were encountered: