5 #include <cgv/math/fvec.h>
35 unsigned char player_index, controller_index, stick_index;
45 unsigned _player_index = 0,
unsigned _controller_index = 0,
unsigned _stick_index = 0,
double _time = 0);
47 void stream_out(std::ostream& os)
const;
49 void stream_in(std::istream& is);
53 unsigned get_player_index()
const;
55 unsigned get_controller_index()
const;
57 unsigned get_stick_index()
const;
63 const vec2& get_position()
const;
69 const vec2& get_difference()
const;
71 float get_last_x()
const;
73 float get_last_y()
const;
75 vec2 get_last_position()
const;
81 #include <cgv/config/lib_end.h>
StickAction
different actions that a stick can perform
Definition: stick_event.h:15
unsigned char action
store stick action
Definition: stick_event.h:37
cgv::math::fvec< float, 2 > vec2
declare 2d vector type
Definition: stick_event.h:32
@ SA_TOUCH
stick touch action
Definition: stick_event.h:16
@ SA_DRAG
stick moved in pressed state
Definition: stick_event.h:21
vec2 difference
change in stick location
Definition: stick_event.h:41
@ SA_UNPRESS
stick unpress repeated press action
Definition: stick_event.h:18
vec2 position
current stick location
Definition: stick_event.h:39
@ SA_RELEASE
stick release action
Definition: stick_event.h:19
std::string get_stick_action_string(StickAction action)
convert a key action into a readable string
Definition: stick_event.cxx:8
class to represent stick events with the EID_STICK
Definition: stick_event.h:29
@ SA_PRESS
stick press action
Definition: stick_event.h:17
@ SA_MOVE
stick moved with respect to last event
Definition: stick_event.h:20
the cgv namespace
Definition: vr_calib.cxx:9