NLSOUND::CompareSources Struct Reference


Public Member Functions

 CompareSources (const CVector &pos)
bool operator() (const CSimpleSource *s1, const CSimpleSource *s2)

Data Fields

const CVector & _Pos

Constructor & Destructor Documentation

NLSOUND::CompareSources::CompareSources const CVector &  pos  )  [inline]
 

Definition at line 1943 of file audio_mixer_user.cpp.

01943 : _Pos(pos) {}


Member Function Documentation

bool NLSOUND::CompareSources::operator() const CSimpleSource s1,
const CSimpleSource s2
[inline]
 

Definition at line 1946 of file audio_mixer_user.cpp.

References NLSOUND::CSourceCommon::getPos(), and NLSOUND::CSourceCommon::getPriority().

01947         {
01948                 if (s1->getPriority() < s2->getPriority())
01949                 {
01950                         return true;
01951                 }
01952                 else if (s1->getPriority() == s2->getPriority())
01953                 {
01954                         // Equal priority, test distances to the listener
01955                         const CVector &src1pos = s1->getPos();
01956                         const CVector &src2pos = s2->getPos();;
01957                         return ( (src1pos-_Pos).sqrnorm() < (src2pos-_Pos).sqrnorm() );
01958                 }
01959                 else
01960                 {
01961                         return false;
01962                 }
01963         }


Field Documentation

const CVector& NLSOUND::CompareSources::_Pos
 

Definition at line 1966 of file audio_mixer_user.cpp.


The documentation for this struct was generated from the following file:
Generated on Tue Mar 16 14:39:33 2004 for NeL by doxygen 1.3.6