cgv
Loading...
Searching...
No Matches
cgv::gui::pose_event Class Reference

class to represent all pose events from tracking systems with the EID_POSE More...

#include <pose_event.h>

Inheritance diagram for cgv::gui::pose_event:
cgv::gui::event cgv::gui::vr_pose_event

Public Member Functions

 pose_event (const float *_pose, const float *_last_pose, unsigned short _player_index, short _trackable_index=0, double _time=0)
 construct a key event from its textual description
 
unsigned get_player_index () const
 return player index
 
int get_trackable_index () const
 return trackable index
 
void stream_out (std::ostream &os) const
 write to stream
 
void stream_in (std::istream &is)
 read from stream
 
const mat3get_orientation () const
 return current orientation matrix
 
const vec3get_position () const
 return current position
 
const mat3x4get_pose_matrix () const
 return current pose matrix
 
quat get_quaternion () const
 return current orientation quaternion
 
const mat3get_last_orientation () const
 return last orientation matrix
 
const vec3get_last_position () const
 return last position
 
const mat3x4get_last_pose_matrix () const
 return last pose matrix
 
quat get_last_quaternion () const
 return last orientation quaternion
 
vec3 get_different () const
 return difference vector from last to current position
 
mat3 get_rotation_matrix () const
 return rotation matrix between from the last to current orientation
 
quat get_rotation_quaternion () const
 return rotation quaternion between from the last to current orientation
 
- Public Member Functions inherited from cgv::gui::event
 event (unsigned int _kind=EID_NONE, unsigned char _modifiers=0, unsigned char _toggle_keys=0, double _time=0)
 construct event from its kind
 
virtual ~event ()
 virtual destructor for events
 
virtual void * get_device_id () const
 return the device id, by default returns 0
 
void set_kind (unsigned char _kind)
 set the kind of the event
 
unsigned get_kind () const
 return, what kind of event this is, typically a value from the EventId enum
 
void set_flags (unsigned char _flags)
 return the set the event flags
 
unsigned get_flags () const
 return the event flags
 
void set_modifiers (unsigned char _modifiers)
 set the modifiers
 
unsigned char get_modifiers () const
 return the active modifiers as values from EventModifier combined with a logical or-operation
 
void set_toggle_keys (unsigned char _toggle_keys)
 set the state of the toggle keys
 
unsigned char get_toggle_keys () const
 return the state of the toggle keys as values from EventToggleKeys combined with a logical or-operation
 
void set_time (const double &_time)
 set the time of the event
 
double get_time () const
 return the time of the event in seconds
 

Protected Attributes

short player_index
 
short trackable_index
 
float pose [12]
 pose stored as 3x4 matrix in column major format
 
float last_pose [12]
 last pose as 3x4 matrix
 
- Protected Attributes inherited from cgv::gui::event
unsigned char kind
 store which kind of event we have
 
unsigned char flags
 store event flags
 
unsigned char modifiers
 store the active modifiers
 
unsigned char toggle_keys
 store the active toggle keys
 
double time
 store the time of the event in seconds
 

Detailed Description

class to represent all pose events from tracking systems with the EID_POSE

Definition at line 15 of file pose_event.h.

Constructor & Destructor Documentation

◆ pose_event()

cgv::gui::pose_event::pose_event ( const float *  _pose,
const float *  _last_pose,
unsigned short  _player_index,
short  _trackable_index = 0,
double  _time = 0 
)

construct a key event from its textual description

Definition at line 8 of file pose_event.cxx.

References last_pose, and pose.

Member Function Documentation

◆ get_different()

vec3 cgv::gui::pose_event::get_different ( ) const

return difference vector from last to current position

Definition at line 86 of file pose_event.cxx.

References get_last_position(), and get_position().

◆ get_last_orientation()

const mat3 & cgv::gui::pose_event::get_last_orientation ( ) const

return last orientation matrix

Definition at line 64 of file pose_event.cxx.

References last_pose.

