diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2013-11-23 20:27:01 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2013-11-23 20:27:01 -0700 |
| commit | 7be3bda2b664068bf47404278fa9ee1ce552ea0e (patch) | |
| tree | a50683398c8f011c9aba39cab7aee6246bcc029b /sons_of_sol/ControlMotionEvent.hpp | |
| parent | 88d0215624de994b4456c8eac537262118ffed52 (diff) | |
| download | SonsOfSol-7be3bda2b664068bf47404278fa9ee1ce552ea0e.tar.gz SonsOfSol-7be3bda2b664068bf47404278fa9ee1ce552ea0e.tar.bz2 SonsOfSol-7be3bda2b664068bf47404278fa9ee1ce552ea0e.zip | |
Got application to a point of displaying model objects
Diffstat (limited to 'sons_of_sol/ControlMotionEvent.hpp')
| -rw-r--r-- | sons_of_sol/ControlMotionEvent.hpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/sons_of_sol/ControlMotionEvent.hpp b/sons_of_sol/ControlMotionEvent.hpp new file mode 100644 index 0000000..5a93a69 --- /dev/null +++ b/sons_of_sol/ControlMotionEvent.hpp @@ -0,0 +1,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_ */ |