ovr_sdk
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/LibOVR/Src/Sensors/OVR_DeviceConstants.h Wed Jan 14 06:51:16 2015 +0200 1.3 @@ -0,0 +1,184 @@ 1.4 +/************************************************************************************ 1.5 + 1.6 +Filename : OVR_DeviceConstants.h 1.7 +Content : Device constants 1.8 +Created : February 5, 2013 1.9 +Authors : Lee Cooper 1.10 + 1.11 +Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved. 1.12 + 1.13 +Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); 1.14 +you may not use the Oculus VR Rift SDK except in compliance with the License, 1.15 +which is provided at the time of installation or download, or which 1.16 +otherwise accompanies this software in either electronic or hard copy form. 1.17 + 1.18 +You may obtain a copy of the License at 1.19 + 1.20 +http://www.oculusvr.com/licenses/LICENSE-3.2 1.21 + 1.22 +Unless required by applicable law or agreed to in writing, the Oculus VR SDK 1.23 +distributed under the License is distributed on an "AS IS" BASIS, 1.24 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1.25 +See the License for the specific language governing permissions and 1.26 +limitations under the License. 1.27 + 1.28 +*************************************************************************************/ 1.29 + 1.30 +#ifndef OVR_DeviceConstants_h 1.31 +#define OVR_DeviceConstants_h 1.32 + 1.33 +#include "../Kernel/OVR_Math.h" 1.34 + 1.35 +// CAPI forward declarations. 1.36 +struct ovrSensorData_; 1.37 +typedef struct ovrSensorData_ ovrSensorData; 1.38 + 1.39 +namespace OVR { 1.40 + 1.41 + 1.42 +//------------------------------------------------------------------------------------- 1.43 +// Different device types supported by OVR; this type is reported by DeviceBase::GetType. 1.44 +// 1.45 +enum DeviceType 1.46 +{ 1.47 + Device_None, 1.48 + Device_Manager, 1.49 + Device_Sensor, 1.50 + Device_LatencyTester, 1.51 + Device_BootLoader, 1.52 + Device_All = 0xFF // Set for enumeration only, to enumerate all device types. 1.53 +}; 1.54 + 1.55 + 1.56 + 1.57 +//------------------------------------------------------------------------------------- 1.58 +// Different lens distortion types supported by devices. 1.59 +// 1.60 +enum DistortionEqnType 1.61 +{ 1.62 + Distortion_No_Override = -1, 1.63 + // These two are leagcy and deprecated. 1.64 + Distortion_Poly4 = 0, // scale = (K0 + K1*r^2 + K2*r^4 + K3*r^6) 1.65 + Distortion_RecipPoly4 = 1, // scale = 1/(K0 + K1*r^2 + K2*r^4 + K3*r^6) 1.66 + 1.67 + // CatmullRom10 is the preferred distortion format. 1.68 + Distortion_CatmullRom10 = 2, // scale = Catmull-Rom spline through points (1.0, K[1]...K[9]) 1.69 + 1.70 + Distortion_LAST // For ease of enumeration. 1.71 +}; 1.72 + 1.73 + 1.74 +//------------------------------------------------------------------------------------- 1.75 +// HMD types. 1.76 +// 1.77 +enum HmdTypeEnum 1.78 +{ 1.79 + HmdType_None, 1.80 + 1.81 + HmdType_DKProto, // First duct-tape model, never sold. 1.82 + HmdType_DK1, // DevKit1 - on sale to developers. 1.83 + HmdType_DKHDProto, // DKHD - shown at various shows, never sold. 1.84 + HmdType_DKHD2Proto, // DKHD2, 5.85-inch panel, never sold. 1.85 + HmdType_DKHDProto566Mi, // DKHD, 5.66-inch panel, never sold. 1.86 + HmdType_CrystalCoveProto, // Crystal Cove, 5.66-inch panel, shown at shows but never sold. 1.87 + HmdType_DK2, 1.88 + 1.89 + // Reminder - this header file is public - codenames only! 1.90 + 1.91 + HmdType_Unknown, // Used for unnamed HW lab experiments. 1.92 + 1.93 + HmdType_LAST 1.94 +}; 1.95 + 1.96 + 1.97 +//------------------------------------------------------------------------------------- 1.98 +// HMD shutter types. 1.99 +// 1.100 +enum HmdShutterTypeEnum 1.101 +{ 1.102 + HmdShutter_Global, 1.103 + HmdShutter_RollingTopToBottom, 1.104 + HmdShutter_RollingLeftToRight, 1.105 + HmdShutter_RollingRightToLeft, 1.106 + // TODO: 1.107 + // color-sequential e.g. LCOS? 1.108 + // alternate eyes? 1.109 + // alternate columns? 1.110 + // outside-in? 1.111 + 1.112 + HmdShutter_LAST 1.113 +}; 1.114 + 1.115 + 1.116 + 1.117 +//------------------------------------------------------------------------------------- 1.118 +// For headsets that use eye cups 1.119 +// 1.120 +enum EyeCupType 1.121 +{ 1.122 + // Public lenses 1.123 + EyeCup_DK1A = 0, 1.124 + EyeCup_DK1B = 1, 1.125 + EyeCup_DK1C = 2, 1.126 + 1.127 + EyeCup_DK2A = 3, 1.128 + 1.129 + // Internal R&D codenames. 1.130 + // Reminder - this header file is public - codenames only! 1.131 + EyeCup_DKHD2A, 1.132 + EyeCup_OrangeA, 1.133 + EyeCup_RedA, 1.134 + EyeCup_PinkA, 1.135 + EyeCup_BlueA, 1.136 + EyeCup_Delilah1A, 1.137 + EyeCup_Delilah2A, 1.138 + EyeCup_JamesA, 1.139 + EyeCup_SunMandalaA, 1.140 + 1.141 + EyeCup_LAST 1.142 +}; 1.143 + 1.144 + 1.145 +//----------------------------------------------------------------------------- 1.146 +// BodyFrameState 1.147 +// 1.148 +#pragma pack(push, 8) 1.149 + 1.150 +class SensorDataType 1.151 +{ 1.152 +public: 1.153 + 1.154 + SensorDataType() : Temperature(0.0f), AbsoluteTimeSeconds(0.0) { } 1.155 + 1.156 + // C-interop support 1.157 + SensorDataType(const ovrSensorData& s); 1.158 + operator ovrSensorData () const; 1.159 + 1.160 + Vector3f Acceleration; // in m/s^2 1.161 + Vector3f RotationRate; // in rad/s 1.162 + Vector3f MagneticField; // in Gauss 1.163 + 1.164 + float Temperature; // in degrees Celsius 1.165 + 1.166 + // The absolute time from the host computers perspective that the message should be 1.167 + // interpreted as. This is based on incoming timestamp and processed by a filter 1.168 + // that syncs the clocks while attempting to keep the distance between messages 1.169 + // device clock matching. 1.170 + // 1.171 + // Integration should use TimeDelta, but prediction into the future should derive 1.172 + // the delta time from PredictToSeconds - AbsoluteTimeSeconds. 1.173 + // 1.174 + // This value will generally be <= the return from a call to ovr_GetTimeInSeconds(), 1.175 + // but could be greater by under 1 ms due to system time update interrupt delays. 1.176 + // 1.177 + double AbsoluteTimeSeconds; 1.178 +}; 1.179 + 1.180 +static_assert((sizeof(SensorDataType) == 3*sizeof(Vector3f) + sizeof(float) + sizeof(double)), "sizeof(SensorDataType) failure"); 1.181 + 1.182 +#pragma pack(pop) 1.183 + 1.184 + 1.185 +} // namespace OVR 1.186 + 1.187 +#endif