5#include <cgv/math/fvec.h>
32 unsigned char player_index, controller_index, stick_index;
42 unsigned _player_index = 0,
unsigned _controller_index = 0,
unsigned _stick_index = 0,
double _time = 0);
78#include <cgv/config/lib_end.h>
event(unsigned int _kind=EID_NONE, unsigned char _modifiers=0, unsigned char _toggle_keys=0, double _time=0)
construct event from its kind
vec2 difference
change in stick location
unsigned get_stick_index() const
return stick index
const vec2 & get_position() const
return current position
float get_last_x() const
return the last x value of the stick
float get_y() const
return the current y value of the stick
void stream_in(std::istream &is)
read from stream
const vec2 & get_difference() const
return the vector of coordinate differences (dx,dy)
vec2 position
current stick location
stick_event(StickAction _action, float _x, float _y, float _dx, float _dy, unsigned _player_index=0, unsigned _controller_index=0, unsigned _stick_index=0, double _time=0)
construct a key event from its textual description
float get_dy() const
return the current change in y value of the stick
float get_last_y() const
return the last y value of the stick
unsigned get_controller_index() const
return controller index
unsigned char action
store stick action
void stream_out(std::ostream &os) const
write to stream
float get_dx() const
return the current change in x value of the stick
vec2 get_last_position() const
return last position
unsigned get_player_index() const
return player index
StickAction get_action() const
return the stick action
float get_x() const
return the current x value of the stick
namespace that holds the abstract gui interface
std::string get_stick_action_string(StickAction action)
convert a key action into a readable string
StickAction
different actions that a stick can perform
@ SA_DRAG
stick moved in pressed state
@ SA_RELEASE
stick release action
@ SA_PRESS
stick press action
@ SA_TOUCH
stick touch action
@ SA_UNPRESS
stick unpress repeated press action
@ SA_MOVE
stick moved with respect to last event
this header is dependency free
cgv::math::fvec< float, 2 > vec2
declare type of 2d single precision floating point vectors