aboutsummaryrefslogtreecommitdiff
path: root/sons_of_sol/ControlMotionEvent.hpp
blob: 5a93a69e4b36113b9e57029920f7568482b4bc7b (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef CONTROLMOTIONEVENT_HPP_
#define CONTROLMOTIONEVENT_HPP_

/*
 * Author: jrahm
 * created: 2013/11/01
 * ControlMotionEvent.hpp: <description>
 */

/* This is the class used to 
 * signal an event from the controller.
 *
 * These values have been normalized */
class ControlMotionEvent {
public:
	enum MotionEventType {
		  NONE
		, PITCH
		, ROLL
		, YAW
		, THROTTLE
		, STRAFE_SIDE
		, STRAFE_UP
		, FIRE_PRIMARY
	};

	enum MotionOrigin {
		JOYSTICK,
		MOUSE,
		BUTTON
	};

	ControlMotionEvent( MotionEventType type, double mag, MotionOrigin origin ) :
		mag( mag ), type( type ), origin( origin ) {}

	inline double getMagnitude() const {
		return mag;
	}

	inline MotionEventType getType() const {
		return type;
	}

	inline MotionOrigin getOrigin() const {
		return origin;
	}

	inline void setMagnitude( double mag ) {
		this->mag = mag;
	}

	inline void setType( MotionEventType type ) {
		this->type = type;
	}

	inline void setOrigin( MotionOrigin origin ) {
		this->origin = origin;
	}
private:
	double mag;
	MotionEventType type;
	MotionOrigin origin;
};

#endif /* CONTROLMOTIONEVENT_HPP_ */