4 * A SoundListener is for sound what a camera is for vision.
8 * ***** BEGIN GPL LICENSE BLOCK *****
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
25 * All rights reserved.
27 * The Original Code is: all of this file.
29 * Contributor(s): none yet.
31 * ***** END GPL LICENSE BLOCK *****
34 #ifndef __SND_SOUNDLISTENER_H
35 #define __SND_SOUNDLISTENER_H
37 #include "SND_Object.h"
39 class SND_SoundListener : public SND_Object
43 virtual ~SND_SoundListener();
45 void SetStateFlag(unsigned int stateflags);
46 void SetGain(MT_Scalar gain);
47 void SetPosition(const MT_Vector3& pos);
48 void SetVelocity(const MT_Vector3& vel);
49 void SetOrientation(const MT_Matrix3x3& ori);
50 void SetDopplerFactor(MT_Scalar dopplerfactor);
51 void SetDopplerVelocity(MT_Scalar dopplervelocity);
52 void SetScale(MT_Scalar scale);
54 void SetModified(bool modified);
55 bool IsModified() const;
57 unsigned int GetStateFlags() const;
58 MT_Scalar GetGain() const;
59 MT_Vector3 GetPosition() const;
60 MT_Vector3 GetVelocity() const;
61 MT_Matrix3x3 GetOrientation();
63 MT_Scalar GetDopplerFactor() const;
64 MT_Scalar GetDopplerVelocity() const;
65 MT_Scalar GetScale() const;
71 MT_Scalar m_gain; /* overall gain */
72 MT_Vector3 m_position; /* position; left/right, up/down, in/out */
73 MT_Vector3 m_velocity; /* velocity of the listener */
74 MT_Matrix3x3 m_orientation; /* orientation of the listener */
76 MT_Scalar m_dopplerfactor; /* scaling factor for the Doppler (pitch) shift */
77 MT_Scalar m_dopplervelocity; /* factor for the reference velocity (for Dopplereffect) */
81 #endif //__SND_SOUNDLISTENER_H