summaryrefslogtreecommitdiff
path: root/public/movieobjects/dmemouseinput.h
blob: 9b60586a59047c9a2075c3cc887183a10f9975a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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