Check the distance against epsilon to determine if it matches
This commit is contained in:
@@ -732,7 +732,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
|
||||
/* Use a binaural HRTF algorithm for stereo headphone playback */
|
||||
ALfloat delta, ev = 0.0f, az = 0.0f;
|
||||
|
||||
if(Distance > 0.0f)
|
||||
if(Distance > FLT_EPSILON)
|
||||
{
|
||||
ALfloat invlen = 1.0f/Distance;
|
||||
Position[0] *= invlen;
|
||||
@@ -797,7 +797,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
|
||||
}
|
||||
|
||||
/* Normalize the length, and compute panned gains. */
|
||||
if(Distance > 0.0f)
|
||||
if(Distance > FLT_EPSILON)
|
||||
{
|
||||
ALfloat invlen = 1.0f/Distance;
|
||||
Position[0] *= invlen;
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
#define F_PI (3.14159265358979323846f) /* pi */
|
||||
#define F_PI_2 (1.57079632679489661923f) /* pi/2 */
|
||||
|
||||
#ifndef FLT_EPSILON
|
||||
#define FLT_EPSILON (1.19209290e-07f)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_POWF
|
||||
static __inline float powf(float x, float y)
|
||||
{ return (float)pow(x, y); }
|
||||
|
||||
Reference in New Issue
Block a user