00001 // Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones 00002 // This file is part of the "cAudio Engine" 00003 // For conditions of distribution and use, see copyright notice in cAudio.h 00004 00005 #ifndef CLISTENER_H_INCLUDED 00006 #define CLISTENER_H_INCLUDED 00007 00008 #include "../include/IListener.h" 00009 #include "../Headers/cMutex.h" 00010 00011 namespace cAudio 00012 { 00013 class cListener : public IListener 00014 { 00015 public: 00016 cListener() : Direction(cVector3(0.f, 0.f, -1.f)), 00017 UpVector(cVector3(0.f, 1.f, 0.f)), 00018 MasterGain(1.f) {} 00019 virtual ~cListener() {} 00020 00021 virtual void setPosition(const cVector3 pos); 00022 virtual void setDirection(const cVector3 dir); 00023 virtual void setUpVector(const cVector3 up); 00024 virtual void setVelocity(const cVector3 vel); 00025 virtual void setMasterVolume(const float volume); 00026 virtual void move(const cVector3 pos); 00027 00028 virtual cVector3 getPosition(void) const { return Position; } 00029 virtual cVector3 getDirection(void) const { return Direction; } 00030 virtual cVector3 getUpVector(void) const { return UpVector; } 00031 virtual cVector3 getVelocity(void) const { return Velocity; } 00032 virtual float getMasterVolume(void) const { return MasterGain; } 00033 00034 #ifdef CAUDIO_EFX_ENABLED 00035 virtual void setMetersPerUnit(const float& meters); 00036 virtual float getMetersPerUnit(void) const; 00037 #endif 00038 00039 protected: 00040 cAudioMutex Mutex; 00041 00042 cVector3 Position; 00043 cVector3 Direction; 00044 cVector3 UpVector; 00045 cVector3 Velocity; 00046 float MasterGain; 00047 private: 00048 }; 00049 } 00050 #endif
1.6.2