diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/simple_keys.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/simple_keys.h')
| -rw-r--r-- | mp/src/game/client/simple_keys.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/mp/src/game/client/simple_keys.h b/mp/src/game/client/simple_keys.h new file mode 100644 index 00000000..e37de1cc --- /dev/null +++ b/mp/src/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
|