/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. #include "linden_common.h"
  27. #include "lllistener.h"
  28. #define DEFAULT_AT 0.0f,0.0f,-1.0f
  29. #define DEFAULT_UP 0.0f,1.0f,0.0f
  30. //-----------------------------------------------------------------------
  31. // constructor
  32. //-----------------------------------------------------------------------
  33. LLListener::LLListener()
  34. {
  35. init();
  36. }
  37. //-----------------------------------------------------------------------
  38. LLListener::~LLListener()
  39. {
  40. }
  41. //-----------------------------------------------------------------------
  42. void LLListener::init(void)
  43. {
  44. mPosition.zeroVec();
  45. mListenAt.setVec(DEFAULT_AT);
  46. mListenUp.setVec(DEFAULT_UP);
  47. mVelocity.zeroVec();
  48. }
  49. //-----------------------------------------------------------------------
  50. void LLListener::translate(LLVector3 offset)
  51. {
  52. mPosition += offset;
  53. }
  54. //-----------------------------------------------------------------------
  55. void LLListener::setPosition(LLVector3 pos)
  56. {
  57. mPosition = pos;
  58. }
  59. //-----------------------------------------------------------------------
  60. LLVector3 LLListener::getPosition(void)
  61. {
  62. return(mPosition);
  63. }
  64. //-----------------------------------------------------------------------
  65. LLVector3 LLListener::getAt(void)
  66. {
  67. return(mListenAt);
  68. }
  69. //-----------------------------------------------------------------------
  70. LLVector3 LLListener::getUp(void)
  71. {
  72. return(mListenUp);
  73. }
  74. //-----------------------------------------------------------------------
  75. void LLListener::setVelocity(LLVector3 vel)
  76. {
  77. mVelocity = vel;
  78. }
  79. //-----------------------------------------------------------------------
  80. void LLListener::orient(LLVector3 up, LLVector3 at)
  81. {
  82. mListenUp = up;
  83. mListenAt = at;
  84. }
  85. //-----------------------------------------------------------------------
  86. void LLListener::set(LLVector3 pos, LLVector3 vel, LLVector3 up, LLVector3 at)
  87. {
  88. mPosition = pos;
  89. mVelocity = vel;
  90. setPosition(pos);
  91. setVelocity(vel);
  92. orient(up,at);
  93. }
  94. //-----------------------------------------------------------------------
  95. void LLListener::setDopplerFactor(F32 factor)
  96. {
  97. }
  98. //-----------------------------------------------------------------------
  99. F32 LLListener::getDopplerFactor()
  100. {
  101. return (1.f);
  102. }
  103. //-----------------------------------------------------------------------
  104. void LLListener::setRolloffFactor(F32 factor)
  105. {
  106. }
  107. //-----------------------------------------------------------------------
  108. F32 LLListener::getRolloffFactor()
  109. {
  110. return (1.f);
  111. }
  112. //-----------------------------------------------------------------------
  113. void LLListener::commitDeferredChanges()
  114. {
  115. }