[Openal-devel] Doppler Velocity and Distance Scale

Alexandre Mah Alexandre at OzEmail.com.au
Tue Mar 8 10:46:24 PST 2005


On 09/03/2005, at 5:13 AM, Jean-Marc JOT wrote:

>  I am suggesting the name AL_DISTANCE_SCALE instead of 
> AL_VELOCITY_SCALE to make it more explicit that it scales both 
> velocities and distances. (I assume that differentiating these two 
> scale factors is not necessary since AL_DOPPLER_FACTOR can be used to 
> achieve the same effect.)

It doesn't scale both velocities and distances.  It scales only 
velocities.

If you try to use it as a distance scale rather than a velocity scale, 
it will cause problems with the doppler equation if you change your 
unit of measure.

For example, suppose you have a, b, and c as your units for distance, 
velocity, and time.

If you switch your units to 2a, b, and 2c, then AL_VELOCITY_SCALE 
should stay the same.  If you switch your units to 2a, 2b, and c, then 
AL_VELOCITY_SCALE should be twice its original value (at least if you 
want it to work in your doppler equation).  If you switch your units to 
a, 2b, and 0.5c, then AL_VELOCITY_SCALE should be twice its original 
value.

As you can see AL_VELOCITY_SCALE scales with velocity, not distance.  
You can choose your distance and velocity (and time) units however you 
like, but AL_VELOCITY_SCALE always describes how the velocity is 
scaled.

AL_VELOCITY_SCALE is just the velocity coordinate unit in Mach (so it 
has little to do with distance).  This is a very important 
(velocity-related) constant in OpenAL.

Perhaps you got the "distance scale" idea from some other API where a 
time unit is fixed and distance and velocity are dependent on each 
other (so that distance and velocity scaling are identical), but in 
OpenAL distance scaling and velocity scaling are very distinct.




More information about the Openal-devel mailing list