PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms 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
 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
28#ifndef LL_LLCRITICALDAMP_H
29#define LL_LLCRITICALDAMP_H
30
31#include <map>
32
33#include "llframetimer.h"
34
35class LL_COMMON_API LLCriticalDamp 
36{
37public:
38	LLCriticalDamp();
39
40	// MANIPULATORS
41	static void updateInterpolants();
42
43	// ACCESSORS
44	static F32 getInterpolant(const F32 time_constant, BOOL use_cache = TRUE);
45
46protected:	
47	static LLFrameTimer sInternalTimer;	// frame timer for calculating deltas
48
49	static std::map<F32, F32> 	sInterpolants;
50	static F32					sTimeDelta;
51};
52
53#endif  // LL_LLCRITICALDAMP_H