distance values

kampfgnu

30-04-2007 17:43:42

howdy!
ok, i played around with the distance values like maxDistance, rolloff and refdistance.
i read about these params and came to the clou that the maxdistance is the distance, where there is no further attenuation of the sound.
rolloff is responsible for the "speed" of doing the attenuation.
refdistance: if set to lets say 50, the sound will not attenuade until the listener moves away 50 units from the soundobject.
is that right so far?

i want the soundobject to be gain=0 when i move away far enough of it.
but there is no param that allows me to say: "be quiet if listeners distance to soundobject is more than 200 units!"

right now, i did it manually by calculating the distance between my soundobject and listener every frame.
if its further away than my maxdistance, i fade out the sound by decreasing its gain-0.01 every following frame (the same for fading in the sound if the listenerdistance is smaller than maxdistance).

i am not sure if this is the right way...
so do you have any suggestions or walkarounds?
maybe i am just blind when reading ogreAL API?


ahhh yesss....btw: do you know any articles about implementing sound for games? i have no clue how to control the organisation of sources (hardwaredevice just allows about 30 at once) and setting soundevents in relation of interaction...
so any help would be very welcome.

thanks in advance
greetz, kampfgnu