tracker.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef FOB_TRACKER_H
00018 #define FOB_TRACKER_H
00019
00020 #include <eq/eq.h>
00021 #include <string>
00022
00023 namespace eqPly
00024 {
00025 class Tracker
00026 {
00027 public:
00031 Tracker();
00032
00042 bool init( const std::string& port );
00043
00050 void setWorldToEmitter( const eq::Matrix4f& matrix )
00051 { _worldToEmitter = matrix; }
00052
00059 void setSensorToObject( const eq::Matrix4f& matrix )
00060 { _sensorToObject = matrix; }
00061
00068 bool isRunning() const { return _running; }
00069
00079 bool update();
00080
00088 const eq::Matrix4f& getMatrix() const { return _matrix; }
00089
00090 private:
00091 bool _update();
00092 bool _read( unsigned char* buffer, const size_t size,
00093 const unsigned long int timeout );
00094
00096 bool _running;
00097
00098 int _fd;
00099
00101 eq::Matrix4f _matrix;
00102
00104 eq::Matrix4f _worldToEmitter;
00106 eq::Matrix4f _sensorToObject;
00107 };
00108 }
00109
00110 #endif // FOB_TRACKER_H