File: freetrack.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (95 lines) | stat: -rw-r--r-- 1,667 bytes parent folder | download | duplicates (2)
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

#ifndef HEADTRACKING_FREETRACK_H
#define HEADTRACKING_FREETRACK_H

#include "headtracking/headtracking.h"
#include "headtracking/headtracking_internal.h"

#include "external_dll/externalcode.h"

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

namespace headtracking
{
	namespace freetrack
	{
		struct FreeTrackData
		{
			unsigned int dataID;
			int camWidth;
			int camHeight;

			float yaw;
			float pitch;
			float roll;
			float x;
			float y;
			float z;

			float rawyaw;
			float rawpitch;
			float rawroll;
			float rawx;
			float rawy;
			float rawz;

			float x1;
			float y1;
			float x2;
			float y2;
			float x3;
			float y3;
			float x4;
			float y4;
		};

		typedef bool (WINAPI *FTGetData_PTR)(FreeTrackData * data);
		typedef char *(WINAPI *FTGetDllVersion_PTR)(void);
		typedef void (WINAPI *FTReportID_PTR)(int name);
		typedef char *(WINAPI *FTProvider_PTR)(void);

		class FreeTrackLibrary : public SCP_ExternalCode
		{
		private:
			FTGetData_PTR mFTGetData;
			FTGetDllVersion_PTR mFTGetDllVersion;
			FTReportID_PTR mFTReportID;
			FTProvider_PTR mFTProvider;

			bool mEnabled;

		public:
			FreeTrackLibrary();

			virtual ~FreeTrackLibrary() {}

			bool GetData(FreeTrackData * data);

			char* GetDllVersion(void);

			void ReportID(int name);

			char* Provider(void);

			bool Enabled() const { return mEnabled; }
		};

		class FreeTrackProvider : public internal::HeadTrackingProvider
		{
		private:
			FreeTrackLibrary library;

		public:
			FreeTrackProvider();

			virtual ~FreeTrackProvider();

			bool query(HeadTrackingStatus* statusOut) override;

			static SCP_string getName();
		};
	}
}

#endif // HEADTRACKING_FREETRACK_H