Referenced by get_last_quaternion(), and get_rotation_matrix().

◆ get_last_pose_matrix()

const mat3x4 & cgv::gui::pose_event::get_last_pose_matrix ( ) const

return last pose matrix

Definition at line 74 of file pose_event.cxx.

References last_pose.

◆ get_last_position()

const vec3 & cgv::gui::pose_event::get_last_position ( ) const

return last position

Definition at line 69 of file pose_event.cxx.

References last_pose.

Referenced by get_different(), and vr_test::handle().

◆ get_last_quaternion()

quat cgv::gui::pose_event::get_last_quaternion ( ) const

return last orientation quaternion

Definition at line 80 of file pose_event.cxx.

References get_last_orientation().

◆ get_orientation()

const mat3 & cgv::gui::pose_event::get_orientation ( ) const

return current orientation matrix

Definition at line 43 of file pose_event.cxx.

References pose.

Referenced by get_quaternion(), get_rotation_matrix(), and vr_view_interactor::handle().

◆ get_player_index()

unsigned cgv::gui::pose_event::get_player_index ( ) const

return player index

Definition at line 16 of file pose_event.cxx.

◆ get_pose_matrix()

const mat3x4 & cgv::gui::pose_event::get_pose_matrix ( ) const

return current pose matrix

Definition at line 54 of file pose_event.cxx.

References pose.

◆ get_position()

const vec3 & cgv::gui::pose_event::get_position ( ) const

return current position

Definition at line 49 of file pose_event.cxx.

References pose.

Referenced by get_different(), vr_view_interactor::handle(), and vr_test::handle().

◆ get_quaternion()

quat cgv::gui::pose_event::get_quaternion ( ) const

return current orientation quaternion

Definition at line 59 of file pose_event.cxx.

References get_orientation().

◆ get_rotation_matrix()

mat3 cgv::gui::pose_event::get_rotation_matrix ( ) const

return rotation matrix between from the last to current orientation

Definition at line 91 of file pose_event.cxx.

References get_last_orientation(), and get_orientation().

Referenced by get_rotation_quaternion(), and vr_test::handle().

◆ get_rotation_quaternion()

quat cgv::gui::pose_event::get_rotation_quaternion ( ) const

return rotation quaternion between from the last to current orientation

Definition at line 96 of file pose_event.cxx.

References get_rotation_matrix().

◆ get_trackable_index()

int cgv::gui::pose_event::get_trackable_index ( ) const

return trackable index

Definition at line 21 of file pose_event.cxx.

Referenced by vr_view_interactor::handle(), and vr_test::handle().

◆ stream_in()

void cgv::gui::pose_event::stream_in ( std::istream &  is)
virtual

read from stream

Reimplemented from cgv::gui::event.

Definition at line 37 of file pose_event.cxx.

◆ stream_out()

void cgv::gui::pose_event::stream_out ( std::ostream &  os) const
virtual

write to stream

Reimplemented from cgv::gui::event.

Reimplemented in cgv::gui::vr_pose_event.

Definition at line 26 of file pose_event.cxx.

References pose, and cgv::gui::event::stream_out().

Referenced by cgv::gui::vr_pose_event::stream_out().

Member Data Documentation

◆ last_pose

float cgv::gui::pose_event::last_pose[12]
protected

last pose as 3x4 matrix

Definition at line 23 of file pose_event.h.

Referenced by get_last_orientation(), get_last_pose_matrix(), get_last_position(), and pose_event().

◆ player_index

short cgv::gui::pose_event::player_index
protected

Definition at line 19 of file pose_event.h.

◆ pose

float cgv::gui::pose_event::pose[12]
protected

pose stored as 3x4 matrix in column major format

Definition at line 21 of file pose_event.h.

Referenced by get_orientation(), get_pose_matrix(), get_position(), pose_event(), and stream_out().

◆ trackable_index

short cgv::gui::pose_event::trackable_index
protected

Definition at line 19 of file pose_event.h.


The documentation for this class was generated from the following files: