summaryrefslogtreecommitdiff
path: root/public/movieobjects/dmemouseinput.h
diff options
context:
space:
mode:
Diffstat (limited to 'public/movieobjects/dmemouseinput.h')
-rw-r--r--public/movieobjects/dmemouseinput.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/public/movieobjects/dmemouseinput.h b/public/movieobjects/dmemouseinput.h
new file mode 100644
index 0000000..9b60586
--- /dev/null
+++ b/public/movieobjects/dmemouseinput.h
@@ -0,0 +1,45 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// The abstract base operator class - all actions within the scenegraph happen via operators
+//
+//=============================================================================
+
+#ifndef DMEMOUSEINPUT_H
+#define DMEMOUSEINPUT_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "movieobjects/dmeinput.h"
+
+
+//-----------------------------------------------------------------------------
+// A class representing a camera
+//-----------------------------------------------------------------------------
+class CDmeMouseInput : public CDmeInput
+{
+ DEFINE_ELEMENT( CDmeMouseInput, CDmeInput );
+
+public:
+ virtual bool IsDirty(); // ie needs to operate
+ virtual void Operate();
+
+ virtual void GetInputAttributes ( CUtlVector< CDmAttribute * > &attrs );
+ virtual void GetOutputAttributes( CUtlVector< CDmAttribute * > &attrs );
+
+ // makes the current mouse position be the origin
+ void ResetOrigin() { ResetOrigin( 0.0f, 0.0f ); }
+ void ResetOrigin( float dx, float dy );
+
+protected:
+ void GetNormalizedCursorPos( float &flX, float &flY );
+
+ float m_xOrigin;
+ float m_yOrigin;
+
+ CDmaVar< float > m_x;
+ CDmaVar< float > m_y;
+};
+
+
+#endif // DMEMOUSEINPUT_H