00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRS_SOUND_LISTENERAL_H
00019 #define VRS_SOUND_LISTENERAL_H
00020
00021
00022
00023
00024 #include <vrs/lookat.h>
00025 #include <vrs/monoattribute.h>
00026
00027
00028
00029
00030 #include <vrs/openal/config.h>
00031
00032
00033 namespace VRS
00034 {
00035 namespace SOUND
00036 {
00037 class VRS_OPENAL_API ListenerAL : public MonoAttribute
00038 {
00039 public:
00040
00041 ListenerAL(const SO<LookAt>& lookAt,
00042 const VRS::Vector& velocity = Vector::origin,
00043 float gain = 1.0f,
00044 bool enabled = true);
00045
00046 ListenerAL(const VRS::Vector& position,
00047 const VRS::Vector& direction,
00048 const VRS::Vector& tilt,
00049 const VRS::Vector& velocity = Vector::origin,
00050 float gain = 1.0f,
00051 bool enabled = true);
00052
00054 void setLookAt(const SO<LookAt>& lookAt);
00055 inline const SO<LookAt>& getLookAt(void) const
00056 {
00057 return this->lookAt_;
00058 }
00059
00060 void update(void);
00061
00072 void setPosition(const VRS::Vector& position);
00073 inline Vector getPosition(void) const
00074 {
00075 return this->lookAt_->getFrom();
00076 }
00077
00079 void setDirection(const VRS::Vector& direction);
00080 inline Vector getDirection(void) const
00081 {
00082 return this->lookAt_->getTo();
00083 }
00084
00086 void setTilt(const VRS::Vector& tilt);
00087 inline Vector getTilt(void) const
00088 {
00089 return this->lookAt_->getUp();
00090 }
00091
00093 void setVelocity(const VRS::Vector& velocity);
00094 inline const Vector& getVelocity(void) const
00095 {
00096 return this->velocity_;
00097 }
00098
00107 void setGain(float gain);
00108 inline float getGain(void) const
00109 {
00110 return this->gain_;
00111 }
00112
00113 VRS_TYPEINFO(ListenerAL, MonoAttribute);
00114 VRS_SERIALIZABLE(ListenerAL);
00115
00116 protected:
00117
00118 ListenerAL(void);
00119
00120 private:
00121
00122 SO<LookAt> lookAt_;
00123 Vector velocity_;
00124 float gain_;
00125
00126 };
00127
00128 };
00129
00130 };
00131
00132 #endif //VRS_SOUND_LISTENERAL_H