[Openal] New Mac OS X OpenAL Bugs

ggadwa at charter.net ggadwa at charter.net
Fri Apr 9 15:20:48 PDT 2004


Ian Ollmann wrote:

> The way to avoid this problem is to normalize everything to the position
>
>of the listener before converting to float.
>
>	int relative_position.x = position.x - listener.x;
>        int relative_position.y = position.y - listener.y;
>        int relative_position.z = position.z - listener.z;
>
>	alfloatposition.x = (float) relative_position.x;
>        alfloatposition.y = (float) relative_position.y;
>        alfloatposition.z = (float) relative_position.z;
>
>This will move all the large numbers where precision is a problem to areas
>very, very far from the listener. The listener wont be able to hear the
>precision issues.
>
I thought of this :)  Maybe I'm mistaken, but this would introduce an 
error when moving the listener, then.  For instance, I have long
lived "ambient" sounds that launch from a certain point in the map, and 
if the object doesn't move, are never touched and stay there.

Now, if I normalize against the listener, it'll work for a while, but if 
the listener moves too far away, then I'll have the same problem.

More or less, normalizing against the listener would force me to update 
sounds that I didn't have to before, instead of just updating the 
listener, which would be much more expensive.

[>] Brian



More information about the Openal mailing list