Microsoft DirectX 9.0

Distance Factor

The distance factor is the number of meters in a vector unit. By default, the distance factor is 1.0. If the velocity of a buffer is (2.0, 0.0, 0.0), the sound source is considered to be moving along the x-axis at 2 meters per second. Applications that are using a different unit of measurement for 3-D graphics vectors might want to change the distance factor accordingly.

Suppose, for example, that the basic unit of measurement in your application is the foot, or 0.3048 meters. You set the distance factor to 0.3048. From then on, you use feet in parameters to method calls, and they are automatically converted to meters.

The distance factor mainly affects Doppler shift, by changing the actual velocity represented by n units per second. It does not directly affect rolloff, because the rate of attenuation over distance is based on the minimum distance in vector units. If you set the minimum distance for a given sound at 2 units, the volume will be halved at a distance of 4 units, regardless of whether those units are in feet, meters, or any other measure. For more information, see Minimum and Maximum Distances.

See Also