PageRenderTime 40ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llcommon/llcriticaldamp.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 53 lines | 16 code | 9 blank | 28 comment | 0 complexity | 07d4d76afe49219d63ed1c3e5174161e MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llcriticaldamp.h
  3. * @brief A lightweight class that calculates critical damping constants once
  4. * per frame.
  5. *
  6. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library 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 GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LL_LLCRITICALDAMP_H
  28. #define LL_LLCRITICALDAMP_H
  29. #include <map>
  30. #include "llframetimer.h"
  31. class LL_COMMON_API LLCriticalDamp
  32. {
  33. public:
  34. LLCriticalDamp();
  35. // MANIPULATORS
  36. static void updateInterpolants();
  37. // ACCESSORS
  38. static F32 getInterpolant(const F32 time_constant, BOOL use_cache = TRUE);
  39. protected:
  40. static LLFrameTimer sInternalTimer; // frame timer for calculating deltas
  41. static std::map<F32, F32> sInterpolants;
  42. static F32 sTimeDelta;
  43. };
  44. #endif // LL_LLCRITICALDAMP_H