ovr_sdk

view LibOVR/Src/Sensors/OVR_DeviceConstants.h @ 0:1b39a1b46319

initial 0.4.4
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 06:51:16 +0200
parents
children
line source
1 /************************************************************************************
3 Filename : OVR_DeviceConstants.h
4 Content : Device constants
5 Created : February 5, 2013
6 Authors : Lee Cooper
8 Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
10 Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
11 you may not use the Oculus VR Rift SDK except in compliance with the License,
12 which is provided at the time of installation or download, or which
13 otherwise accompanies this software in either electronic or hard copy form.
15 You may obtain a copy of the License at
17 http://www.oculusvr.com/licenses/LICENSE-3.2
19 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
20 distributed under the License is distributed on an "AS IS" BASIS,
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 See the License for the specific language governing permissions and
23 limitations under the License.
25 *************************************************************************************/
27 #ifndef OVR_DeviceConstants_h
28 #define OVR_DeviceConstants_h
30 #include "../Kernel/OVR_Math.h"
32 // CAPI forward declarations.
33 struct ovrSensorData_;
34 typedef struct ovrSensorData_ ovrSensorData;
36 namespace OVR {
39 //-------------------------------------------------------------------------------------
40 // Different device types supported by OVR; this type is reported by DeviceBase::GetType.
41 //
42 enum DeviceType
43 {
44 Device_None,
45 Device_Manager,
46 Device_Sensor,
47 Device_LatencyTester,
48 Device_BootLoader,
49 Device_All = 0xFF // Set for enumeration only, to enumerate all device types.
50 };
54 //-------------------------------------------------------------------------------------
55 // Different lens distortion types supported by devices.
56 //
57 enum DistortionEqnType
58 {
59 Distortion_No_Override = -1,
60 // These two are leagcy and deprecated.
61 Distortion_Poly4 = 0, // scale = (K0 + K1*r^2 + K2*r^4 + K3*r^6)
62 Distortion_RecipPoly4 = 1, // scale = 1/(K0 + K1*r^2 + K2*r^4 + K3*r^6)
64 // CatmullRom10 is the preferred distortion format.
65 Distortion_CatmullRom10 = 2, // scale = Catmull-Rom spline through points (1.0, K[1]...K[9])
67 Distortion_LAST // For ease of enumeration.
68 };
71 //-------------------------------------------------------------------------------------
72 // HMD types.
73 //
74 enum HmdTypeEnum
75 {
76 HmdType_None,
78 HmdType_DKProto, // First duct-tape model, never sold.
79 HmdType_DK1, // DevKit1 - on sale to developers.
80 HmdType_DKHDProto, // DKHD - shown at various shows, never sold.
81 HmdType_DKHD2Proto, // DKHD2, 5.85-inch panel, never sold.
82 HmdType_DKHDProto566Mi, // DKHD, 5.66-inch panel, never sold.
83 HmdType_CrystalCoveProto, // Crystal Cove, 5.66-inch panel, shown at shows but never sold.
84 HmdType_DK2,
86 // Reminder - this header file is public - codenames only!
88 HmdType_Unknown, // Used for unnamed HW lab experiments.
90 HmdType_LAST
91 };
94 //-------------------------------------------------------------------------------------
95 // HMD shutter types.
96 //
97 enum HmdShutterTypeEnum
98 {
99 HmdShutter_Global,
100 HmdShutter_RollingTopToBottom,
101 HmdShutter_RollingLeftToRight,
102 HmdShutter_RollingRightToLeft,
103 // TODO:
104 // color-sequential e.g. LCOS?
105 // alternate eyes?
106 // alternate columns?
107 // outside-in?
109 HmdShutter_LAST
110 };
114 //-------------------------------------------------------------------------------------
115 // For headsets that use eye cups
116 //
117 enum EyeCupType
118 {
119 // Public lenses
120 EyeCup_DK1A = 0,
121 EyeCup_DK1B = 1,
122 EyeCup_DK1C = 2,
124 EyeCup_DK2A = 3,
126 // Internal R&D codenames.
127 // Reminder - this header file is public - codenames only!
128 EyeCup_DKHD2A,
129 EyeCup_OrangeA,
130 EyeCup_RedA,
131 EyeCup_PinkA,
132 EyeCup_BlueA,
133 EyeCup_Delilah1A,
134 EyeCup_Delilah2A,
135 EyeCup_JamesA,
136 EyeCup_SunMandalaA,
138 EyeCup_LAST
139 };
142 //-----------------------------------------------------------------------------
143 // BodyFrameState
144 //
145 #pragma pack(push, 8)
147 class SensorDataType
148 {
149 public:
151 SensorDataType() : Temperature(0.0f), AbsoluteTimeSeconds(0.0) { }
153 // C-interop support
154 SensorDataType(const ovrSensorData& s);
155 operator ovrSensorData () const;
157 Vector3f Acceleration; // in m/s^2
158 Vector3f RotationRate; // in rad/s
159 Vector3f MagneticField; // in Gauss
161 float Temperature; // in degrees Celsius
163 // The absolute time from the host computers perspective that the message should be
164 // interpreted as. This is based on incoming timestamp and processed by a filter
165 // that syncs the clocks while attempting to keep the distance between messages
166 // device clock matching.
167 //
168 // Integration should use TimeDelta, but prediction into the future should derive
169 // the delta time from PredictToSeconds - AbsoluteTimeSeconds.
170 //
171 // This value will generally be <= the return from a call to ovr_GetTimeInSeconds(),
172 // but could be greater by under 1 ms due to system time update interrupt delays.
173 //
174 double AbsoluteTimeSeconds;
175 };
177 static_assert((sizeof(SensorDataType) == 3*sizeof(Vector3f) + sizeof(float) + sizeof(double)), "sizeof(SensorDataType) failure");
179 #pragma pack(pop)
182 } // namespace OVR
184 #endif