-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFionaUTVRPN.h
More file actions
105 lines (87 loc) · 2.28 KB
/
FionaUTVRPN.h
File metadata and controls
105 lines (87 loc) · 2.28 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef FionaUT_VRPN_BRIDGE_H__
#define FionaUT_VRPN_BRIDGE_H__
#include "VRPN/vrpn_Tracker.h"
#include "VRPN/vrpn_Analog.h"
#include "VRPN/vrpn_Button.h"
#include <stdio.h>
#include <vector>
class FionaUTVRPN
{
private:
static vrpn_Tracker_Remote* tracker;
static vrpn_Analog_Remote* analog;
static vrpn_Button_Remote* buttons;
static vrpn_Analog_Remote* analog2;
static vrpn_Button_Remote* buttons2;
static bool Initialized(void);
FionaUTVRPN() {}
struct VRPNData
{
float timeStamp;
vrpn_float64 headPos[3];
vrpn_float64 headQuat[4];
vrpn_float64 wandPos[3];
vrpn_float64 wandQuat[4];
vrpn_float64 joystick[3];
unsigned int buttons;
unsigned int state;
};
struct VRPNData2
{
float timeStamp;
vrpn_float64 headPos[3];
vrpn_float64 headQuat[4];
vrpn_float64 wandPos[3];
vrpn_float64 wandQuat[4];
vrpn_float64 joystick[3];
unsigned int buttons;
unsigned int state;
float mv[16];
};
struct VRPNData3
{
float timeStamp;
vrpn_float64 headPos[3];
vrpn_float64 headQuat[4];
vrpn_float64 wandPos[3];
vrpn_float64 wandQuat[4];
vrpn_float64 joystick[3];
unsigned int buttons;
unsigned int state;
unsigned int keyboard;
float mv[16];
};
static void ResetCurrData(void);
public:
struct VRPNPathPositions
{
vrpn_float64 x;
vrpn_float64 y;
vrpn_float64 z;
};
static FILE *ioFile;
static bool recordIO;
static bool playbackIO;
static bool lastStampPlayed;
static bool pausePlayback;
static float pauseTime;
static VRPNData3 currData;
static float *framesPerSecond;
static unsigned int currButtons;
static unsigned int currState;
static unsigned int numheadPositions;
static void StartRecord(void);
static void StartPlayback(void);
static void Init(const char* hostAddress="localhost",
const char* trackerN="Isense900",
const char* wandN="Wand0",
const char* inputHost="",
const char* wandN2=0);
static void MainLoop(void);
static void Close(void);
static void PausePlayback(void);
static void UnpausePlayback(void);
static void getPathway(std::vector<FionaUTVRPN::VRPNPathPositions> & pathPositions);
static unsigned int getNumPositions(void) { return numheadPositions; }
};
#endif