PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/llaudio/lllistener.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 136 lines | 72 code | 21 blank | 43 comment | 0 complexity | ca99a304eca46a448bb9c6d27b1689f7 MD5 | raw file
  1/** 
  2 * @file listener.cpp
  3 * @brief Implementation of LISTENER class abstracting the audio support
  4 *
  5 * $LicenseInfo:firstyear=2000&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#include "linden_common.h"
 28
 29#include "lllistener.h"
 30
 31#define DEFAULT_AT  0.0f,0.0f,-1.0f
 32#define DEFAULT_UP  0.0f,1.0f,0.0f
 33
 34//-----------------------------------------------------------------------
 35// constructor
 36//-----------------------------------------------------------------------
 37LLListener::LLListener()
 38{
 39	init();
 40}
 41
 42//-----------------------------------------------------------------------
 43LLListener::~LLListener()
 44{
 45}
 46
 47//-----------------------------------------------------------------------
 48void LLListener::init(void)
 49{
 50	mPosition.zeroVec();
 51	mListenAt.setVec(DEFAULT_AT);
 52	mListenUp.setVec(DEFAULT_UP);
 53	mVelocity.zeroVec();
 54}
 55
 56//-----------------------------------------------------------------------
 57void LLListener::translate(LLVector3 offset)
 58{
 59	mPosition += offset;
 60}
 61
 62//-----------------------------------------------------------------------
 63void LLListener::setPosition(LLVector3 pos)
 64{
 65	mPosition = pos;
 66}
 67
 68//-----------------------------------------------------------------------
 69LLVector3 LLListener::getPosition(void)
 70{
 71	return(mPosition);
 72}
 73
 74//-----------------------------------------------------------------------
 75LLVector3 LLListener::getAt(void)
 76{
 77	return(mListenAt);
 78}
 79
 80//-----------------------------------------------------------------------
 81LLVector3 LLListener::getUp(void)
 82{
 83	return(mListenUp);
 84}
 85
 86//-----------------------------------------------------------------------
 87void LLListener::setVelocity(LLVector3 vel)
 88{
 89	mVelocity = vel;
 90}
 91
 92//-----------------------------------------------------------------------
 93void LLListener::orient(LLVector3 up, LLVector3 at)
 94{
 95	mListenUp = up;
 96	mListenAt = at;
 97}
 98
 99//-----------------------------------------------------------------------
100void LLListener::set(LLVector3 pos, LLVector3 vel, LLVector3 up, LLVector3 at)
101{
102	mPosition = pos;
103	mVelocity = vel;
104
105	setPosition(pos);
106	setVelocity(vel);
107	orient(up,at);
108}
109
110//-----------------------------------------------------------------------
111void LLListener::setDopplerFactor(F32 factor)
112{
113}
114
115//-----------------------------------------------------------------------
116F32 LLListener::getDopplerFactor()
117{
118	return (1.f);
119}
120
121//-----------------------------------------------------------------------
122void LLListener::setRolloffFactor(F32 factor)
123{
124}
125
126//-----------------------------------------------------------------------
127F32 LLListener::getRolloffFactor()
128{
129	return (1.f);
130}
131
132//-----------------------------------------------------------------------
133void LLListener::commitDeferredChanges()
134{
135}
136