-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrackerPlugin.h
75 lines (58 loc) · 1.66 KB
/
TrackerPlugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* @file TrackerPlugin.h
*/
//#ifndef CALVR_TRACKER_SHMEM_H
//#define CALVR_TRACKER_SHMEM_H
#include <cvrInput/TrackerBase.h>
#include <vector>
#include <osg/Matrix>
#include <stdint.h>
namespace cvr
{
/**
* @addtogroup input
* @{
*/
/**
* @brief Tracker implementation for reading out of a trackd shared memory block
*/
class TrackerPlugin : public TrackerBase
{
public:
TrackerPlugin();
virtual ~TrackerPlugin();
virtual bool init(std::string tag);
virtual TrackedBody* getBody(int index);
virtual void setBody(int index, TrackedBody* tb);
virtual unsigned int getButtonMask();
virtual void setButtonMask(int buttonMask);
virtual float getValuator(int index);
virtual void setValuator(int index, float val);
virtual int getNumBodies();
virtual int getNumValuators();
virtual int getNumButtons();
virtual void update(
std::map<int, std::list<InteractionEvent*> >& eventMap);
protected:
struct sensor
{
float p[3];
float r[3];
uint32_t t[2];
uint32_t calib;
uint32_t frame;
};
int _numBodies; ///< number of bodies in block
int _numVal; ///< number of valuators in block
int _numButtons; ///< number of buttons in block
std::vector<TrackedBody*> _bodyList; ///< list of all tracked body info
std::vector<TrackedBody*> _bodyListMem; ///< list of all tracked body info
unsigned int _buttonMask; ///< current button mask
unsigned int _buttonMaskMem; ///< current button mask
std::vector<float> _valList; ///< list of all valuator values
std::vector<float> _valListMem; ///< list of all valuator values
};
/**
* @}
*/
}