forked from Chickenbreadlp/VRCFTVarjoModule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VarjoTypes.cs
132 lines (113 loc) · 4.15 KB
/
VarjoTypes.cs
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
using System.Runtime.InteropServices;
namespace VRCFTVarjoModule
{
//Varjo's structs used with both native library and companion
[StructLayout(LayoutKind.Sequential)]
public struct Vector
{
public double x;
public double y;
public double z;
}
[StructLayout(LayoutKind.Sequential)]
public struct GazeRay
{
public Vector origin; //!< Origin of the ray.
public Vector forward; //!< Direction of the ray.
}
public enum GazeStatus : long
{
Invalid = 0,
Adjust = 1,
Valid = 2
}
public enum GazeEyeStatus : long
{
Invalid = 0,
Visible = 1,
Compensated = 2,
Tracked = 3
}
[StructLayout(LayoutKind.Sequential)]
public struct GazeData
{
public GazeRay leftEye; //!< Left eye gaze ray.
public GazeRay rightEye; //!< Right eye gaze ray.
public GazeRay gaze; //!< Normalized gaze direction ray.
public double focusDistance; //!< Estimated gaze direction focus point distance.
public double stability; //!< Focus point stability.
public long captureTime; //!< Varjo time when this data was captured, see varjo_GetCurrentTime()
public GazeEyeStatus leftStatus; //!< Status of left eye data.
public GazeEyeStatus rightStatus; //!< Status of right eye data.
public GazeStatus status; //!< Tracking main status.
public long frameNumber; //!< Frame number, increases monotonically.
public double leftPupilSize; //!< Normalized [0..1] left eye pupil size.
public double rightPupilSize; //!< Normalized [0..1] right eye pupil size.
}
[StructLayout(LayoutKind.Sequential)]
public struct EyeMeasurements
{
public long frameNumber; //!< Frame number, increases monotonically.
public long captureTime; //!< Varjo time when this data was captured, see varjo_GetCurrentTime()
public float interPupillaryDistanceInMM; //!< Estimated IPD in millimeters
public float leftPupilIrisDiameterRatio; //!< Ratio between left pupil and left iris.
public float rightPupilIrisDiameterRatio; //!< Ratio between right pupil and right iris.
public float leftPupilDiameterInMM; //!< Left pupil diameter in mm
public float rightPupilDiameterInMM; //!< Right pupil diameter in mm
public float leftIrisDiameterInMM; //!< Left iris diameter in mm
public float rightIrisDiameterInMM; //!< Right iris diameter in mm
public float leftEyeOpenness; //!< Left Eye Openness
public float rightEyeOpenness; //!< Right Eye Openness
}
[StructLayout(LayoutKind.Sequential)]
public struct GazeCalibrationParameter
{
[MarshalAs(UnmanagedType.LPStr)] public string key;
[MarshalAs(UnmanagedType.LPStr)] public string value;
}
public enum GazeCalibrationMode
{
Legacy,
Fast
};
public enum GazeOutputFilterType
{
None,
Standard
}
public enum GazeOutputFrequency
{
MaximumSupported,
Frequency100Hz,
Frequency200Hz
}
public enum GazeEyeCalibrationQuality
{
Invalid = 0,
Low = 1,
Medium = 2,
High = 3
}
[StructLayout(LayoutKind.Sequential)]
public struct GazeCalibrationQuality
{
public GazeEyeCalibrationQuality left;
public GazeEyeCalibrationQuality right;
}
public enum VarjoPropertyKey
{
Invalid = 0x0,
UserPresence = 0x2000,
GazeCalibrating = 0xA000,
GazeCalibrated = 0xA001,
GazeCalibrationQuality = 0xA002,
GazeAllowed = 0xA003,
GazeEyeCalibrationQuality_Left = 0xA004,
GazeEyeCalibrationQuality_Right = 0xA005,
GazeIPDEstimate = 0xA010,
HMDConnected = 0xE001,
HMDProductName = 0xE002,
HMDSerialNumber = 0xE003,
MRAvailable = 0xD000
}
}