cgv
pose_event.h
1 #pragma once
2 
3 #include "event.h"
4 #include "shortcut.h"
5 #include <cgv/math/fvec.h>
6 #include <cgv/math/fmat.h>
7 #include <cgv/math/quaternion.h>
8 
9 #include "lib_begin.h"
10 
11 namespace cgv {
12  namespace gui {
13 
15 class CGV_API pose_event : public event
16 {
17 public:
26 protected:
27  // store different indices to uniquely define trackable
28  short player_index, trackable_index;
30  float pose[12];
32  float last_pose[12];
33 public:
35  pose_event(const float *_pose, const float *_last_pose, unsigned short _player_index, short _trackable_index = 0, double _time = 0);
37  unsigned get_player_index() const;
39  int get_trackable_index() const;
41  void stream_out(std::ostream& os) const;
43  void stream_in(std::istream& is);
45  const mat3& get_orientation() const;
47  const vec3& get_position() const;
49  const mat3x4& get_pose_matrix() const;
51  quat get_quaternion() const;
53  const mat3& get_last_orientation() const;
55  const vec3& get_last_position() const;
57  const mat3x4& get_last_pose_matrix() const;
59  quat get_last_quaternion() const;
61  vec3 get_different() const;
63  mat3 get_rotation_matrix() const;
65  quat get_rotation_quaternion() const;
66 };
67 
68  }
69 }
70 
71 #include <cgv/config/lib_end.h>
cgv::math::fmat
matrix of fixed size dimensions
Definition: fmat.h:23
cgv::math::fvec< float, 3 >
cgv::math::quaternion< float >
cgv::gui::pose_event::mat3x4
cgv::math::fmat< float, 3, 4 > mat3x4
declare 3x4 matrix type
Definition: pose_event.h:23
cgv::gui::pose_event::quat
cgv::math::quaternion< float > quat
declare quaternion type
Definition: pose_event.h:25
cgv::gui::event
Definition: event.h:59
cgv::gui::pose_event::vec3
cgv::math::fvec< float, 3 > vec3
declare 3d vector type
Definition: pose_event.h:19
cgv::gui::pose_event
class to represent all pose events from tracking systems with the EID_POSE
Definition: pose_event.h:16
cgv::gui::pose_event::mat3
cgv::math::fmat< float, 3, 3 > mat3
declare 3d matrix type
Definition: pose_event.h:21
cgv
the cgv namespace
Definition: vr_calib.cxx:9