cgv
throttle_event.h
1 #pragma once
2 
3 #include "event.h"
4 #include "shortcut.h"
5 
6 #include "lib_begin.h"
7 
9 namespace cgv {
11  namespace gui {
12 
14 class CGV_API throttle_event : public event
15 {
16 protected:
17  // store different indices to uniquely define throttle
18  unsigned char player_index, controller_index, throttle_index;
19  // current value of throttle
20  float x;
21  // change with respect to previous value of throttle
22  float dx;
23 public:
25  throttle_event(float _x, float _dx, unsigned _player_index = 0, unsigned _controller_index = 0, unsigned _throttle_index = 0, double _time = 0);
27  unsigned get_player_index() const;
29  unsigned get_controller_index() const;
31  unsigned get_throttle_index() const;
33  void stream_out(std::ostream& os) const;
35  void stream_in(std::istream& is);
37  float get_value() const;
39  float get_value_change() const;
41  float get_last_value() const;
42 };
43 
44  }
45 }
46 
47 #include <cgv/config/lib_end.h>
cgv::gui::throttle_event
class to represent events that inform on a change in a one axis controller with the EID_THROTTLE
Definition: throttle_event.h:15
cgv::gui::event
Definition: event.h:59
cgv
the cgv namespace
Definition: vr_calib.cxx:9