diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/simple_keys.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/simple_keys.h')
| -rw-r--r-- | game/client/simple_keys.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/game/client/simple_keys.h b/game/client/simple_keys.h new file mode 100644 index 0000000..1f3f0cd --- /dev/null +++ b/game/client/simple_keys.h @@ -0,0 +1,49 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef SIMPLE_KEYS_H +#define SIMPLE_KEYS_H +#ifdef _WIN32 +#pragma once +#endif + +enum simplekeyinterp_t +{ + KEY_LINEAR = 0, + KEY_SPLINE, + KEY_ACCELERATE, + KEY_DECELERATE, +}; + +class CSimpleKeyInterp : public Vector +{ +public: + CSimpleKeyInterp( float t, simplekeyinterp_t interp, float x, float y = 0, float z = 0 ) : Vector( x, y, z ) + { + m_interp = interp; + m_keyTime = t; + } + + float GetTime() const { return m_keyTime; } + + // out = t*start + (1-t) * end (may be splinear or linear) + static void Interp( Vector &out, float t, const CSimpleKeyInterp &start, const CSimpleKeyInterp &end ); + + float m_keyTime; + simplekeyinterp_t m_interp; +}; + + +class CSimpleKeyList +{ +public: + int Insert( const CSimpleKeyInterp &key ); + bool Interp( Vector &out, float t ); + + CUtlVector<CSimpleKeyInterp> m_list; +}; + +#endif // SIMPLE_KEYS_H |