nuclear@0: /************************************************************************************ nuclear@0: nuclear@0: Filename : OVR_DeviceConstants.h nuclear@0: Content : Device constants nuclear@0: Created : February 5, 2013 nuclear@0: Authors : Lee Cooper nuclear@0: nuclear@0: Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved. nuclear@0: nuclear@0: Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License"); nuclear@0: you may not use the Oculus VR Rift SDK except in compliance with the License, nuclear@0: which is provided at the time of installation or download, or which nuclear@0: otherwise accompanies this software in either electronic or hard copy form. nuclear@0: nuclear@0: You may obtain a copy of the License at nuclear@0: nuclear@0: http://www.oculusvr.com/licenses/LICENSE-3.2 nuclear@0: nuclear@0: Unless required by applicable law or agreed to in writing, the Oculus VR SDK nuclear@0: distributed under the License is distributed on an "AS IS" BASIS, nuclear@0: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. nuclear@0: See the License for the specific language governing permissions and nuclear@0: limitations under the License. nuclear@0: nuclear@0: *************************************************************************************/ nuclear@0: nuclear@0: #ifndef OVR_DeviceConstants_h nuclear@0: #define OVR_DeviceConstants_h nuclear@0: nuclear@0: #include "../Kernel/OVR_Math.h" nuclear@0: nuclear@0: // CAPI forward declarations. nuclear@0: struct ovrSensorData_; nuclear@0: typedef struct ovrSensorData_ ovrSensorData; nuclear@0: nuclear@0: namespace OVR { nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // Different device types supported by OVR; this type is reported by DeviceBase::GetType. nuclear@0: // nuclear@0: enum DeviceType nuclear@0: { nuclear@0: Device_None, nuclear@0: Device_Manager, nuclear@0: Device_Sensor, nuclear@0: Device_LatencyTester, nuclear@0: Device_BootLoader, nuclear@0: Device_All = 0xFF // Set for enumeration only, to enumerate all device types. nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // Different lens distortion types supported by devices. nuclear@0: // nuclear@0: enum DistortionEqnType nuclear@0: { nuclear@0: Distortion_No_Override = -1, nuclear@0: // These two are leagcy and deprecated. nuclear@0: Distortion_Poly4 = 0, // scale = (K0 + K1*r^2 + K2*r^4 + K3*r^6) nuclear@0: Distortion_RecipPoly4 = 1, // scale = 1/(K0 + K1*r^2 + K2*r^4 + K3*r^6) nuclear@0: nuclear@0: // CatmullRom10 is the preferred distortion format. nuclear@0: Distortion_CatmullRom10 = 2, // scale = Catmull-Rom spline through points (1.0, K[1]...K[9]) nuclear@0: nuclear@0: Distortion_LAST // For ease of enumeration. nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // HMD types. nuclear@0: // nuclear@0: enum HmdTypeEnum nuclear@0: { nuclear@0: HmdType_None, nuclear@0: nuclear@0: HmdType_DKProto, // First duct-tape model, never sold. nuclear@0: HmdType_DK1, // DevKit1 - on sale to developers. nuclear@0: HmdType_DKHDProto, // DKHD - shown at various shows, never sold. nuclear@0: HmdType_DKHD2Proto, // DKHD2, 5.85-inch panel, never sold. nuclear@0: HmdType_DKHDProto566Mi, // DKHD, 5.66-inch panel, never sold. nuclear@0: HmdType_CrystalCoveProto, // Crystal Cove, 5.66-inch panel, shown at shows but never sold. nuclear@0: HmdType_DK2, nuclear@0: nuclear@0: // Reminder - this header file is public - codenames only! nuclear@0: nuclear@0: HmdType_Unknown, // Used for unnamed HW lab experiments. nuclear@0: nuclear@0: HmdType_LAST nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // HMD shutter types. nuclear@0: // nuclear@0: enum HmdShutterTypeEnum nuclear@0: { nuclear@0: HmdShutter_Global, nuclear@0: HmdShutter_RollingTopToBottom, nuclear@0: HmdShutter_RollingLeftToRight, nuclear@0: HmdShutter_RollingRightToLeft, nuclear@0: // TODO: nuclear@0: // color-sequential e.g. LCOS? nuclear@0: // alternate eyes? nuclear@0: // alternate columns? nuclear@0: // outside-in? nuclear@0: nuclear@0: HmdShutter_LAST nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: nuclear@0: //------------------------------------------------------------------------------------- nuclear@0: // For headsets that use eye cups nuclear@0: // nuclear@0: enum EyeCupType nuclear@0: { nuclear@0: // Public lenses nuclear@0: EyeCup_DK1A = 0, nuclear@0: EyeCup_DK1B = 1, nuclear@0: EyeCup_DK1C = 2, nuclear@0: nuclear@0: EyeCup_DK2A = 3, nuclear@0: nuclear@0: // Internal R&D codenames. nuclear@0: // Reminder - this header file is public - codenames only! nuclear@0: EyeCup_DKHD2A, nuclear@0: EyeCup_OrangeA, nuclear@0: EyeCup_RedA, nuclear@0: EyeCup_PinkA, nuclear@0: EyeCup_BlueA, nuclear@0: EyeCup_Delilah1A, nuclear@0: EyeCup_Delilah2A, nuclear@0: EyeCup_JamesA, nuclear@0: EyeCup_SunMandalaA, nuclear@0: nuclear@0: EyeCup_LAST nuclear@0: }; nuclear@0: nuclear@0: nuclear@0: //----------------------------------------------------------------------------- nuclear@0: // BodyFrameState nuclear@0: // nuclear@0: #pragma pack(push, 8) nuclear@0: nuclear@0: class SensorDataType nuclear@0: { nuclear@0: public: nuclear@0: nuclear@0: SensorDataType() : Temperature(0.0f), AbsoluteTimeSeconds(0.0) { } nuclear@0: nuclear@0: // C-interop support nuclear@0: SensorDataType(const ovrSensorData& s); nuclear@0: operator ovrSensorData () const; nuclear@0: nuclear@0: Vector3f Acceleration; // in m/s^2 nuclear@0: Vector3f RotationRate; // in rad/s nuclear@0: Vector3f MagneticField; // in Gauss nuclear@0: nuclear@0: float Temperature; // in degrees Celsius nuclear@0: nuclear@0: // The absolute time from the host computers perspective that the message should be nuclear@0: // interpreted as. This is based on incoming timestamp and processed by a filter nuclear@0: // that syncs the clocks while attempting to keep the distance between messages nuclear@0: // device clock matching. nuclear@0: // nuclear@0: // Integration should use TimeDelta, but prediction into the future should derive nuclear@0: // the delta time from PredictToSeconds - AbsoluteTimeSeconds. nuclear@0: // nuclear@0: // This value will generally be <= the return from a call to ovr_GetTimeInSeconds(), nuclear@0: // but could be greater by under 1 ms due to system time update interrupt delays. nuclear@0: // nuclear@0: double AbsoluteTimeSeconds; nuclear@0: }; nuclear@0: nuclear@0: static_assert((sizeof(SensorDataType) == 3*sizeof(Vector3f) + sizeof(float) + sizeof(double)), "sizeof(SensorDataType) failure"); nuclear@0: nuclear@0: #pragma pack(pop) nuclear@0: nuclear@0: nuclear@0: } // namespace OVR nuclear@0: nuclear@0: #endif