From 2d1ba0e2b47270288dc4b16ca5f4ee764242da5a Mon Sep 17 00:00:00 2001 From: r57zone Date: Wed, 6 Jun 2018 16:41:39 +0400 Subject: [PATCH] Update to OpenVR 1.0.15 --- OpenVR/headers/openvr.h | 395 ++++++++++++++++- OpenVR/headers/openvr_api.cs | 472 ++++++++++++++++++++- OpenVR/headers/openvr_api.json | 432 ++++++++++++++++++- OpenVR/headers/openvr_capi.h | 238 ++++++++++- OpenVR/headers/openvr_driver.h | 260 +++++++++++- OpenVR/samples/driver_sample/driverlog.cpp | 9 +- 6 files changed, 1781 insertions(+), 25 deletions(-) diff --git a/OpenVR/headers/openvr.h b/OpenVR/headers/openvr.h index 7f98acd..801a690 100644 --- a/OpenVR/headers/openvr.h +++ b/OpenVR/headers/openvr.h @@ -73,6 +73,11 @@ struct HmdQuaternion_t double w, x, y, z; }; +struct HmdQuaternionf_t +{ + float w, x, y, z; +}; + struct HmdColor_t { float r, g, b, a; @@ -112,6 +117,8 @@ enum ETextureType TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurfaceRef TextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure + TextureType_DXGISharedHandle = 5, // Handle is a HANDLE DXGI share handle, only supported for Overlay render targets. + // this texture is used directly by our renderer, so only perform atomic (copyresource or resolve) on it }; enum EColorSpace @@ -173,6 +180,8 @@ enum ETrackedControllerRole TrackedControllerRole_Invalid = 0, // Invalid value for controller type TrackedControllerRole_LeftHand = 1, // Tracked device associated with the left hand TrackedControllerRole_RightHand = 2, // Tracked device associated with the right hand + TrackedControllerRole_OptOut = 3, // Tracked device is opting out of left/right hand selection + TrackedControllerRole_Max = 4 }; @@ -199,6 +208,9 @@ enum ETrackingUniverseOrigin TrackingUniverseRawAndUncalibrated = 2, // Poses are provided in the coordinate system defined by the driver. It has Y up and is unified for devices of the same driver. You usually don't want this one. }; +typedef uint64_t WebConsoleHandle_t; +#define INVALID_WEB_CONSOLE_HANDLE ((vr::WebConsoleHandle_t)0) + // Refers to a single container of properties typedef uint64_t PropertyContainerHandle_t; typedef uint32_t PropertyTypeTag_t; @@ -206,6 +218,9 @@ typedef uint32_t PropertyTypeTag_t; static const PropertyContainerHandle_t k_ulInvalidPropertyContainer = 0; static const PropertyTypeTag_t k_unInvalidPropertyTag = 0; +typedef PropertyContainerHandle_t DriverHandle_t; +static const PropertyContainerHandle_t k_ulInvalidDriverHandle = 0; + // Use these tags to set/get common types as struct properties static const PropertyTypeTag_t k_unFloatPropertyTag = 1; static const PropertyTypeTag_t k_unInt32PropertyTag = 2; @@ -224,6 +239,7 @@ static const PropertyTypeTag_t k_unActionPropertyTag = 32; static const PropertyTypeTag_t k_unInputValuePropertyTag = 33; static const PropertyTypeTag_t k_unWildcardPropertyTag = 34; static const PropertyTypeTag_t k_unHapticVibrationPropertyTag = 35; +static const PropertyTypeTag_t k_unSkeletonPropertyTag = 36; static const PropertyTypeTag_t k_unOpenVRInternalReserved_Start = 1000; static const PropertyTypeTag_t k_unOpenVRInternalReserved_End = 10000; @@ -274,6 +290,9 @@ enum ETrackedDeviceProperty Prop_ResourceRoot_String = 1035, Prop_RegisteredDeviceType_String = 1036, Prop_InputProfilePath_String = 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided + Prop_NeverTracked_Bool = 1038, // Used for devices that will never have a valid pose by design + Prop_NumCameras_Int32 = 1039, + Prop_CameraFrameLayout_Int32 = 1040, // EVRTrackedCameraFrameLayout value // Properties that are unique to TrackedDeviceClass_HMD Prop_ReportsTimeSinceVSync_Bool = 2000, @@ -330,9 +349,18 @@ enum ETrackedDeviceProperty Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, // placeholder icon for sensor/base if not yet detected/loaded Prop_DoNotApplyPrediction_Bool = 2054, Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + Prop_DistortionMeshResolution_Int32 = 2056, // custom resolution of compositor calls to IVRSystem::ComputeDistortion Prop_DriverIsDrawingControllers_Bool = 2057, Prop_DriverRequestsApplicationPause_Bool = 2058, Prop_DriverRequestsReducedRendering_Bool = 2059, + Prop_MinimumIpdStepMeters_Float = 2060, + Prop_AudioBridgeFirmwareVersion_Uint64 = 2061, + Prop_ImageBridgeFirmwareVersion_Uint64 = 2062, + Prop_ImuToHeadTransform_Matrix34 = 2063, + Prop_ImuFactoryGyroBias_Vector3 = 2064, + Prop_ImuFactoryGyroScale_Vector3 = 2065, + Prop_ImuFactoryAccelerometerBias_Vector3 = 2066, + Prop_ImuFactoryAccelerometerScale_Vector3 = 2067, // Properties that are unique to TrackedDeviceClass_Controller Prop_AttachedDeviceId_String = 3000, @@ -554,6 +582,8 @@ enum EVREventType VREvent_SceneFocusChanged = 405, // data is process - New app got access to draw the scene VREvent_InputFocusChanged = 406, // data is process VREvent_SceneApplicationSecondaryRenderingStarted = 407, // data is process + VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, // data is process + VREvent_ActionBindingReloaded = 409, // data is process - The App that action binds reloaded for VREvent_HideRenderModels = 410, // Sent to the scene application to request hiding render models temporarily VREvent_ShowRenderModels = 411, // Sent to the scene application to request restoring render model visibility @@ -575,11 +605,12 @@ enum EVREventType VREvent_OverlayGamepadFocusGained = 511, // Sent to an overlay when IVROverlay::SetFocusOverlay is called on it VREvent_OverlayGamepadFocusLost = 512, // Send to an overlay when it previously had focus and IVROverlay::SetFocusOverlay is called on something else VREvent_OverlaySharedTextureChanged = 513, - VREvent_DashboardGuideButtonDown = 514, - VREvent_DashboardGuideButtonUp = 515, + //VREvent_DashboardGuideButtonDown = 514, // These are no longer sent + //VREvent_DashboardGuideButtonUp = 515, VREvent_ScreenshotTriggered = 516, // Screenshot button combo was pressed, Dashboard should request a screenshot VREvent_ImageFailed = 517, // Sent to overlays when a SetOverlayRaw or SetOverlayfromFail fails to load VREvent_DashboardOverlayCreated = 518, + VREvent_SwitchGamepadFocus = 519, // Screenshot API VREvent_RequestScreenshot = 520, // Sent by vrclient application to compositor to take a screenshot @@ -589,6 +620,8 @@ enum EVREventType VREvent_ScreenshotProgressToDashboard = 524, // Sent by compositor to the dashboard that a completed screenshot was submitted VREvent_PrimaryDashboardDeviceChanged = 525, + VREvent_RoomViewShown = 526, // Sent by compositor whenever room-view is enabled + VREvent_RoomViewHidden = 527, // Sent by compositor whenever room-view is disabled VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, @@ -667,6 +700,8 @@ enum EVREventType VREvent_MessageOverlayCloseRequested = 1651, VREvent_Input_HapticVibration = 1700, // data is hapticVibration + VREvent_Input_BindingLoadFailed = 1701, // data is process + VREvent_Input_BindingLoadSuccessful = 1702, // data is process // Vendors are free to expose private events in this reserved region VREvent_VendorSpecific_Reserved_Start = 10000, @@ -791,6 +826,7 @@ struct VREvent_Process_t struct VREvent_Overlay_t { uint64_t overlayHandle; + uint64_t devicePath; }; @@ -823,6 +859,8 @@ struct VREvent_Reserved_t { uint64_t reserved0; uint64_t reserved1; + uint64_t reserved2; + uint64_t reserved3; }; struct VREvent_PerformanceTest_t @@ -891,6 +929,18 @@ struct VREvent_HapticVibration_t float fAmplitude; }; +struct VREvent_WebConsole_t +{ + WebConsoleHandle_t webConsoleHandle; +}; + +struct VREvent_InputBindingLoad_t +{ + vr::PropertyContainerHandle_t ulAppContainer; + uint64_t pathMessage; + uint64_t pathUrl; +}; + /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */ typedef union @@ -917,6 +967,8 @@ typedef union VREvent_Property_t property; VREvent_DualAnalog_t dualAnalog; VREvent_HapticVibration_t hapticVibration; + VREvent_WebConsole_t webConsole; + VREvent_InputBindingLoad_t inputBinding; } VREvent_Data_t; @@ -952,6 +1004,12 @@ enum EVRInputError VRInputError_IPCError = 7, VRInputError_NoActiveActionSet = 8, VRInputError_InvalidDevice = 9, + VRInputError_InvalidSkeleton = 10, + VRInputError_InvalidBoneCount = 11, + VRInputError_InvalidCompressedData = 12, + VRInputError_NoData = 13, + VRInputError_BufferTooSmall = 14, + VRInputError_MismatchedActionManifest = 15, }; @@ -1136,6 +1194,14 @@ enum EVRNotificationError }; +/** Holds the transform for a single bone */ +struct VRBoneTransform_t +{ + HmdVector4_t position; + HmdQuaternionf_t orientation; +}; + + /** error codes returned by Vr_Init */ // Please add adequate error description to https://developer.valvesoftware.com/w/index.php?title=Category:SteamVRHelp @@ -1185,6 +1251,7 @@ enum EVRInitError VRInitError_Init_FirmwareUpdateBusy = 138, VRInitError_Init_FirmwareRecoveryBusy = 139, VRInitError_Init_USBServiceBusy = 140, + VRInitError_Init_VRWebHelperStartupFailed = 141, VRInitError_Driver_Failed = 200, VRInitError_Driver_Unknown = 201, @@ -1274,6 +1341,14 @@ enum EVRTrackedCameraError VRTrackedCameraError_InvalidFrameBufferSize = 115, }; +enum EVRTrackedCameraFrameLayout +{ + EVRTrackedCameraFrameLayout_Mono = 0x0001, + EVRTrackedCameraFrameLayout_Stereo = 0x0002, + EVRTrackedCameraFrameLayout_VerticalLayout = 0x0010, // Stereo frames are Top/Bottom (left/right) + EVRTrackedCameraFrameLayout_HorizontalLayout = 0x0020, // Stereo frames are Left/Right +}; + enum EVRTrackedCameraFrameType { VRTrackedCameraFrameType_Distorted = 0, // This is the camera video frame size in pixels, still distorted. @@ -1313,6 +1388,32 @@ struct DriverDirectMode_FrameTiming uint32_t m_nReprojectionFlags; }; +enum EVSync +{ + VSync_None, + VSync_WaitRender, // block following render work until vsync + VSync_NoWaitRender, // do not block following render work (allow to get started early) +}; + +/** raw IMU data provided by IVRIOBuffer from paths to tracked devices with IMUs */ +enum Imu_OffScaleFlags +{ + OffScale_AccelX = 0x01, + OffScale_AccelY = 0x02, + OffScale_AccelZ = 0x04, + OffScale_GyroX = 0x08, + OffScale_GyroY = 0x10, + OffScale_GyroZ = 0x20, +}; + +struct ImuSample_t +{ + double fSampleTime; + HmdVector3d_t vAccel; + HmdVector3d_t vGyro; + uint32_t unOffScaleFlags; +}; + #pragma pack( pop ) // figure out how to import from the VR API dll @@ -1976,10 +2077,14 @@ namespace vr static const char * const k_pch_SteamVR_RetailDemo_Bool = "retailDemo"; static const char * const k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; static const char * const k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; + static const char * const k_pch_SteamVR_SupersampleManualOverride_Bool = "supersampleManualOverride"; static const char * const k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; static const char * const k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; static const char * const k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; static const char * const k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; + static const char * const k_pch_SteamVR_DebugInput = "debugInput"; + static const char * const k_pch_SteamVR_LegacyInputRebinding = "legacyInputRebinding"; + static const char * const k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; //----------------------------------------------------------------------------- // lighthouse keys @@ -1991,6 +2096,7 @@ namespace vr static const char * const k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; static const char * const k_pch_Lighthouse_DBHistory_Bool = "dbhistory"; static const char * const k_pch_Lighthouse_EnableBluetooth_Bool = "enableBluetooth"; + static const char * const k_pch_Lighthouse_PowerManagedBaseStations_String = "PowerManagedBaseStations"; //----------------------------------------------------------------------------- // null keys @@ -2066,6 +2172,7 @@ namespace vr static const char * const k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB"; static const char * const k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA"; static const char * const k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength"; + static const char * const k_pch_Camera_RoomViewMode_Int32 = "cameraRoomViewMode"; //----------------------------------------------------------------------------- // audio keys @@ -2092,6 +2199,8 @@ namespace vr static const char * const k_pch_Dashboard_Section = "dashboard"; static const char * const k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; static const char * const k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; + static const char * const k_pch_Dashboard_EnableWebUI = "webUI"; + static const char * const k_pch_Dashboard_EnableWebUIDevTools = "webUIDevTools"; //----------------------------------------------------------------------------- // model skin keys @@ -2101,6 +2210,23 @@ namespace vr // driver keys - These could be checked in any driver_ section static const char * const k_pch_Driver_Enable_Bool = "enable"; + //----------------------------------------------------------------------------- + // web interface keys + static const char* const k_pch_WebInterface_Section = "WebInterface"; + static const char* const k_pch_WebInterface_WebPort_String = "WebPort"; + + //----------------------------------------------------------------------------- + // tracking overrides - keys are device paths, values are the device paths their + // tracking/pose information overrides + static const char* const k_pch_TrackingOverride_Section = "TrackingOverrides"; + + //----------------------------------------------------------------------------- + // per-app keys - the section name for these is the app key itself. Some of these are prefixed by the controller type + static const char* const k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; + static const char* const k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; + static const char* const k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; + static const char* const k_pch_App_ActionManifestURL_String = "ActionManifestURL"; + } // namespace vr // ivrchaperone.h @@ -3598,6 +3724,8 @@ class IVRDriverManager /** Returns the length of the number of bytes necessary to hold this string including the trailing null. */ virtual uint32_t GetDriverName( vr::DriverId_t nDriver, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) = 0; + + virtual DriverHandle_t GetDriverHandle( const char *pchDriverName ) = 0; }; static const char * const IVRDriverManager_Version = "IVRDriverManager_001"; @@ -3605,6 +3733,242 @@ static const char * const IVRDriverManager_Version = "IVRDriverManager_001"; } // namespace vr + +// ivrinput.h +namespace vr +{ + + typedef uint64_t VRActionHandle_t; + typedef uint64_t VRActionSetHandle_t; + typedef uint64_t VRInputValueHandle_t; + + static const VRActionHandle_t k_ulInvalidActionHandle = 0; + static const VRActionSetHandle_t k_ulInvalidActionSetHandle = 0; + static const VRInputValueHandle_t k_ulInvalidInputValueHandle = 0; + + static const uint32_t k_unMaxActionNameLength = 64; + static const uint32_t k_unMaxActionSetNameLength = 64; + static const uint32_t k_unMaxActionOriginCount = 16; + + struct InputAnalogActionData_t + { + // Whether or not this action is currently available to be bound in the active action set + bool bActive; + + // The origin that caused this action's current state + VRInputValueHandle_t activeOrigin; + + // The current state of this action; will be delta updates for mouse actions + float x, y, z; + + // Deltas since the previous call to UpdateActionState() + float deltaX, deltaY, deltaZ; + + // Time relative to now when this event happened. Will be negative to indicate a past time. + float fUpdateTime; + }; + + struct InputDigitalActionData_t + { + // Whether or not this action is currently available to be bound in the active action set + bool bActive; + + // The origin that caused this action's current state + VRInputValueHandle_t activeOrigin; + + // The current state of this action; will be true if currently pressed + bool bState; + + // This is true if the state has changed since the last frame + bool bChanged; + + // Time relative to now when this event happened. Will be negative to indicate a past time. + float fUpdateTime; + }; + + struct InputPoseActionData_t + { + // Whether or not this action is currently available to be bound in the active action set + bool bActive; + + // The origin that caused this action's current state + VRInputValueHandle_t activeOrigin; + + // The current state of this action + TrackedDevicePose_t pose; + }; + + enum EVRSkeletalTransformSpace + { + VRSkeletalTransformSpace_Action = 0, + VRSkeletalTransformSpace_Parent = 1, + VRSkeletalTransformSpace_Additive = 2, + }; + + + struct InputSkeletonActionData_t + { + // Whether or not this action is currently available to be bound in the active action set + bool bActive; + + // The origin that caused this action's current state + VRInputValueHandle_t activeOrigin; + }; + + enum EVRInputFilterCancelType + { + VRInputFilterCancel_Timers = 0, + VRInputFilterCancel_Momentum = 1, + }; + + struct InputOriginInfo_t + { + VRInputValueHandle_t devicePath; + TrackedDeviceIndex_t trackedDeviceIndex; + char rchRenderModelComponentName[128]; + }; + + struct VRActiveActionSet_t + { + /** This is the handle of the action set to activate for this frame. */ + VRActionSetHandle_t ulActionSet; + + /** This is the handle of a device path that this action set should be active for. To + * activate for all devices, set this to k_ulInvalidInputValueHandle. */ + VRInputValueHandle_t ulRestrictedToDevice; + + /** The action set to activate for all devices other than ulRestrictedDevice. If + * ulRestrictedToDevice is set to k_ulInvalidInputValueHandle, this parameter is + * ignored. */ + VRActionSetHandle_t ulSecondaryActionSet; + }; + + + class IVRInput + { + public: + + // --------------- Handle management --------------- // + + /** Sets the path to the action manifest JSON file that is used by this application. If this information + * was set on the Steam partner site, calls to this function are ignored. If the Steam partner site + * setting and the path provided by this call are different, VRInputError_MismatchedActionManifest is returned. + * This call must be made before the first call to UpdateActionState or IVRSystem::PollNextEvent. */ + virtual EVRInputError SetActionManifestPath( const char *pchActionManifestPath ) = 0; + + /** Returns a handle for an action set. This handle is used for all performance-sensitive calls. */ + virtual EVRInputError GetActionSetHandle( const char *pchActionSetName, VRActionSetHandle_t *pHandle ) = 0; + + /** Returns a handle for an action. This handle is used for all performance-sensitive calls. */ + virtual EVRInputError GetActionHandle( const char *pchActionName, VRActionHandle_t *pHandle ) = 0; + + /** Returns a handle for any path in the input system. E.g. /user/hand/right */ + virtual EVRInputError GetInputSourceHandle( const char *pchInputSourcePath, VRInputValueHandle_t *pHandle ) = 0; + + // --------------- Reading action state ------------------- // + + /** Reads the current state into all actions. After this call, the results of Get*Action calls + * will be the same until the next call to UpdateActionState. */ + virtual EVRInputError UpdateActionState( VR_ARRAY_COUNT( unSetCount ) VRActiveActionSet_t *pSets, uint32_t unSizeOfVRSelectedActionSet_t, uint32_t unSetCount ) = 0; + + /** Reads the state of a digital action given its handle. This will return VRInputError_WrongType if the type of + * action is something other than digital */ + virtual EVRInputError GetDigitalActionData( VRActionHandle_t action, InputDigitalActionData_t *pActionData, uint32_t unActionDataSize ) = 0; + + /** Reads the state of an analog action given its handle. This will return VRInputError_WrongType if the type of + * action is something other than analog */ + virtual EVRInputError GetAnalogActionData( VRActionHandle_t action, InputAnalogActionData_t *pActionData, uint32_t unActionDataSize ) = 0; + + /** Reads the state of a pose action given its handle. */ + virtual EVRInputError GetPoseActionData( VRActionHandle_t action, ETrackingUniverseOrigin eOrigin, float fPredictedSecondsFromNow, InputPoseActionData_t *pActionData, uint32_t unActionDataSize ) = 0; + + /** Reads the state of a skeletal action given its handle. */ + virtual EVRInputError GetSkeletalActionData( VRActionHandle_t action, EVRSkeletalTransformSpace eBoneParent, float fPredictedSecondsFromNow, InputSkeletonActionData_t *pActionData, uint32_t unActionDataSize, VR_ARRAY_COUNT( unTransformArrayCount ) VRBoneTransform_t *pTransformArray, uint32_t unTransformArrayCount ) = 0; + + /** Reads the state of a skeletal action given its handle in a compressed form that is suitable for + * sending over the network. The required buffer size will never exceed ( sizeof(VR_BoneTransform_t)*boneCount + 2). + * Usually the size will be much smaller. */ + virtual EVRInputError GetSkeletalActionDataCompressed( VRActionHandle_t action, EVRSkeletalTransformSpace eBoneParent, float fPredictedSecondsFromNow, VR_OUT_BUFFER_COUNT( unCompressedSize ) void *pvCompressedData, uint32_t unCompressedSize, uint32_t *punRequiredCompressedSize ) = 0; + + /** Turns a compressed buffer from GetSkeletalActionDataCompressed and turns it back into a bone transform array. */ + virtual EVRInputError UncompressSkeletalActionData( void *pvCompressedBuffer, uint32_t unCompressedBufferSize, EVRSkeletalTransformSpace *peBoneParent, VR_ARRAY_COUNT( unTransformArrayCount ) VRBoneTransform_t *pTransformArray, uint32_t unTransformArrayCount ) = 0; + + // --------------- Haptics ------------------- // + + /** Triggers a haptic event as described by the specified action */ + virtual EVRInputError TriggerHapticVibrationAction( VRActionHandle_t action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude ) = 0; + + // --------------- Action Origins ---------------- // + + /** Retrieve origin handles for an action */ + virtual EVRInputError GetActionOrigins( VRActionSetHandle_t actionSetHandle, VRActionHandle_t digitalActionHandle, VR_ARRAY_COUNT( originOutCount ) VRInputValueHandle_t *originsOut, uint32_t originOutCount ) = 0; + + /** Retrieves the name of the origin in the current language */ + virtual EVRInputError GetOriginLocalizedName( VRInputValueHandle_t origin, VR_OUT_STRING() char *pchNameArray, uint32_t unNameArraySize ) = 0; + + /** Retrieves useful information for the origin of this action */ + virtual EVRInputError GetOriginTrackedDeviceInfo( VRInputValueHandle_t origin, InputOriginInfo_t *pOriginInfo, uint32_t unOriginInfoSize ) = 0; + + /** Shows the current binding for the action in-headset */ + virtual EVRInputError ShowActionOrigins( VRActionSetHandle_t actionSetHandle, VRActionHandle_t ulActionHandle ) = 0; + + /** Shows the current binding all the actions in the specified action sets */ + virtual EVRInputError ShowBindingsForActionSet( VR_ARRAY_COUNT( unSetCount ) VRActiveActionSet_t *pSets, uint32_t unSizeOfVRSelectedActionSet_t, uint32_t unSetCount, VRInputValueHandle_t originToHighlight ) = 0; + }; + + static const char * const IVRInput_Version = "IVRInput_003"; + +} // namespace vr + +// ivriobuffer.h +namespace vr +{ + +typedef uint64_t IOBufferHandle_t; +static const uint64_t k_ulInvalidIOBufferHandle = 0; + + enum EIOBufferError + { + IOBuffer_Success = 0, + IOBuffer_OperationFailed = 100, + IOBuffer_InvalidHandle = 101, + IOBuffer_InvalidArgument = 102, + IOBuffer_PathExists = 103, + IOBuffer_PathDoesNotExist = 104, + IOBuffer_Permission = 105, + }; + + enum EIOBufferMode + { + IOBufferMode_Read = 0x0001, + IOBufferMode_Write = 0x0002, + IOBufferMode_Create = 0x0200, + }; + + // ---------------------------------------------------------------------------------------------- + // Purpose: + // ---------------------------------------------------------------------------------------------- + class IVRIOBuffer + { + public: + /** opens an existing or creates a new IOBuffer of unSize bytes */ + virtual vr::EIOBufferError Open( const char *pchPath, vr::EIOBufferMode mode, uint32_t unElementSize, uint32_t unElements, vr::IOBufferHandle_t *pulBuffer ) = 0; + + /** closes a previously opened or created buffer */ + virtual vr::EIOBufferError Close( vr::IOBufferHandle_t ulBuffer ) = 0; + + /** reads up to unBytes from buffer into *pDst, returning number of bytes read in *punRead */ + virtual vr::EIOBufferError Read( vr::IOBufferHandle_t ulBuffer, void *pDst, uint32_t unBytes, uint32_t *punRead ) = 0; + + /** writes unBytes of data from *pSrc into a buffer. */ + virtual vr::EIOBufferError Write( vr::IOBufferHandle_t ulBuffer, void *pSrc, uint32_t unBytes ) = 0; + + /** retrieves the property container of an buffer. */ + virtual vr::PropertyContainerHandle_t PropertyContainer( vr::IOBufferHandle_t ulBuffer ) = 0; + }; + + static const char *IVRIOBuffer_Version = "IVRIOBuffer_001"; +} // End #endif // _OPENVR_API @@ -3839,6 +4203,27 @@ namespace vr return m_pVRDriverManager; } + IVRInput *VRInput() + { + CheckClear(); + if ( !m_pVRInput ) + { + EVRInitError eError; + m_pVRInput = (IVRInput *)VR_GetGenericInterface( IVRInput_Version, &eError ); + } + return m_pVRInput; + } + + IVRIOBuffer *VRIOBuffer() + { + if ( !m_pVRIOBuffer ) + { + EVRInitError eError; + m_pVRIOBuffer = ( IVRIOBuffer * )VR_GetGenericInterface( IVRIOBuffer_Version, &eError ); + } + return m_pVRIOBuffer; + } + private: IVRSystem *m_pVRSystem; IVRChaperone *m_pVRChaperone; @@ -3853,6 +4238,8 @@ namespace vr IVRTrackedCamera *m_pVRTrackedCamera; IVRScreenshots *m_pVRScreenshots; IVRDriverManager *m_pVRDriverManager; + IVRInput *m_pVRInput; + IVRIOBuffer *m_pVRIOBuffer; }; inline COpenVRContext &OpenVRInternal_ModuleContext() @@ -3874,6 +4261,8 @@ namespace vr inline IVRExtendedDisplay *VR_CALLTYPE VRExtendedDisplay() { return OpenVRInternal_ModuleContext().VRExtendedDisplay(); } inline IVRTrackedCamera *VR_CALLTYPE VRTrackedCamera() { return OpenVRInternal_ModuleContext().VRTrackedCamera(); } inline IVRDriverManager *VR_CALLTYPE VRDriverManager() { return OpenVRInternal_ModuleContext().VRDriverManager(); } + inline IVRInput *VR_CALLTYPE VRInput() { return OpenVRInternal_ModuleContext().VRInput(); } + inline IVRIOBuffer *VR_CALLTYPE VRIOBuffer() { return OpenVRInternal_ModuleContext().VRIOBuffer(); } inline void COpenVRContext::Clear() { @@ -3890,6 +4279,8 @@ namespace vr m_pVRResources = nullptr; m_pVRScreenshots = nullptr; m_pVRDriverManager = nullptr; + m_pVRInput = nullptr; + m_pVRIOBuffer = nullptr; } VR_INTERFACE uint32_t VR_CALLTYPE VR_InitInternal2( EVRInitError *peError, EVRApplicationType eApplicationType, const char *pStartupInfo ); diff --git a/OpenVR/headers/openvr_api.cs b/OpenVR/headers/openvr_api.cs index 201eafb..e8764c4 100644 --- a/OpenVR/headers/openvr_api.cs +++ b/OpenVR/headers/openvr_api.cs @@ -1525,6 +1525,131 @@ public struct IVRDriverManager [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetDriverName GetDriverName; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate ulong _GetDriverHandle(string pchDriverName); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetDriverHandle GetDriverHandle; + +} + +[StructLayout(LayoutKind.Sequential)] +public struct IVRInput +{ + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _SetActionManifestPath(string pchActionManifestPath); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _SetActionManifestPath SetActionManifestPath; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetActionSetHandle(string pchActionSetName, ref ulong pHandle); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetActionSetHandle GetActionSetHandle; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetActionHandle(string pchActionName, ref ulong pHandle); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetActionHandle GetActionHandle; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetInputSourceHandle(string pchInputSourcePath, ref ulong pHandle); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetInputSourceHandle GetInputSourceHandle; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _UpdateActionState([In, Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _UpdateActionState UpdateActionState; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetDigitalActionData(ulong action, ref InputDigitalActionData_t pActionData, uint unActionDataSize); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetDigitalActionData GetDigitalActionData; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetAnalogActionData(ulong action, ref InputAnalogActionData_t pActionData, uint unActionDataSize); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetAnalogActionData GetAnalogActionData; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetPoseActionData(ulong action, ETrackingUniverseOrigin eOrigin, float fPredictedSecondsFromNow, ref InputPoseActionData_t pActionData, uint unActionDataSize); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetPoseActionData GetPoseActionData; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetSkeletalActionData(ulong action, EVRSkeletalTransformSpace eBoneParent, float fPredictedSecondsFromNow, ref InputSkeletonActionData_t pActionData, uint unActionDataSize, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetSkeletalActionData GetSkeletalActionData; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetSkeletalActionDataCompressed(ulong action, EVRSkeletalTransformSpace eBoneParent, float fPredictedSecondsFromNow, IntPtr pvCompressedData, uint unCompressedSize, ref uint punRequiredCompressedSize); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetSkeletalActionDataCompressed GetSkeletalActionDataCompressed; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _UncompressSkeletalActionData(IntPtr pvCompressedBuffer, uint unCompressedBufferSize, ref EVRSkeletalTransformSpace peBoneParent, [In, Out] VRBoneTransform_t[] pTransformArray, uint unTransformArrayCount); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _UncompressSkeletalActionData UncompressSkeletalActionData; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _TriggerHapticVibrationAction(ulong action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _TriggerHapticVibrationAction TriggerHapticVibrationAction; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetActionOrigins(ulong actionSetHandle, ulong digitalActionHandle, [In, Out] ulong[] originsOut, uint originOutCount); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetActionOrigins GetActionOrigins; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetOriginLocalizedName(ulong origin, System.Text.StringBuilder pchNameArray, uint unNameArraySize); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetOriginLocalizedName GetOriginLocalizedName; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _GetOriginTrackedDeviceInfo(ulong origin, ref InputOriginInfo_t pOriginInfo, uint unOriginInfoSize); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetOriginTrackedDeviceInfo GetOriginTrackedDeviceInfo; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _ShowActionOrigins(ulong actionSetHandle, ulong ulActionHandle); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _ShowActionOrigins ShowActionOrigins; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVRInputError _ShowBindingsForActionSet([In, Out] VRActiveActionSet_t[] pSets, uint unSizeOfVRSelectedActionSet_t, uint unSetCount, ulong originToHighlight); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _ShowBindingsForActionSet ShowBindingsForActionSet; + +} + +[StructLayout(LayoutKind.Sequential)] +public struct IVRIOBuffer +{ + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EIOBufferError _Open(string pchPath, EIOBufferMode mode, uint unElementSize, uint unElements, ref ulong pulBuffer); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _Open Open; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EIOBufferError _Close(ulong ulBuffer); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _Close Close; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EIOBufferError _Read(ulong ulBuffer, IntPtr pDst, uint unBytes, ref uint punRead); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _Read Read; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EIOBufferError _Write(ulong ulBuffer, IntPtr pSrc, uint unBytes); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _Write Write; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate ulong _PropertyContainer(ulong ulBuffer); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _PropertyContainer PropertyContainer; + } @@ -3257,6 +3382,147 @@ public uint GetDriverName(uint nDriver,System.Text.StringBuilder pchValue,uint u uint result = FnTable.GetDriverName(nDriver,pchValue,unBufferSize); return result; } + public ulong GetDriverHandle(string pchDriverName) + { + ulong result = FnTable.GetDriverHandle(pchDriverName); + return result; + } +} + + +public class CVRInput +{ + IVRInput FnTable; + internal CVRInput(IntPtr pInterface) + { + FnTable = (IVRInput)Marshal.PtrToStructure(pInterface, typeof(IVRInput)); + } + public EVRInputError SetActionManifestPath(string pchActionManifestPath) + { + EVRInputError result = FnTable.SetActionManifestPath(pchActionManifestPath); + return result; + } + public EVRInputError GetActionSetHandle(string pchActionSetName,ref ulong pHandle) + { + pHandle = 0; + EVRInputError result = FnTable.GetActionSetHandle(pchActionSetName,ref pHandle); + return result; + } + public EVRInputError GetActionHandle(string pchActionName,ref ulong pHandle) + { + pHandle = 0; + EVRInputError result = FnTable.GetActionHandle(pchActionName,ref pHandle); + return result; + } + public EVRInputError GetInputSourceHandle(string pchInputSourcePath,ref ulong pHandle) + { + pHandle = 0; + EVRInputError result = FnTable.GetInputSourceHandle(pchInputSourcePath,ref pHandle); + return result; + } + public EVRInputError UpdateActionState(VRActiveActionSet_t [] pSets,uint unSizeOfVRSelectedActionSet_t) + { + EVRInputError result = FnTable.UpdateActionState(pSets,unSizeOfVRSelectedActionSet_t,(uint) pSets.Length); + return result; + } + public EVRInputError GetDigitalActionData(ulong action,ref InputDigitalActionData_t pActionData,uint unActionDataSize) + { + EVRInputError result = FnTable.GetDigitalActionData(action,ref pActionData,unActionDataSize); + return result; + } + public EVRInputError GetAnalogActionData(ulong action,ref InputAnalogActionData_t pActionData,uint unActionDataSize) + { + EVRInputError result = FnTable.GetAnalogActionData(action,ref pActionData,unActionDataSize); + return result; + } + public EVRInputError GetPoseActionData(ulong action,ETrackingUniverseOrigin eOrigin,float fPredictedSecondsFromNow,ref InputPoseActionData_t pActionData,uint unActionDataSize) + { + EVRInputError result = FnTable.GetPoseActionData(action,eOrigin,fPredictedSecondsFromNow,ref pActionData,unActionDataSize); + return result; + } + public EVRInputError GetSkeletalActionData(ulong action,EVRSkeletalTransformSpace eBoneParent,float fPredictedSecondsFromNow,ref InputSkeletonActionData_t pActionData,uint unActionDataSize,VRBoneTransform_t [] pTransformArray) + { + EVRInputError result = FnTable.GetSkeletalActionData(action,eBoneParent,fPredictedSecondsFromNow,ref pActionData,unActionDataSize,pTransformArray,(uint) pTransformArray.Length); + return result; + } + public EVRInputError GetSkeletalActionDataCompressed(ulong action,EVRSkeletalTransformSpace eBoneParent,float fPredictedSecondsFromNow,IntPtr pvCompressedData,uint unCompressedSize,ref uint punRequiredCompressedSize) + { + punRequiredCompressedSize = 0; + EVRInputError result = FnTable.GetSkeletalActionDataCompressed(action,eBoneParent,fPredictedSecondsFromNow,pvCompressedData,unCompressedSize,ref punRequiredCompressedSize); + return result; + } + public EVRInputError UncompressSkeletalActionData(IntPtr pvCompressedBuffer,uint unCompressedBufferSize,ref EVRSkeletalTransformSpace peBoneParent,VRBoneTransform_t [] pTransformArray) + { + EVRInputError result = FnTable.UncompressSkeletalActionData(pvCompressedBuffer,unCompressedBufferSize,ref peBoneParent,pTransformArray,(uint) pTransformArray.Length); + return result; + } + public EVRInputError TriggerHapticVibrationAction(ulong action,float fStartSecondsFromNow,float fDurationSeconds,float fFrequency,float fAmplitude) + { + EVRInputError result = FnTable.TriggerHapticVibrationAction(action,fStartSecondsFromNow,fDurationSeconds,fFrequency,fAmplitude); + return result; + } + public EVRInputError GetActionOrigins(ulong actionSetHandle,ulong digitalActionHandle,ulong [] originsOut) + { + EVRInputError result = FnTable.GetActionOrigins(actionSetHandle,digitalActionHandle,originsOut,(uint) originsOut.Length); + return result; + } + public EVRInputError GetOriginLocalizedName(ulong origin,System.Text.StringBuilder pchNameArray,uint unNameArraySize) + { + EVRInputError result = FnTable.GetOriginLocalizedName(origin,pchNameArray,unNameArraySize); + return result; + } + public EVRInputError GetOriginTrackedDeviceInfo(ulong origin,ref InputOriginInfo_t pOriginInfo,uint unOriginInfoSize) + { + EVRInputError result = FnTable.GetOriginTrackedDeviceInfo(origin,ref pOriginInfo,unOriginInfoSize); + return result; + } + public EVRInputError ShowActionOrigins(ulong actionSetHandle,ulong ulActionHandle) + { + EVRInputError result = FnTable.ShowActionOrigins(actionSetHandle,ulActionHandle); + return result; + } + public EVRInputError ShowBindingsForActionSet(VRActiveActionSet_t [] pSets,uint unSizeOfVRSelectedActionSet_t,ulong originToHighlight) + { + EVRInputError result = FnTable.ShowBindingsForActionSet(pSets,unSizeOfVRSelectedActionSet_t,(uint) pSets.Length,originToHighlight); + return result; + } +} + + +public class CVRIOBuffer +{ + IVRIOBuffer FnTable; + internal CVRIOBuffer(IntPtr pInterface) + { + FnTable = (IVRIOBuffer)Marshal.PtrToStructure(pInterface, typeof(IVRIOBuffer)); + } + public EIOBufferError Open(string pchPath,EIOBufferMode mode,uint unElementSize,uint unElements,ref ulong pulBuffer) + { + pulBuffer = 0; + EIOBufferError result = FnTable.Open(pchPath,mode,unElementSize,unElements,ref pulBuffer); + return result; + } + public EIOBufferError Close(ulong ulBuffer) + { + EIOBufferError result = FnTable.Close(ulBuffer); + return result; + } + public EIOBufferError Read(ulong ulBuffer,IntPtr pDst,uint unBytes,ref uint punRead) + { + punRead = 0; + EIOBufferError result = FnTable.Read(ulBuffer,pDst,unBytes,ref punRead); + return result; + } + public EIOBufferError Write(ulong ulBuffer,IntPtr pSrc,uint unBytes) + { + EIOBufferError result = FnTable.Write(ulBuffer,pSrc,unBytes); + return result; + } + public ulong PropertyContainer(ulong ulBuffer) + { + ulong result = FnTable.PropertyContainer(ulBuffer); + return result; + } } @@ -3293,6 +3559,7 @@ public enum ETextureType Vulkan = 2, IOSurface = 3, DirectX12 = 4, + DXGISharedHandle = 5, } public enum EColorSpace { @@ -3322,6 +3589,8 @@ public enum ETrackedControllerRole Invalid = 0, LeftHand = 1, RightHand = 2, + OptOut = 3, + Max = 4, } public enum ETrackingUniverseOrigin { @@ -3370,6 +3639,9 @@ public enum ETrackedDeviceProperty Prop_ResourceRoot_String = 1035, Prop_RegisteredDeviceType_String = 1036, Prop_InputProfilePath_String = 1037, + Prop_NeverTracked_Bool = 1038, + Prop_NumCameras_Int32 = 1039, + Prop_CameraFrameLayout_Int32 = 1040, Prop_ReportsTimeSinceVSync_Bool = 2000, Prop_SecondsFromVsyncToPhotons_Float = 2001, Prop_DisplayFrequency_Float = 2002, @@ -3424,9 +3696,18 @@ public enum ETrackedDeviceProperty Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, Prop_DoNotApplyPrediction_Bool = 2054, Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + Prop_DistortionMeshResolution_Int32 = 2056, Prop_DriverIsDrawingControllers_Bool = 2057, Prop_DriverRequestsApplicationPause_Bool = 2058, Prop_DriverRequestsReducedRendering_Bool = 2059, + Prop_MinimumIpdStepMeters_Float = 2060, + Prop_AudioBridgeFirmwareVersion_Uint64 = 2061, + Prop_ImageBridgeFirmwareVersion_Uint64 = 2062, + Prop_ImuToHeadTransform_Matrix34 = 2063, + Prop_ImuFactoryGyroBias_Vector3 = 2064, + Prop_ImuFactoryGyroScale_Vector3 = 2065, + Prop_ImuFactoryAccelerometerBias_Vector3 = 2066, + Prop_ImuFactoryAccelerometerScale_Vector3 = 2067, Prop_AttachedDeviceId_String = 3000, Prop_SupportedButtons_Uint64 = 3001, Prop_Axis0Type_Int32 = 3002, @@ -3549,6 +3830,8 @@ public enum EVREventType VREvent_SceneFocusChanged = 405, VREvent_InputFocusChanged = 406, VREvent_SceneApplicationSecondaryRenderingStarted = 407, + VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, + VREvent_ActionBindingReloaded = 409, VREvent_HideRenderModels = 410, VREvent_ShowRenderModels = 411, VREvent_ConsoleOpened = 420, @@ -3567,17 +3850,18 @@ public enum EVREventType VREvent_OverlayGamepadFocusGained = 511, VREvent_OverlayGamepadFocusLost = 512, VREvent_OverlaySharedTextureChanged = 513, - VREvent_DashboardGuideButtonDown = 514, - VREvent_DashboardGuideButtonUp = 515, VREvent_ScreenshotTriggered = 516, VREvent_ImageFailed = 517, VREvent_DashboardOverlayCreated = 518, + VREvent_SwitchGamepadFocus = 519, VREvent_RequestScreenshot = 520, VREvent_ScreenshotTaken = 521, VREvent_ScreenshotFailed = 522, VREvent_SubmitScreenshotToDashboard = 523, VREvent_ScreenshotProgressToDashboard = 524, VREvent_PrimaryDashboardDeviceChanged = 525, + VREvent_RoomViewShown = 526, + VREvent_RoomViewHidden = 527, VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, VREvent_Notification_BeginInteraction = 602, @@ -3640,6 +3924,8 @@ public enum EVREventType VREvent_MessageOverlay_Closed = 1650, VREvent_MessageOverlayCloseRequested = 1651, VREvent_Input_HapticVibration = 1700, + VREvent_Input_BindingLoadFailed = 1701, + VREvent_Input_BindingLoadSuccessful = 1702, VREvent_VendorSpecific_Reserved_Start = 10000, VREvent_VendorSpecific_Reserved_End = 19999, } @@ -3695,6 +3981,12 @@ public enum EVRInputError IPCError = 7, NoActiveActionSet = 8, InvalidDevice = 9, + InvalidSkeleton = 10, + InvalidBoneCount = 11, + InvalidCompressedData = 12, + NoData = 13, + BufferTooSmall = 14, + MismatchedActionManifest = 15, } public enum EHiddenAreaMeshType { @@ -3822,6 +4114,7 @@ public enum EVRInitError Init_FirmwareUpdateBusy = 138, Init_FirmwareRecoveryBusy = 139, Init_USBServiceBusy = 140, + Init_VRWebHelperStartupFailed = 141, Driver_Failed = 200, Driver_Unknown = 201, Driver_HmdUnknown = 202, @@ -3900,6 +4193,13 @@ public enum EVRTrackedCameraError InvalidArgument = 114, InvalidFrameBufferSize = 115, } +public enum EVRTrackedCameraFrameLayout +{ + Mono = 1, + Stereo = 2, + VerticalLayout = 16, + HorizontalLayout = 32, +} public enum EVRTrackedCameraFrameType { Distorted = 0, @@ -3907,6 +4207,21 @@ public enum EVRTrackedCameraFrameType MaximumUndistorted = 2, MAX_CAMERA_FRAME_TYPES = 3, } +public enum EVSync +{ + None = 0, + WaitRender = 1, + NoWaitRender = 2, +} +public enum Imu_OffScaleFlags +{ + OffScale_AccelX = 1, + OffScale_AccelY = 2, + OffScale_AccelZ = 4, + OffScale_GyroX = 8, + OffScale_GyroY = 16, + OffScale_GyroZ = 32, +} public enum EVRApplicationError { None = 0, @@ -4123,6 +4438,33 @@ public enum EVRScreenshotError BufferTooSmall = 102, ScreenshotAlreadyInProgress = 108, } +public enum EVRSkeletalTransformSpace +{ + Action = 0, + Parent = 1, + Additive = 2, +} +public enum EVRInputFilterCancelType +{ + VRInputFilterCancel_Timers = 0, + VRInputFilterCancel_Momentum = 1, +} +public enum EIOBufferError +{ + IOBuffer_Success = 0, + IOBuffer_OperationFailed = 100, + IOBuffer_InvalidHandle = 101, + IOBuffer_InvalidArgument = 102, + IOBuffer_PathExists = 103, + IOBuffer_PathDoesNotExist = 104, + IOBuffer_Permission = 105, +} +public enum EIOBufferMode +{ + Read = 1, + Write = 2, + Create = 512, +} [StructLayout(LayoutKind.Explicit)] public struct VREvent_Data_t { @@ -4147,6 +4489,7 @@ public enum EVRScreenshotError [FieldOffset(0)] public VREvent_Property_t property; [FieldOffset(0)] public VREvent_DualAnalog_t dualAnalog; [FieldOffset(0)] public VREvent_HapticVibration_t hapticVibration; + [FieldOffset(0)] public VREvent_WebConsole_t webConsole; [FieldOffset(0)] public VREvent_Keyboard_t keyboard; // This has to be at the end due to a mono bug } @@ -4222,6 +4565,13 @@ public enum EVRScreenshotError public double y; public double z; } +[StructLayout(LayoutKind.Sequential)] public struct HmdQuaternionf_t +{ + public float w; + public float x; + public float y; + public float z; +} [StructLayout(LayoutKind.Sequential)] public struct HmdColor_t { public float r; @@ -4352,6 +4702,7 @@ public enum EVRScreenshotError [StructLayout(LayoutKind.Sequential)] public struct VREvent_Overlay_t { public ulong overlayHandle; + public ulong devicePath; } [StructLayout(LayoutKind.Sequential)] public struct VREvent_Status_t { @@ -4375,6 +4726,8 @@ public enum EVRScreenshotError { public ulong reserved0; public ulong reserved1; + public ulong reserved2; + public ulong reserved3; } [StructLayout(LayoutKind.Sequential)] public struct VREvent_PerformanceTest_t { @@ -4429,6 +4782,16 @@ public enum EVRScreenshotError public float fFrequency; public float fAmplitude; } +[StructLayout(LayoutKind.Sequential)] public struct VREvent_WebConsole_t +{ + public ulong webConsoleHandle; +} +[StructLayout(LayoutKind.Sequential)] public struct VREvent_InputBindingLoad_t +{ + public ulong ulAppContainer; + public ulong pathMessage; + public ulong pathUrl; +} [StructLayout(LayoutKind.Sequential)] public struct VREvent_t { public uint eventType; @@ -4532,6 +4895,11 @@ public void Unpack(ref VRControllerState_t unpacked) public float gridScale; public HmdMatrix44_t transform; } +[StructLayout(LayoutKind.Sequential)] public struct VRBoneTransform_t +{ + public HmdVector4_t position; + public HmdQuaternionf_t orientation; +} [StructLayout(LayoutKind.Sequential)] public struct CameraVideoStreamFrameHeader_t { public EVRTrackedCameraFrameType eFrameType; @@ -4549,6 +4917,13 @@ public void Unpack(ref VRControllerState_t unpacked) public uint m_nNumDroppedFrames; public uint m_nReprojectionFlags; } +[StructLayout(LayoutKind.Sequential)] public struct ImuSample_t +{ + public double fSampleTime; + public HmdVector3d_t vAccel; + public HmdVector3d_t vGyro; + public uint unOffScaleFlags; +} [StructLayout(LayoutKind.Sequential)] public struct AppOverrideKeys_t { public IntPtr pchKey; // const char * @@ -4713,6 +5088,55 @@ public void Unpack(ref RenderModel_t unpacked) public int m_nHeight; public int m_nBytesPerPixel; } +[StructLayout(LayoutKind.Sequential)] public struct InputAnalogActionData_t +{ + [MarshalAs(UnmanagedType.I1)] + public bool bActive; + public ulong activeOrigin; + public float x; + public float y; + public float z; + public float deltaX; + public float deltaY; + public float deltaZ; + public float fUpdateTime; +} +[StructLayout(LayoutKind.Sequential)] public struct InputDigitalActionData_t +{ + [MarshalAs(UnmanagedType.I1)] + public bool bActive; + public ulong activeOrigin; + [MarshalAs(UnmanagedType.I1)] + public bool bState; + [MarshalAs(UnmanagedType.I1)] + public bool bChanged; + public float fUpdateTime; +} +[StructLayout(LayoutKind.Sequential)] public struct InputPoseActionData_t +{ + [MarshalAs(UnmanagedType.I1)] + public bool bActive; + public ulong activeOrigin; + public TrackedDevicePose_t pose; +} +[StructLayout(LayoutKind.Sequential)] public struct InputSkeletonActionData_t +{ + [MarshalAs(UnmanagedType.I1)] + public bool bActive; + public ulong activeOrigin; +} +[StructLayout(LayoutKind.Sequential)] public struct InputOriginInfo_t +{ + public ulong devicePath; + public uint trackedDeviceIndex; + public byte rchRenderModelComponentName0,rchRenderModelComponentName1,rchRenderModelComponentName2,rchRenderModelComponentName3,rchRenderModelComponentName4,rchRenderModelComponentName5,rchRenderModelComponentName6,rchRenderModelComponentName7,rchRenderModelComponentName8,rchRenderModelComponentName9,rchRenderModelComponentName10,rchRenderModelComponentName11,rchRenderModelComponentName12,rchRenderModelComponentName13,rchRenderModelComponentName14,rchRenderModelComponentName15,rchRenderModelComponentName16,rchRenderModelComponentName17,rchRenderModelComponentName18,rchRenderModelComponentName19,rchRenderModelComponentName20,rchRenderModelComponentName21,rchRenderModelComponentName22,rchRenderModelComponentName23,rchRenderModelComponentName24,rchRenderModelComponentName25,rchRenderModelComponentName26,rchRenderModelComponentName27,rchRenderModelComponentName28,rchRenderModelComponentName29,rchRenderModelComponentName30,rchRenderModelComponentName31,rchRenderModelComponentName32,rchRenderModelComponentName33,rchRenderModelComponentName34,rchRenderModelComponentName35,rchRenderModelComponentName36,rchRenderModelComponentName37,rchRenderModelComponentName38,rchRenderModelComponentName39,rchRenderModelComponentName40,rchRenderModelComponentName41,rchRenderModelComponentName42,rchRenderModelComponentName43,rchRenderModelComponentName44,rchRenderModelComponentName45,rchRenderModelComponentName46,rchRenderModelComponentName47,rchRenderModelComponentName48,rchRenderModelComponentName49,rchRenderModelComponentName50,rchRenderModelComponentName51,rchRenderModelComponentName52,rchRenderModelComponentName53,rchRenderModelComponentName54,rchRenderModelComponentName55,rchRenderModelComponentName56,rchRenderModelComponentName57,rchRenderModelComponentName58,rchRenderModelComponentName59,rchRenderModelComponentName60,rchRenderModelComponentName61,rchRenderModelComponentName62,rchRenderModelComponentName63,rchRenderModelComponentName64,rchRenderModelComponentName65,rchRenderModelComponentName66,rchRenderModelComponentName67,rchRenderModelComponentName68,rchRenderModelComponentName69,rchRenderModelComponentName70,rchRenderModelComponentName71,rchRenderModelComponentName72,rchRenderModelComponentName73,rchRenderModelComponentName74,rchRenderModelComponentName75,rchRenderModelComponentName76,rchRenderModelComponentName77,rchRenderModelComponentName78,rchRenderModelComponentName79,rchRenderModelComponentName80,rchRenderModelComponentName81,rchRenderModelComponentName82,rchRenderModelComponentName83,rchRenderModelComponentName84,rchRenderModelComponentName85,rchRenderModelComponentName86,rchRenderModelComponentName87,rchRenderModelComponentName88,rchRenderModelComponentName89,rchRenderModelComponentName90,rchRenderModelComponentName91,rchRenderModelComponentName92,rchRenderModelComponentName93,rchRenderModelComponentName94,rchRenderModelComponentName95,rchRenderModelComponentName96,rchRenderModelComponentName97,rchRenderModelComponentName98,rchRenderModelComponentName99,rchRenderModelComponentName100,rchRenderModelComponentName101,rchRenderModelComponentName102,rchRenderModelComponentName103,rchRenderModelComponentName104,rchRenderModelComponentName105,rchRenderModelComponentName106,rchRenderModelComponentName107,rchRenderModelComponentName108,rchRenderModelComponentName109,rchRenderModelComponentName110,rchRenderModelComponentName111,rchRenderModelComponentName112,rchRenderModelComponentName113,rchRenderModelComponentName114,rchRenderModelComponentName115,rchRenderModelComponentName116,rchRenderModelComponentName117,rchRenderModelComponentName118,rchRenderModelComponentName119,rchRenderModelComponentName120,rchRenderModelComponentName121,rchRenderModelComponentName122,rchRenderModelComponentName123,rchRenderModelComponentName124,rchRenderModelComponentName125,rchRenderModelComponentName126,rchRenderModelComponentName127; +} +[StructLayout(LayoutKind.Sequential)] public struct VRActiveActionSet_t +{ + public ulong ulActionSet; + public ulong ulRestrictedToDevice; + public ulong ulSecondaryActionSet; +} [StructLayout(LayoutKind.Sequential)] public struct COpenVRContext { public IntPtr m_pVRSystem; // class vr::IVRSystem * @@ -4728,6 +5152,8 @@ public void Unpack(ref RenderModel_t unpacked) public IntPtr m_pVRTrackedCamera; // class vr::IVRTrackedCamera * public IntPtr m_pVRScreenshots; // class vr::IVRScreenshots * public IntPtr m_pVRDriverManager; // class vr::IVRDriverManager * + public IntPtr m_pVRInput; // class vr::IVRInput * + public IntPtr m_pVRIOBuffer; // class vr::IVRIOBuffer * } public class OpenVR @@ -4781,6 +5207,7 @@ public static uint GetInitToken() public const uint k_unTrackedDeviceIndexInvalid = 4294967295; public const ulong k_ulInvalidPropertyContainer = 0; public const uint k_unInvalidPropertyTag = 0; + public const ulong k_ulInvalidDriverHandle = 0; public const uint k_unFloatPropertyTag = 1; public const uint k_unInt32PropertyTag = 2; public const uint k_unUint64PropertyTag = 3; @@ -4796,6 +5223,7 @@ public static uint GetInitToken() public const uint k_unInputValuePropertyTag = 33; public const uint k_unWildcardPropertyTag = 34; public const uint k_unHapticVibrationPropertyTag = 35; + public const uint k_unSkeletonPropertyTag = 36; public const uint k_unOpenVRInternalReserved_Start = 1000; public const uint k_unOpenVRInternalReserved_End = 10000; public const uint k_unMaxPropertyStringSize = 32768; @@ -4870,10 +5298,14 @@ public static uint GetInitToken() public const string k_pch_SteamVR_RetailDemo_Bool = "retailDemo"; public const string k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; public const string k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; + public const string k_pch_SteamVR_SupersampleManualOverride_Bool = "supersampleManualOverride"; public const string k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; public const string k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; public const string k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; public const string k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; + public const string k_pch_SteamVR_DebugInput = "debugInput"; + public const string k_pch_SteamVR_LegacyInputRebinding = "legacyInputRebinding"; + public const string k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; public const string k_pch_Lighthouse_Section = "driver_lighthouse"; public const string k_pch_Lighthouse_DisableIMU_Bool = "disableimu"; public const string k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd"; @@ -4882,6 +5314,7 @@ public static uint GetInitToken() public const string k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; public const string k_pch_Lighthouse_DBHistory_Bool = "dbhistory"; public const string k_pch_Lighthouse_EnableBluetooth_Bool = "enableBluetooth"; + public const string k_pch_Lighthouse_PowerManagedBaseStations_String = "PowerManagedBaseStations"; public const string k_pch_Null_Section = "driver_null"; public const string k_pch_Null_SerialNumber_String = "serialNumber"; public const string k_pch_Null_ModelNumber_String = "modelNumber"; @@ -4936,6 +5369,7 @@ public static uint GetInitToken() public const string k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB"; public const string k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA"; public const string k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength"; + public const string k_pch_Camera_RoomViewMode_Int32 = "cameraRoomViewMode"; public const string k_pch_audio_Section = "audio"; public const string k_pch_audio_OnPlaybackDevice_String = "onPlaybackDevice"; public const string k_pch_audio_OnRecordDevice_String = "onRecordDevice"; @@ -4953,11 +5387,29 @@ public static uint GetInitToken() public const string k_pch_Dashboard_Section = "dashboard"; public const string k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; public const string k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; + public const string k_pch_Dashboard_EnableWebUI = "webUI"; + public const string k_pch_Dashboard_EnableWebUIDevTools = "webUIDevTools"; public const string k_pch_modelskin_Section = "modelskins"; public const string k_pch_Driver_Enable_Bool = "enable"; + public const string k_pch_WebInterface_Section = "WebInterface"; + public const string k_pch_WebInterface_WebPort_String = "WebPort"; + public const string k_pch_TrackingOverride_Section = "TrackingOverrides"; + public const string k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; + public const string k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; + public const string k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; + public const string k_pch_App_ActionManifestURL_String = "ActionManifestURL"; public const string IVRScreenshots_Version = "IVRScreenshots_001"; public const string IVRResources_Version = "IVRResources_001"; public const string IVRDriverManager_Version = "IVRDriverManager_001"; + public const ulong k_ulInvalidActionHandle = 0; + public const ulong k_ulInvalidActionSetHandle = 0; + public const ulong k_ulInvalidInputValueHandle = 0; + public const uint k_unMaxActionNameLength = 64; + public const uint k_unMaxActionSetNameLength = 64; + public const uint k_unMaxActionOriginCount = 16; + public const string IVRInput_Version = "IVRInput_003"; + public const ulong k_ulInvalidIOBufferHandle = 0; + public const string IVRIOBuffer_Version = "IVRIOBuffer_001"; static uint VRToken { get; set; } @@ -4980,6 +5432,7 @@ public void Clear() m_pVRApplications = null; m_pVRScreenshots = null; m_pVRTrackedCamera = null; + m_pVRInput = null; } void CheckClear() @@ -5134,6 +5587,19 @@ public CVRTrackedCamera VRTrackedCamera() return m_pVRTrackedCamera; } + public CVRInput VRInput() + { + CheckClear(); + if (m_pVRInput == null) + { + var eError = EVRInitError.None; + var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRInput_Version, ref eError); + if (pInterface != IntPtr.Zero && eError == EVRInitError.None) + m_pVRInput = new CVRInput(pInterface); + } + return m_pVRInput; + } + private CVRSystem m_pVRSystem; private CVRChaperone m_pVRChaperone; private CVRChaperoneSetup m_pVRChaperoneSetup; @@ -5145,6 +5611,7 @@ public CVRTrackedCamera VRTrackedCamera() private CVRApplications m_pVRApplications; private CVRScreenshots m_pVRScreenshots; private CVRTrackedCamera m_pVRTrackedCamera; + private CVRInput m_pVRInput; }; private static COpenVRContext _OpenVRInternal_ModuleContext = null; @@ -5169,6 +5636,7 @@ static COpenVRContext OpenVRInternal_ModuleContext public static CVRApplications Applications { get { return OpenVRInternal_ModuleContext.VRApplications(); } } public static CVRScreenshots Screenshots { get { return OpenVRInternal_ModuleContext.VRScreenshots(); } } public static CVRTrackedCamera TrackedCamera { get { return OpenVRInternal_ModuleContext.VRTrackedCamera(); } } + public static CVRInput Input { get { return OpenVRInternal_ModuleContext.VRInput(); } } /** Finds the active installation of vrclient.dll and initializes it */ public static CVRSystem Init(ref EVRInitError peError, EVRApplicationType eApplicationType = EVRApplicationType.VRApplication_Scene) diff --git a/OpenVR/headers/openvr_api.json b/OpenVR/headers/openvr_api.json index 86cc03a..a6bd7cb 100644 --- a/OpenVR/headers/openvr_api.json +++ b/OpenVR/headers/openvr_api.json @@ -4,8 +4,10 @@ ,{"typedef": "vr::SharedTextureHandle_t","type": "uint64_t"} ,{"typedef": "vr::DriverId_t","type": "uint32_t"} ,{"typedef": "vr::TrackedDeviceIndex_t","type": "uint32_t"} +,{"typedef": "vr::WebConsoleHandle_t","type": "uint64_t"} ,{"typedef": "vr::PropertyContainerHandle_t","type": "uint64_t"} ,{"typedef": "vr::PropertyTypeTag_t","type": "uint32_t"} +,{"typedef": "vr::DriverHandle_t","type": "PropertyContainerHandle_t"} ,{"typedef": "vr::VREvent_Data_t","type": "union VREvent_Data_t"} ,{"typedef": "vr::VRControllerState_t","type": "struct vr::VRControllerState001_t"} ,{"typedef": "vr::VROverlayHandle_t","type": "uint64_t"} @@ -15,6 +17,10 @@ ,{"typedef": "vr::VRComponentProperties","type": "uint32_t"} ,{"typedef": "vr::TextureID_t","type": "int32_t"} ,{"typedef": "vr::VRNotificationId","type": "uint32_t"} +,{"typedef": "vr::VRActionHandle_t","type": "uint64_t"} +,{"typedef": "vr::VRActionSetHandle_t","type": "uint64_t"} +,{"typedef": "vr::VRInputValueHandle_t","type": "uint64_t"} +,{"typedef": "vr::IOBufferHandle_t","type": "uint64_t"} ,{"typedef": "vr::HmdError","type": "enum vr::EVRInitError"} ,{"typedef": "vr::Hmd_Eye","type": "enum vr::EVREye"} ,{"typedef": "vr::ColorSpace","type": "enum vr::EColorSpace"} @@ -42,6 +48,7 @@ ,{"name": "TextureType_Vulkan","value": "2"} ,{"name": "TextureType_IOSurface","value": "3"} ,{"name": "TextureType_DirectX12","value": "4"} + ,{"name": "TextureType_DXGISharedHandle","value": "5"} ]} , {"enumname": "vr::EColorSpace","values": [ {"name": "ColorSpace_Auto","value": "0"} @@ -67,6 +74,8 @@ {"name": "TrackedControllerRole_Invalid","value": "0"} ,{"name": "TrackedControllerRole_LeftHand","value": "1"} ,{"name": "TrackedControllerRole_RightHand","value": "2"} + ,{"name": "TrackedControllerRole_OptOut","value": "3"} + ,{"name": "TrackedControllerRole_Max","value": "4"} ]} , {"enumname": "vr::ETrackingUniverseOrigin","values": [ {"name": "TrackingUniverseSeated","value": "0"} @@ -113,6 +122,9 @@ ,{"name": "Prop_ResourceRoot_String","value": "1035"} ,{"name": "Prop_RegisteredDeviceType_String","value": "1036"} ,{"name": "Prop_InputProfilePath_String","value": "1037"} + ,{"name": "Prop_NeverTracked_Bool","value": "1038"} + ,{"name": "Prop_NumCameras_Int32","value": "1039"} + ,{"name": "Prop_CameraFrameLayout_Int32","value": "1040"} ,{"name": "Prop_ReportsTimeSinceVSync_Bool","value": "2000"} ,{"name": "Prop_SecondsFromVsyncToPhotons_Float","value": "2001"} ,{"name": "Prop_DisplayFrequency_Float","value": "2002"} @@ -167,9 +179,18 @@ ,{"name": "Prop_NamedIconPathTrackingReferenceDeviceOff_String","value": "2053"} ,{"name": "Prop_DoNotApplyPrediction_Bool","value": "2054"} ,{"name": "Prop_CameraToHeadTransforms_Matrix34_Array","value": "2055"} + ,{"name": "Prop_DistortionMeshResolution_Int32","value": "2056"} ,{"name": "Prop_DriverIsDrawingControllers_Bool","value": "2057"} ,{"name": "Prop_DriverRequestsApplicationPause_Bool","value": "2058"} ,{"name": "Prop_DriverRequestsReducedRendering_Bool","value": "2059"} + ,{"name": "Prop_MinimumIpdStepMeters_Float","value": "2060"} + ,{"name": "Prop_AudioBridgeFirmwareVersion_Uint64","value": "2061"} + ,{"name": "Prop_ImageBridgeFirmwareVersion_Uint64","value": "2062"} + ,{"name": "Prop_ImuToHeadTransform_Matrix34","value": "2063"} + ,{"name": "Prop_ImuFactoryGyroBias_Vector3","value": "2064"} + ,{"name": "Prop_ImuFactoryGyroScale_Vector3","value": "2065"} + ,{"name": "Prop_ImuFactoryAccelerometerBias_Vector3","value": "2066"} + ,{"name": "Prop_ImuFactoryAccelerometerScale_Vector3","value": "2067"} ,{"name": "Prop_AttachedDeviceId_String","value": "3000"} ,{"name": "Prop_SupportedButtons_Uint64","value": "3001"} ,{"name": "Prop_Axis0Type_Int32","value": "3002"} @@ -288,6 +309,8 @@ ,{"name": "VREvent_SceneFocusChanged","value": "405"} ,{"name": "VREvent_InputFocusChanged","value": "406"} ,{"name": "VREvent_SceneApplicationSecondaryRenderingStarted","value": "407"} + ,{"name": "VREvent_SceneApplicationUsingWrongGraphicsAdapter","value": "408"} + ,{"name": "VREvent_ActionBindingReloaded","value": "409"} ,{"name": "VREvent_HideRenderModels","value": "410"} ,{"name": "VREvent_ShowRenderModels","value": "411"} ,{"name": "VREvent_ConsoleOpened","value": "420"} @@ -306,17 +329,18 @@ ,{"name": "VREvent_OverlayGamepadFocusGained","value": "511"} ,{"name": "VREvent_OverlayGamepadFocusLost","value": "512"} ,{"name": "VREvent_OverlaySharedTextureChanged","value": "513"} - ,{"name": "VREvent_DashboardGuideButtonDown","value": "514"} - ,{"name": "VREvent_DashboardGuideButtonUp","value": "515"} ,{"name": "VREvent_ScreenshotTriggered","value": "516"} ,{"name": "VREvent_ImageFailed","value": "517"} ,{"name": "VREvent_DashboardOverlayCreated","value": "518"} + ,{"name": "VREvent_SwitchGamepadFocus","value": "519"} ,{"name": "VREvent_RequestScreenshot","value": "520"} ,{"name": "VREvent_ScreenshotTaken","value": "521"} ,{"name": "VREvent_ScreenshotFailed","value": "522"} ,{"name": "VREvent_SubmitScreenshotToDashboard","value": "523"} ,{"name": "VREvent_ScreenshotProgressToDashboard","value": "524"} ,{"name": "VREvent_PrimaryDashboardDeviceChanged","value": "525"} + ,{"name": "VREvent_RoomViewShown","value": "526"} + ,{"name": "VREvent_RoomViewHidden","value": "527"} ,{"name": "VREvent_Notification_Shown","value": "600"} ,{"name": "VREvent_Notification_Hidden","value": "601"} ,{"name": "VREvent_Notification_BeginInteraction","value": "602"} @@ -379,6 +403,8 @@ ,{"name": "VREvent_MessageOverlay_Closed","value": "1650"} ,{"name": "VREvent_MessageOverlayCloseRequested","value": "1651"} ,{"name": "VREvent_Input_HapticVibration","value": "1700"} + ,{"name": "VREvent_Input_BindingLoadFailed","value": "1701"} + ,{"name": "VREvent_Input_BindingLoadSuccessful","value": "1702"} ,{"name": "VREvent_VendorSpecific_Reserved_Start","value": "10000"} ,{"name": "VREvent_VendorSpecific_Reserved_End","value": "19999"} ]} @@ -429,6 +455,12 @@ ,{"name": "VRInputError_IPCError","value": "7"} ,{"name": "VRInputError_NoActiveActionSet","value": "8"} ,{"name": "VRInputError_InvalidDevice","value": "9"} + ,{"name": "VRInputError_InvalidSkeleton","value": "10"} + ,{"name": "VRInputError_InvalidBoneCount","value": "11"} + ,{"name": "VRInputError_InvalidCompressedData","value": "12"} + ,{"name": "VRInputError_NoData","value": "13"} + ,{"name": "VRInputError_BufferTooSmall","value": "14"} + ,{"name": "VRInputError_MismatchedActionManifest","value": "15"} ]} , {"enumname": "vr::EHiddenAreaMeshType","values": [ {"name": "k_eHiddenAreaMesh_Standard","value": "0"} @@ -547,6 +579,7 @@ ,{"name": "VRInitError_Init_FirmwareUpdateBusy","value": "138"} ,{"name": "VRInitError_Init_FirmwareRecoveryBusy","value": "139"} ,{"name": "VRInitError_Init_USBServiceBusy","value": "140"} + ,{"name": "VRInitError_Init_VRWebHelperStartupFailed","value": "141"} ,{"name": "VRInitError_Driver_Failed","value": "200"} ,{"name": "VRInitError_Driver_Unknown","value": "201"} ,{"name": "VRInitError_Driver_HmdUnknown","value": "202"} @@ -622,12 +655,31 @@ ,{"name": "VRTrackedCameraError_InvalidArgument","value": "114"} ,{"name": "VRTrackedCameraError_InvalidFrameBufferSize","value": "115"} ]} +, {"enumname": "vr::EVRTrackedCameraFrameLayout","values": [ + {"name": "EVRTrackedCameraFrameLayout_Mono","value": "1"} + ,{"name": "EVRTrackedCameraFrameLayout_Stereo","value": "2"} + ,{"name": "EVRTrackedCameraFrameLayout_VerticalLayout","value": "16"} + ,{"name": "EVRTrackedCameraFrameLayout_HorizontalLayout","value": "32"} +]} , {"enumname": "vr::EVRTrackedCameraFrameType","values": [ {"name": "VRTrackedCameraFrameType_Distorted","value": "0"} ,{"name": "VRTrackedCameraFrameType_Undistorted","value": "1"} ,{"name": "VRTrackedCameraFrameType_MaximumUndistorted","value": "2"} ,{"name": "MAX_CAMERA_FRAME_TYPES","value": "3"} ]} +, {"enumname": "vr::EVSync","values": [ + {"name": "VSync_None","value": "0"} + ,{"name": "VSync_WaitRender","value": "1"} + ,{"name": "VSync_NoWaitRender","value": "2"} +]} +, {"enumname": "vr::Imu_OffScaleFlags","values": [ + {"name": "OffScale_AccelX","value": "1"} + ,{"name": "OffScale_AccelY","value": "2"} + ,{"name": "OffScale_AccelZ","value": "4"} + ,{"name": "OffScale_GyroX","value": "8"} + ,{"name": "OffScale_GyroY","value": "16"} + ,{"name": "OffScale_GyroZ","value": "32"} +]} , {"enumname": "vr::EVRApplicationError","values": [ {"name": "VRApplicationError_None","value": "0"} ,{"name": "VRApplicationError_AppKeyAlreadyExists","value": "100"} @@ -822,6 +874,29 @@ ,{"name": "VRScreenshotError_BufferTooSmall","value": "102"} ,{"name": "VRScreenshotError_ScreenshotAlreadyInProgress","value": "108"} ]} +, {"enumname": "vr::EVRSkeletalTransformSpace","values": [ + {"name": "VRSkeletalTransformSpace_Action","value": "0"} + ,{"name": "VRSkeletalTransformSpace_Parent","value": "1"} + ,{"name": "VRSkeletalTransformSpace_Additive","value": "2"} +]} +, {"enumname": "vr::EVRInputFilterCancelType","values": [ + {"name": "VRInputFilterCancel_Timers","value": "0"} + ,{"name": "VRInputFilterCancel_Momentum","value": "1"} +]} +, {"enumname": "vr::EIOBufferError","values": [ + {"name": "IOBuffer_Success","value": "0"} + ,{"name": "IOBuffer_OperationFailed","value": "100"} + ,{"name": "IOBuffer_InvalidHandle","value": "101"} + ,{"name": "IOBuffer_InvalidArgument","value": "102"} + ,{"name": "IOBuffer_PathExists","value": "103"} + ,{"name": "IOBuffer_PathDoesNotExist","value": "104"} + ,{"name": "IOBuffer_Permission","value": "105"} +]} +, {"enumname": "vr::EIOBufferMode","values": [ + {"name": "IOBufferMode_Read","value": "1"} + ,{"name": "IOBufferMode_Write","value": "2"} + ,{"name": "IOBufferMode_Create","value": "512"} +]} ], "consts":[{ "constname": "k_nDriverNone","consttype": "const uint32_t", "constval": "4294967295"} @@ -839,6 +914,8 @@ "constname": "k_ulInvalidPropertyContainer","consttype": "const PropertyContainerHandle_t", "constval": "0"} ,{ "constname": "k_unInvalidPropertyTag","consttype": "const PropertyTypeTag_t", "constval": "0"} +,{ + "constname": "k_ulInvalidDriverHandle","consttype": "const PropertyContainerHandle_t", "constval": "0"} ,{ "constname": "k_unFloatPropertyTag","consttype": "const PropertyTypeTag_t", "constval": "1"} ,{ @@ -869,6 +946,8 @@ "constname": "k_unWildcardPropertyTag","consttype": "const PropertyTypeTag_t", "constval": "34"} ,{ "constname": "k_unHapticVibrationPropertyTag","consttype": "const PropertyTypeTag_t", "constval": "35"} +,{ + "constname": "k_unSkeletonPropertyTag","consttype": "const PropertyTypeTag_t", "constval": "36"} ,{ "constname": "k_unOpenVRInternalReserved_Start","consttype": "const PropertyTypeTag_t", "constval": "1000"} ,{ @@ -1017,6 +1096,8 @@ "constname": "k_pch_SteamVR_IpdOffset_Float","consttype": "const char *const", "constval": "ipdOffset"} ,{ "constname": "k_pch_SteamVR_AllowSupersampleFiltering_Bool","consttype": "const char *const", "constval": "allowSupersampleFiltering"} +,{ + "constname": "k_pch_SteamVR_SupersampleManualOverride_Bool","consttype": "const char *const", "constval": "supersampleManualOverride"} ,{ "constname": "k_pch_SteamVR_EnableLinuxVulkanAsync_Bool","consttype": "const char *const", "constval": "enableLinuxVulkanAsync"} ,{ @@ -1025,6 +1106,12 @@ "constname": "k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool","consttype": "const char *const", "constval": "haveStartedTutorialForNativeChaperoneDriver"} ,{ "constname": "k_pch_SteamVR_ForceWindows32bitVRMonitor","consttype": "const char *const", "constval": "forceWindows32BitVRMonitor"} +,{ + "constname": "k_pch_SteamVR_DebugInput","consttype": "const char *const", "constval": "debugInput"} +,{ + "constname": "k_pch_SteamVR_LegacyInputRebinding","consttype": "const char *const", "constval": "legacyInputRebinding"} +,{ + "constname": "k_pch_SteamVR_DebugInputBinding","consttype": "const char *const", "constval": "debugInputBinding"} ,{ "constname": "k_pch_Lighthouse_Section","consttype": "const char *const", "constval": "driver_lighthouse"} ,{ @@ -1041,6 +1128,8 @@ "constname": "k_pch_Lighthouse_DBHistory_Bool","consttype": "const char *const", "constval": "dbhistory"} ,{ "constname": "k_pch_Lighthouse_EnableBluetooth_Bool","consttype": "const char *const", "constval": "enableBluetooth"} +,{ + "constname": "k_pch_Lighthouse_PowerManagedBaseStations_String","consttype": "const char *const", "constval": "PowerManagedBaseStations"} ,{ "constname": "k_pch_Null_Section","consttype": "const char *const", "constval": "driver_null"} ,{ @@ -1149,6 +1238,8 @@ "constname": "k_pch_Camera_BoundsColorGammaA_Int32","consttype": "const char *const", "constval": "cameraBoundsColorGammaA"} ,{ "constname": "k_pch_Camera_BoundsStrength_Int32","consttype": "const char *const", "constval": "cameraBoundsStrength"} +,{ + "constname": "k_pch_Camera_RoomViewMode_Int32","consttype": "const char *const", "constval": "cameraRoomViewMode"} ,{ "constname": "k_pch_audio_Section","consttype": "const char *const", "constval": "audio"} ,{ @@ -1183,16 +1274,52 @@ "constname": "k_pch_Dashboard_EnableDashboard_Bool","consttype": "const char *const", "constval": "enableDashboard"} ,{ "constname": "k_pch_Dashboard_ArcadeMode_Bool","consttype": "const char *const", "constval": "arcadeMode"} +,{ + "constname": "k_pch_Dashboard_EnableWebUI","consttype": "const char *const", "constval": "webUI"} +,{ + "constname": "k_pch_Dashboard_EnableWebUIDevTools","consttype": "const char *const", "constval": "webUIDevTools"} ,{ "constname": "k_pch_modelskin_Section","consttype": "const char *const", "constval": "modelskins"} ,{ "constname": "k_pch_Driver_Enable_Bool","consttype": "const char *const", "constval": "enable"} +,{ + "constname": "k_pch_WebInterface_Section","consttype": "const char *const", "constval": "WebInterface"} +,{ + "constname": "k_pch_WebInterface_WebPort_String","consttype": "const char *const", "constval": "WebPort"} +,{ + "constname": "k_pch_TrackingOverride_Section","consttype": "const char *const", "constval": "TrackingOverrides"} +,{ + "constname": "k_pch_App_BindingAutosaveURLSuffix_String","consttype": "const char *const", "constval": "AutosaveURL"} +,{ + "constname": "k_pch_App_BindingCurrentURLSuffix_String","consttype": "const char *const", "constval": "CurrentURL"} +,{ + "constname": "k_pch_App_NeedToUpdateAutosaveSuffix_Bool","consttype": "const char *const", "constval": "NeedToUpdateAutosave"} +,{ + "constname": "k_pch_App_ActionManifestURL_String","consttype": "const char *const", "constval": "ActionManifestURL"} ,{ "constname": "IVRScreenshots_Version","consttype": "const char *const", "constval": "IVRScreenshots_001"} ,{ "constname": "IVRResources_Version","consttype": "const char *const", "constval": "IVRResources_001"} ,{ "constname": "IVRDriverManager_Version","consttype": "const char *const", "constval": "IVRDriverManager_001"} +,{ + "constname": "k_ulInvalidActionHandle","consttype": "const VRActionHandle_t", "constval": "0"} +,{ + "constname": "k_ulInvalidActionSetHandle","consttype": "const VRActionSetHandle_t", "constval": "0"} +,{ + "constname": "k_ulInvalidInputValueHandle","consttype": "const VRInputValueHandle_t", "constval": "0"} +,{ + "constname": "k_unMaxActionNameLength","consttype": "const uint32_t", "constval": "64"} +,{ + "constname": "k_unMaxActionSetNameLength","consttype": "const uint32_t", "constval": "64"} +,{ + "constname": "k_unMaxActionOriginCount","consttype": "const uint32_t", "constval": "16"} +,{ + "constname": "IVRInput_Version","consttype": "const char *const", "constval": "IVRInput_003"} +,{ + "constname": "k_ulInvalidIOBufferHandle","consttype": "const uint64_t", "constval": "0"} +,{ + "constname": "IVRIOBuffer_Version","consttype": "const char *", "constval": "IVRIOBuffer_001"} ], "structs":[{"struct": "vr::HmdMatrix34_t","fields": [ { "fieldname": "m", "fieldtype": "float [3][4]"}]} @@ -1211,6 +1338,11 @@ { "fieldname": "x", "fieldtype": "double"}, { "fieldname": "y", "fieldtype": "double"}, { "fieldname": "z", "fieldtype": "double"}]} +,{"struct": "vr::HmdQuaternionf_t","fields": [ +{ "fieldname": "w", "fieldtype": "float"}, +{ "fieldname": "x", "fieldtype": "float"}, +{ "fieldname": "y", "fieldtype": "float"}, +{ "fieldname": "z", "fieldtype": "float"}]} ,{"struct": "vr::HmdColor_t","fields": [ { "fieldname": "r", "fieldtype": "float"}, { "fieldname": "g", "fieldtype": "float"}, @@ -1291,7 +1423,8 @@ { "fieldname": "oldPid", "fieldtype": "uint32_t"}, { "fieldname": "bForced", "fieldtype": "_Bool"}]} ,{"struct": "vr::VREvent_Overlay_t","fields": [ -{ "fieldname": "overlayHandle", "fieldtype": "uint64_t"}]} +{ "fieldname": "overlayHandle", "fieldtype": "uint64_t"}, +{ "fieldname": "devicePath", "fieldtype": "uint64_t"}]} ,{"struct": "vr::VREvent_Status_t","fields": [ { "fieldname": "statusState", "fieldtype": "uint32_t"}]} ,{"struct": "vr::VREvent_Keyboard_t","fields": [ @@ -1304,7 +1437,9 @@ { "fieldname": "m_nCurrentUniverse", "fieldtype": "uint64_t"}]} ,{"struct": "vr::VREvent_Reserved_t","fields": [ { "fieldname": "reserved0", "fieldtype": "uint64_t"}, -{ "fieldname": "reserved1", "fieldtype": "uint64_t"}]} +{ "fieldname": "reserved1", "fieldtype": "uint64_t"}, +{ "fieldname": "reserved2", "fieldtype": "uint64_t"}, +{ "fieldname": "reserved3", "fieldtype": "uint64_t"}]} ,{"struct": "vr::VREvent_PerformanceTest_t","fields": [ { "fieldname": "m_nFidelityLevel", "fieldtype": "uint32_t"}]} ,{"struct": "vr::VREvent_SeatedZeroPoseReset_t","fields": [ @@ -1337,6 +1472,12 @@ { "fieldname": "fDurationSeconds", "fieldtype": "float"}, { "fieldname": "fFrequency", "fieldtype": "float"}, { "fieldname": "fAmplitude", "fieldtype": "float"}]} +,{"struct": "vr::VREvent_WebConsole_t","fields": [ +{ "fieldname": "webConsoleHandle", "fieldtype": "WebConsoleHandle_t"}]} +,{"struct": "vr::VREvent_InputBindingLoad_t","fields": [ +{ "fieldname": "ulAppContainer", "fieldtype": "vr::PropertyContainerHandle_t"}, +{ "fieldname": "pathMessage", "fieldtype": "uint64_t"}, +{ "fieldname": "pathUrl", "fieldtype": "uint64_t"}]} ,{"struct": "vr::(anonymous)","fields": [ { "fieldname": "reserved", "fieldtype": "struct vr::VREvent_Reserved_t"}, { "fieldname": "controller", "fieldtype": "struct vr::VREvent_Controller_t"}, @@ -1359,7 +1500,9 @@ { "fieldname": "messageOverlay", "fieldtype": "struct vr::VREvent_MessageOverlay_t"}, { "fieldname": "property", "fieldtype": "struct vr::VREvent_Property_t"}, { "fieldname": "dualAnalog", "fieldtype": "struct vr::VREvent_DualAnalog_t"}, -{ "fieldname": "hapticVibration", "fieldtype": "struct vr::VREvent_HapticVibration_t"}]} +{ "fieldname": "hapticVibration", "fieldtype": "struct vr::VREvent_HapticVibration_t"}, +{ "fieldname": "webConsole", "fieldtype": "struct vr::VREvent_WebConsole_t"}, +{ "fieldname": "inputBinding", "fieldtype": "struct vr::VREvent_InputBindingLoad_t"}]} ,{"struct": "vr::VREvent_t","fields": [ { "fieldname": "eventType", "fieldtype": "uint32_t"}, { "fieldname": "trackedDeviceIndex", "fieldtype": "TrackedDeviceIndex_t"}, @@ -1391,6 +1534,9 @@ { "fieldname": "gridWidth", "fieldtype": "float"}, { "fieldname": "gridScale", "fieldtype": "float"}, { "fieldname": "transform", "fieldtype": "struct vr::HmdMatrix44_t"}]} +,{"struct": "vr::VRBoneTransform_t","fields": [ +{ "fieldname": "position", "fieldtype": "struct vr::HmdVector4_t"}, +{ "fieldname": "orientation", "fieldtype": "struct vr::HmdQuaternionf_t"}]} ,{"struct": "vr::CameraVideoStreamFrameHeader_t","fields": [ { "fieldname": "eFrameType", "fieldtype": "enum vr::EVRTrackedCameraFrameType"}, { "fieldname": "nWidth", "fieldtype": "uint32_t"}, @@ -1404,6 +1550,11 @@ { "fieldname": "m_nNumMisPresented", "fieldtype": "uint32_t"}, { "fieldname": "m_nNumDroppedFrames", "fieldtype": "uint32_t"}, { "fieldname": "m_nReprojectionFlags", "fieldtype": "uint32_t"}]} +,{"struct": "vr::ImuSample_t","fields": [ +{ "fieldname": "fSampleTime", "fieldtype": "double"}, +{ "fieldname": "vAccel", "fieldtype": "struct vr::HmdVector3d_t"}, +{ "fieldname": "vGyro", "fieldtype": "struct vr::HmdVector3d_t"}, +{ "fieldname": "unOffScaleFlags", "fieldtype": "uint32_t"}]} ,{"struct": "vr::AppOverrideKeys_t","fields": [ { "fieldname": "pchKey", "fieldtype": "const char *"}, { "fieldname": "pchValue", "fieldtype": "const char *"}]} @@ -1497,6 +1648,37 @@ { "fieldname": "m_nWidth", "fieldtype": "int32_t"}, { "fieldname": "m_nHeight", "fieldtype": "int32_t"}, { "fieldname": "m_nBytesPerPixel", "fieldtype": "int32_t"}]} +,{"struct": "vr::InputAnalogActionData_t","fields": [ +{ "fieldname": "bActive", "fieldtype": "_Bool"}, +{ "fieldname": "activeOrigin", "fieldtype": "VRInputValueHandle_t"}, +{ "fieldname": "x", "fieldtype": "float"}, +{ "fieldname": "y", "fieldtype": "float"}, +{ "fieldname": "z", "fieldtype": "float"}, +{ "fieldname": "deltaX", "fieldtype": "float"}, +{ "fieldname": "deltaY", "fieldtype": "float"}, +{ "fieldname": "deltaZ", "fieldtype": "float"}, +{ "fieldname": "fUpdateTime", "fieldtype": "float"}]} +,{"struct": "vr::InputDigitalActionData_t","fields": [ +{ "fieldname": "bActive", "fieldtype": "_Bool"}, +{ "fieldname": "activeOrigin", "fieldtype": "VRInputValueHandle_t"}, +{ "fieldname": "bState", "fieldtype": "_Bool"}, +{ "fieldname": "bChanged", "fieldtype": "_Bool"}, +{ "fieldname": "fUpdateTime", "fieldtype": "float"}]} +,{"struct": "vr::InputPoseActionData_t","fields": [ +{ "fieldname": "bActive", "fieldtype": "_Bool"}, +{ "fieldname": "activeOrigin", "fieldtype": "VRInputValueHandle_t"}, +{ "fieldname": "pose", "fieldtype": "struct vr::TrackedDevicePose_t"}]} +,{"struct": "vr::InputSkeletonActionData_t","fields": [ +{ "fieldname": "bActive", "fieldtype": "_Bool"}, +{ "fieldname": "activeOrigin", "fieldtype": "VRInputValueHandle_t"}]} +,{"struct": "vr::InputOriginInfo_t","fields": [ +{ "fieldname": "devicePath", "fieldtype": "VRInputValueHandle_t"}, +{ "fieldname": "trackedDeviceIndex", "fieldtype": "TrackedDeviceIndex_t"}, +{ "fieldname": "rchRenderModelComponentName", "fieldtype": "char [128]"}]} +,{"struct": "vr::VRActiveActionSet_t","fields": [ +{ "fieldname": "ulActionSet", "fieldtype": "VRActionSetHandle_t"}, +{ "fieldname": "ulRestrictedToDevice", "fieldtype": "VRInputValueHandle_t"}, +{ "fieldname": "ulSecondaryActionSet", "fieldtype": "VRActionSetHandle_t"}]} ,{"struct": "vr::COpenVRContext","fields": [ { "fieldname": "m_pVRSystem", "fieldtype": "class vr::IVRSystem *"}, { "fieldname": "m_pVRChaperone", "fieldtype": "class vr::IVRChaperone *"}, @@ -1510,7 +1692,9 @@ { "fieldname": "m_pVRApplications", "fieldtype": "class vr::IVRApplications *"}, { "fieldname": "m_pVRTrackedCamera", "fieldtype": "class vr::IVRTrackedCamera *"}, { "fieldname": "m_pVRScreenshots", "fieldtype": "class vr::IVRScreenshots *"}, -{ "fieldname": "m_pVRDriverManager", "fieldtype": "class vr::IVRDriverManager *"}]} +{ "fieldname": "m_pVRDriverManager", "fieldtype": "class vr::IVRDriverManager *"}, +{ "fieldname": "m_pVRInput", "fieldtype": "class vr::IVRInput *"}, +{ "fieldname": "m_pVRIOBuffer", "fieldtype": "class vr::IVRIOBuffer *"}]} ], "methods":[{ "classname": "vr::IVRSystem", @@ -4065,5 +4249,241 @@ { "paramname": "unBufferSize" ,"paramtype": "uint32_t"} ] } +,{ + "classname": "vr::IVRDriverManager", + "methodname": "GetDriverHandle", + "returntype": "DriverHandle_t", + "params": [ +{ "paramname": "pchDriverName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "SetActionManifestPath", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "pchActionManifestPath" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetActionSetHandle", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "pchActionSetName" ,"paramtype": "const char *"}, +{ "paramname": "pHandle" ,"paramtype": "vr::VRActionSetHandle_t *"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetActionHandle", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "pchActionName" ,"paramtype": "const char *"}, +{ "paramname": "pHandle" ,"paramtype": "vr::VRActionHandle_t *"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetInputSourceHandle", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "pchInputSourcePath" ,"paramtype": "const char *"}, +{ "paramname": "pHandle" ,"paramtype": "vr::VRInputValueHandle_t *"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "UpdateActionState", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "pSets" ,"array_count": "unSetCount" ,"paramtype": "struct vr::VRActiveActionSet_t *"}, +{ "paramname": "unSizeOfVRSelectedActionSet_t" ,"paramtype": "uint32_t"}, +{ "paramname": "unSetCount" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetDigitalActionData", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "action" ,"paramtype": "vr::VRActionHandle_t"}, +{ "paramname": "pActionData" ,"paramtype": "struct vr::InputDigitalActionData_t *"}, +{ "paramname": "unActionDataSize" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetAnalogActionData", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "action" ,"paramtype": "vr::VRActionHandle_t"}, +{ "paramname": "pActionData" ,"paramtype": "struct vr::InputAnalogActionData_t *"}, +{ "paramname": "unActionDataSize" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetPoseActionData", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "action" ,"paramtype": "vr::VRActionHandle_t"}, +{ "paramname": "eOrigin" ,"paramtype": "vr::ETrackingUniverseOrigin"}, +{ "paramname": "fPredictedSecondsFromNow" ,"paramtype": "float"}, +{ "paramname": "pActionData" ,"paramtype": "struct vr::InputPoseActionData_t *"}, +{ "paramname": "unActionDataSize" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetSkeletalActionData", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "action" ,"paramtype": "vr::VRActionHandle_t"}, +{ "paramname": "eBoneParent" ,"paramtype": "vr::EVRSkeletalTransformSpace"}, +{ "paramname": "fPredictedSecondsFromNow" ,"paramtype": "float"}, +{ "paramname": "pActionData" ,"paramtype": "struct vr::InputSkeletonActionData_t *"}, +{ "paramname": "unActionDataSize" ,"paramtype": "uint32_t"}, +{ "paramname": "pTransformArray" ,"array_count": "unTransformArrayCount" ,"paramtype": "struct vr::VRBoneTransform_t *"}, +{ "paramname": "unTransformArrayCount" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetSkeletalActionDataCompressed", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "action" ,"paramtype": "vr::VRActionHandle_t"}, +{ "paramname": "eBoneParent" ,"paramtype": "vr::EVRSkeletalTransformSpace"}, +{ "paramname": "fPredictedSecondsFromNow" ,"paramtype": "float"}, +{ "paramname": "pvCompressedData" ,"out_buffer_count": "unCompressedSize" ,"paramtype": "void *"}, +{ "paramname": "unCompressedSize" ,"paramtype": "uint32_t"}, +{ "paramname": "punRequiredCompressedSize" ,"paramtype": "uint32_t *"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "UncompressSkeletalActionData", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "pvCompressedBuffer" ,"paramtype": "void *"}, +{ "paramname": "unCompressedBufferSize" ,"paramtype": "uint32_t"}, +{ "paramname": "peBoneParent" ,"paramtype": "vr::EVRSkeletalTransformSpace *"}, +{ "paramname": "pTransformArray" ,"array_count": "unTransformArrayCount" ,"paramtype": "struct vr::VRBoneTransform_t *"}, +{ "paramname": "unTransformArrayCount" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "TriggerHapticVibrationAction", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "action" ,"paramtype": "vr::VRActionHandle_t"}, +{ "paramname": "fStartSecondsFromNow" ,"paramtype": "float"}, +{ "paramname": "fDurationSeconds" ,"paramtype": "float"}, +{ "paramname": "fFrequency" ,"paramtype": "float"}, +{ "paramname": "fAmplitude" ,"paramtype": "float"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetActionOrigins", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "actionSetHandle" ,"paramtype": "vr::VRActionSetHandle_t"}, +{ "paramname": "digitalActionHandle" ,"paramtype": "vr::VRActionHandle_t"}, +{ "paramname": "originsOut" ,"array_count": "originOutCount" ,"paramtype": "vr::VRInputValueHandle_t *"}, +{ "paramname": "originOutCount" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetOriginLocalizedName", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "origin" ,"paramtype": "vr::VRInputValueHandle_t"}, +{ "paramname": "pchNameArray" ,"out_string": " " ,"paramtype": "char *"}, +{ "paramname": "unNameArraySize" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "GetOriginTrackedDeviceInfo", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "origin" ,"paramtype": "vr::VRInputValueHandle_t"}, +{ "paramname": "pOriginInfo" ,"paramtype": "struct vr::InputOriginInfo_t *"}, +{ "paramname": "unOriginInfoSize" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "ShowActionOrigins", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "actionSetHandle" ,"paramtype": "vr::VRActionSetHandle_t"}, +{ "paramname": "ulActionHandle" ,"paramtype": "vr::VRActionHandle_t"} + ] +} +,{ + "classname": "vr::IVRInput", + "methodname": "ShowBindingsForActionSet", + "returntype": "vr::EVRInputError", + "params": [ +{ "paramname": "pSets" ,"array_count": "unSetCount" ,"paramtype": "struct vr::VRActiveActionSet_t *"}, +{ "paramname": "unSizeOfVRSelectedActionSet_t" ,"paramtype": "uint32_t"}, +{ "paramname": "unSetCount" ,"paramtype": "uint32_t"}, +{ "paramname": "originToHighlight" ,"paramtype": "vr::VRInputValueHandle_t"} + ] +} +,{ + "classname": "vr::IVRIOBuffer", + "methodname": "Open", + "returntype": "vr::EIOBufferError", + "params": [ +{ "paramname": "pchPath" ,"paramtype": "const char *"}, +{ "paramname": "mode" ,"paramtype": "vr::EIOBufferMode"}, +{ "paramname": "unElementSize" ,"paramtype": "uint32_t"}, +{ "paramname": "unElements" ,"paramtype": "uint32_t"}, +{ "paramname": "pulBuffer" ,"paramtype": "vr::IOBufferHandle_t *"} + ] +} +,{ + "classname": "vr::IVRIOBuffer", + "methodname": "Close", + "returntype": "vr::EIOBufferError", + "params": [ +{ "paramname": "ulBuffer" ,"paramtype": "vr::IOBufferHandle_t"} + ] +} +,{ + "classname": "vr::IVRIOBuffer", + "methodname": "Read", + "returntype": "vr::EIOBufferError", + "params": [ +{ "paramname": "ulBuffer" ,"paramtype": "vr::IOBufferHandle_t"}, +{ "paramname": "pDst" ,"paramtype": "void *"}, +{ "paramname": "unBytes" ,"paramtype": "uint32_t"}, +{ "paramname": "punRead" ,"paramtype": "uint32_t *"} + ] +} +,{ + "classname": "vr::IVRIOBuffer", + "methodname": "Write", + "returntype": "vr::EIOBufferError", + "params": [ +{ "paramname": "ulBuffer" ,"paramtype": "vr::IOBufferHandle_t"}, +{ "paramname": "pSrc" ,"paramtype": "void *"}, +{ "paramname": "unBytes" ,"paramtype": "uint32_t"} + ] +} +,{ + "classname": "vr::IVRIOBuffer", + "methodname": "PropertyContainer", + "returntype": "vr::PropertyContainerHandle_t", + "params": [ +{ "paramname": "ulBuffer" ,"paramtype": "vr::IOBufferHandle_t"} + ] +} ] } \ No newline at end of file diff --git a/OpenVR/headers/openvr_capi.h b/OpenVR/headers/openvr_capi.h index e32fb64..ee24e90 100644 --- a/OpenVR/headers/openvr_capi.h +++ b/OpenVR/headers/openvr_capi.h @@ -71,6 +71,7 @@ static const unsigned int k_unTrackedDeviceIndexOther = 4294967294; static const unsigned int k_unTrackedDeviceIndexInvalid = 4294967295; static const unsigned long k_ulInvalidPropertyContainer = 0; static const unsigned int k_unInvalidPropertyTag = 0; +static const unsigned long k_ulInvalidDriverHandle = 0; static const unsigned int k_unFloatPropertyTag = 1; static const unsigned int k_unInt32PropertyTag = 2; static const unsigned int k_unUint64PropertyTag = 3; @@ -86,6 +87,7 @@ static const unsigned int k_unActionPropertyTag = 32; static const unsigned int k_unInputValuePropertyTag = 33; static const unsigned int k_unWildcardPropertyTag = 34; static const unsigned int k_unHapticVibrationPropertyTag = 35; +static const unsigned int k_unSkeletonPropertyTag = 36; static const unsigned int k_unOpenVRInternalReserved_Start = 1000; static const unsigned int k_unOpenVRInternalReserved_End = 10000; static const unsigned int k_unMaxPropertyStringSize = 32768; @@ -160,10 +162,14 @@ static const char * k_pch_SteamVR_CycleBackgroundImageTimeSec_Int32 = "CycleBack static const char * k_pch_SteamVR_RetailDemo_Bool = "retailDemo"; static const char * k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; static const char * k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; +static const char * k_pch_SteamVR_SupersampleManualOverride_Bool = "supersampleManualOverride"; static const char * k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; static const char * k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; static const char * k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; static const char * k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; +static const char * k_pch_SteamVR_DebugInput = "debugInput"; +static const char * k_pch_SteamVR_LegacyInputRebinding = "legacyInputRebinding"; +static const char * k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; static const char * k_pch_Lighthouse_Section = "driver_lighthouse"; static const char * k_pch_Lighthouse_DisableIMU_Bool = "disableimu"; static const char * k_pch_Lighthouse_DisableIMUExceptHMD_Bool = "disableimuexcepthmd"; @@ -172,6 +178,7 @@ static const char * k_pch_Lighthouse_DisambiguationDebug_Int32 = "disambiguation static const char * k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; static const char * k_pch_Lighthouse_DBHistory_Bool = "dbhistory"; static const char * k_pch_Lighthouse_EnableBluetooth_Bool = "enableBluetooth"; +static const char * k_pch_Lighthouse_PowerManagedBaseStations_String = "PowerManagedBaseStations"; static const char * k_pch_Null_Section = "driver_null"; static const char * k_pch_Null_SerialNumber_String = "serialNumber"; static const char * k_pch_Null_ModelNumber_String = "modelNumber"; @@ -226,6 +233,7 @@ static const char * k_pch_Camera_BoundsColorGammaG_Int32 = "cameraBoundsColorGam static const char * k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB"; static const char * k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA"; static const char * k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength"; +static const char * k_pch_Camera_RoomViewMode_Int32 = "cameraRoomViewMode"; static const char * k_pch_audio_Section = "audio"; static const char * k_pch_audio_OnPlaybackDevice_String = "onPlaybackDevice"; static const char * k_pch_audio_OnRecordDevice_String = "onRecordDevice"; @@ -243,11 +251,29 @@ static const char * k_pch_Power_PauseCompositorOnStandby_Bool = "pauseCompositor static const char * k_pch_Dashboard_Section = "dashboard"; static const char * k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; static const char * k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; +static const char * k_pch_Dashboard_EnableWebUI = "webUI"; +static const char * k_pch_Dashboard_EnableWebUIDevTools = "webUIDevTools"; static const char * k_pch_modelskin_Section = "modelskins"; static const char * k_pch_Driver_Enable_Bool = "enable"; +static const char * k_pch_WebInterface_Section = "WebInterface"; +static const char * k_pch_WebInterface_WebPort_String = "WebPort"; +static const char * k_pch_TrackingOverride_Section = "TrackingOverrides"; +static const char * k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; +static const char * k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; +static const char * k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; +static const char * k_pch_App_ActionManifestURL_String = "ActionManifestURL"; static const char * IVRScreenshots_Version = "IVRScreenshots_001"; static const char * IVRResources_Version = "IVRResources_001"; static const char * IVRDriverManager_Version = "IVRDriverManager_001"; +static const unsigned long k_ulInvalidActionHandle = 0; +static const unsigned long k_ulInvalidActionSetHandle = 0; +static const unsigned long k_ulInvalidInputValueHandle = 0; +static const unsigned int k_unMaxActionNameLength = 64; +static const unsigned int k_unMaxActionSetNameLength = 64; +static const unsigned int k_unMaxActionOriginCount = 16; +static const char * IVRInput_Version = "IVRInput_003"; +static const unsigned long k_ulInvalidIOBufferHandle = 0; +static const char * IVRIOBuffer_Version = "IVRIOBuffer_001"; // OpenVR Enums @@ -264,6 +290,7 @@ typedef enum ETextureType ETextureType_TextureType_Vulkan = 2, ETextureType_TextureType_IOSurface = 3, ETextureType_TextureType_DirectX12 = 4, + ETextureType_TextureType_DXGISharedHandle = 5, } ETextureType; typedef enum EColorSpace @@ -297,6 +324,8 @@ typedef enum ETrackedControllerRole ETrackedControllerRole_TrackedControllerRole_Invalid = 0, ETrackedControllerRole_TrackedControllerRole_LeftHand = 1, ETrackedControllerRole_TrackedControllerRole_RightHand = 2, + ETrackedControllerRole_TrackedControllerRole_OptOut = 3, + ETrackedControllerRole_TrackedControllerRole_Max = 4, } ETrackedControllerRole; typedef enum ETrackingUniverseOrigin @@ -347,6 +376,9 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_ResourceRoot_String = 1035, ETrackedDeviceProperty_Prop_RegisteredDeviceType_String = 1036, ETrackedDeviceProperty_Prop_InputProfilePath_String = 1037, + ETrackedDeviceProperty_Prop_NeverTracked_Bool = 1038, + ETrackedDeviceProperty_Prop_NumCameras_Int32 = 1039, + ETrackedDeviceProperty_Prop_CameraFrameLayout_Int32 = 1040, ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool = 2000, ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float = 2001, ETrackedDeviceProperty_Prop_DisplayFrequency_Float = 2002, @@ -401,9 +433,18 @@ typedef enum ETrackedDeviceProperty ETrackedDeviceProperty_Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, ETrackedDeviceProperty_Prop_DoNotApplyPrediction_Bool = 2054, ETrackedDeviceProperty_Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + ETrackedDeviceProperty_Prop_DistortionMeshResolution_Int32 = 2056, ETrackedDeviceProperty_Prop_DriverIsDrawingControllers_Bool = 2057, ETrackedDeviceProperty_Prop_DriverRequestsApplicationPause_Bool = 2058, ETrackedDeviceProperty_Prop_DriverRequestsReducedRendering_Bool = 2059, + ETrackedDeviceProperty_Prop_MinimumIpdStepMeters_Float = 2060, + ETrackedDeviceProperty_Prop_AudioBridgeFirmwareVersion_Uint64 = 2061, + ETrackedDeviceProperty_Prop_ImageBridgeFirmwareVersion_Uint64 = 2062, + ETrackedDeviceProperty_Prop_ImuToHeadTransform_Matrix34 = 2063, + ETrackedDeviceProperty_Prop_ImuFactoryGyroBias_Vector3 = 2064, + ETrackedDeviceProperty_Prop_ImuFactoryGyroScale_Vector3 = 2065, + ETrackedDeviceProperty_Prop_ImuFactoryAccelerometerBias_Vector3 = 2066, + ETrackedDeviceProperty_Prop_ImuFactoryAccelerometerScale_Vector3 = 2067, ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000, ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001, ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002, @@ -530,6 +571,8 @@ typedef enum EVREventType EVREventType_VREvent_SceneFocusChanged = 405, EVREventType_VREvent_InputFocusChanged = 406, EVREventType_VREvent_SceneApplicationSecondaryRenderingStarted = 407, + EVREventType_VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, + EVREventType_VREvent_ActionBindingReloaded = 409, EVREventType_VREvent_HideRenderModels = 410, EVREventType_VREvent_ShowRenderModels = 411, EVREventType_VREvent_ConsoleOpened = 420, @@ -548,17 +591,18 @@ typedef enum EVREventType EVREventType_VREvent_OverlayGamepadFocusGained = 511, EVREventType_VREvent_OverlayGamepadFocusLost = 512, EVREventType_VREvent_OverlaySharedTextureChanged = 513, - EVREventType_VREvent_DashboardGuideButtonDown = 514, - EVREventType_VREvent_DashboardGuideButtonUp = 515, EVREventType_VREvent_ScreenshotTriggered = 516, EVREventType_VREvent_ImageFailed = 517, EVREventType_VREvent_DashboardOverlayCreated = 518, + EVREventType_VREvent_SwitchGamepadFocus = 519, EVREventType_VREvent_RequestScreenshot = 520, EVREventType_VREvent_ScreenshotTaken = 521, EVREventType_VREvent_ScreenshotFailed = 522, EVREventType_VREvent_SubmitScreenshotToDashboard = 523, EVREventType_VREvent_ScreenshotProgressToDashboard = 524, EVREventType_VREvent_PrimaryDashboardDeviceChanged = 525, + EVREventType_VREvent_RoomViewShown = 526, + EVREventType_VREvent_RoomViewHidden = 527, EVREventType_VREvent_Notification_Shown = 600, EVREventType_VREvent_Notification_Hidden = 601, EVREventType_VREvent_Notification_BeginInteraction = 602, @@ -621,6 +665,8 @@ typedef enum EVREventType EVREventType_VREvent_MessageOverlay_Closed = 1650, EVREventType_VREvent_MessageOverlayCloseRequested = 1651, EVREventType_VREvent_Input_HapticVibration = 1700, + EVREventType_VREvent_Input_BindingLoadFailed = 1701, + EVREventType_VREvent_Input_BindingLoadSuccessful = 1702, EVREventType_VREvent_VendorSpecific_Reserved_Start = 10000, EVREventType_VREvent_VendorSpecific_Reserved_End = 19999, } EVREventType; @@ -681,6 +727,12 @@ typedef enum EVRInputError EVRInputError_VRInputError_IPCError = 7, EVRInputError_VRInputError_NoActiveActionSet = 8, EVRInputError_VRInputError_InvalidDevice = 9, + EVRInputError_VRInputError_InvalidSkeleton = 10, + EVRInputError_VRInputError_InvalidBoneCount = 11, + EVRInputError_VRInputError_InvalidCompressedData = 12, + EVRInputError_VRInputError_NoData = 13, + EVRInputError_VRInputError_BufferTooSmall = 14, + EVRInputError_VRInputError_MismatchedActionManifest = 15, } EVRInputError; typedef enum EHiddenAreaMeshType @@ -817,6 +869,7 @@ typedef enum EVRInitError EVRInitError_VRInitError_Init_FirmwareUpdateBusy = 138, EVRInitError_VRInitError_Init_FirmwareRecoveryBusy = 139, EVRInitError_VRInitError_Init_USBServiceBusy = 140, + EVRInitError_VRInitError_Init_VRWebHelperStartupFailed = 141, EVRInitError_VRInitError_Driver_Failed = 200, EVRInitError_VRInitError_Driver_Unknown = 201, EVRInitError_VRInitError_Driver_HmdUnknown = 202, @@ -899,6 +952,14 @@ typedef enum EVRTrackedCameraError EVRTrackedCameraError_VRTrackedCameraError_InvalidFrameBufferSize = 115, } EVRTrackedCameraError; +typedef enum EVRTrackedCameraFrameLayout +{ + EVRTrackedCameraFrameLayout_Mono = 1, + EVRTrackedCameraFrameLayout_Stereo = 2, + EVRTrackedCameraFrameLayout_VerticalLayout = 16, + EVRTrackedCameraFrameLayout_HorizontalLayout = 32, +} EVRTrackedCameraFrameLayout; + typedef enum EVRTrackedCameraFrameType { EVRTrackedCameraFrameType_VRTrackedCameraFrameType_Distorted = 0, @@ -907,6 +968,23 @@ typedef enum EVRTrackedCameraFrameType EVRTrackedCameraFrameType_MAX_CAMERA_FRAME_TYPES = 3, } EVRTrackedCameraFrameType; +typedef enum EVSync +{ + EVSync_VSync_None = 0, + EVSync_VSync_WaitRender = 1, + EVSync_VSync_NoWaitRender = 2, +} EVSync; + +typedef enum Imu_OffScaleFlags +{ + Imu_OffScaleFlags_OffScale_AccelX = 1, + Imu_OffScaleFlags_OffScale_AccelY = 2, + Imu_OffScaleFlags_OffScale_AccelZ = 4, + Imu_OffScaleFlags_OffScale_GyroX = 8, + Imu_OffScaleFlags_OffScale_GyroY = 16, + Imu_OffScaleFlags_OffScale_GyroZ = 32, +} Imu_OffScaleFlags; + typedef enum EVRApplicationError { EVRApplicationError_VRApplicationError_None = 0, @@ -1145,6 +1223,37 @@ typedef enum EVRScreenshotError EVRScreenshotError_VRScreenshotError_ScreenshotAlreadyInProgress = 108, } EVRScreenshotError; +typedef enum EVRSkeletalTransformSpace +{ + EVRSkeletalTransformSpace_VRSkeletalTransformSpace_Action = 0, + EVRSkeletalTransformSpace_VRSkeletalTransformSpace_Parent = 1, + EVRSkeletalTransformSpace_VRSkeletalTransformSpace_Additive = 2, +} EVRSkeletalTransformSpace; + +typedef enum EVRInputFilterCancelType +{ + EVRInputFilterCancelType_VRInputFilterCancel_Timers = 0, + EVRInputFilterCancelType_VRInputFilterCancel_Momentum = 1, +} EVRInputFilterCancelType; + +typedef enum EIOBufferError +{ + EIOBufferError_IOBuffer_Success = 0, + EIOBufferError_IOBuffer_OperationFailed = 100, + EIOBufferError_IOBuffer_InvalidHandle = 101, + EIOBufferError_IOBuffer_InvalidArgument = 102, + EIOBufferError_IOBuffer_PathExists = 103, + EIOBufferError_IOBuffer_PathDoesNotExist = 104, + EIOBufferError_IOBuffer_Permission = 105, +} EIOBufferError; + +typedef enum EIOBufferMode +{ + EIOBufferMode_IOBufferMode_Read = 1, + EIOBufferMode_IOBufferMode_Write = 2, + EIOBufferMode_IOBufferMode_Create = 512, +} EIOBufferMode; + // OpenVR typedefs @@ -1158,14 +1267,20 @@ typedef uint32_t glUInt_t; typedef uint64_t SharedTextureHandle_t; typedef uint32_t DriverId_t; typedef uint32_t TrackedDeviceIndex_t; +typedef uint64_t WebConsoleHandle_t; typedef uint64_t PropertyContainerHandle_t; typedef uint32_t PropertyTypeTag_t; +typedef PropertyContainerHandle_t DriverHandle_t; typedef uint64_t VROverlayHandle_t; typedef uint64_t TrackedCameraHandle_t; typedef uint32_t ScreenshotHandle_t; typedef uint32_t VRComponentProperties; typedef int32_t TextureID_t; typedef uint32_t VRNotificationId; +typedef uint64_t VRActionHandle_t; +typedef uint64_t VRActionSetHandle_t; +typedef uint64_t VRInputValueHandle_t; +typedef uint64_t IOBufferHandle_t; typedef EVRInitError HmdError; typedef EVREye Hmd_Eye; typedef EColorSpace ColorSpace; @@ -1222,6 +1337,14 @@ typedef struct HmdQuaternion_t double z; } HmdQuaternion_t; +typedef struct HmdQuaternionf_t +{ + float w; + float x; + float y; + float z; +} HmdQuaternionf_t; + typedef struct HmdColor_t { float r; @@ -1361,6 +1484,7 @@ typedef struct VREvent_Process_t typedef struct VREvent_Overlay_t { uint64_t overlayHandle; + uint64_t devicePath; } VREvent_Overlay_t; typedef struct VREvent_Status_t @@ -1389,6 +1513,8 @@ typedef struct VREvent_Reserved_t { uint64_t reserved0; uint64_t reserved1; + uint64_t reserved2; + uint64_t reserved3; } VREvent_Reserved_t; typedef struct VREvent_PerformanceTest_t @@ -1453,6 +1579,18 @@ typedef struct VREvent_HapticVibration_t float fAmplitude; } VREvent_HapticVibration_t; +typedef struct VREvent_WebConsole_t +{ + WebConsoleHandle_t webConsoleHandle; +} VREvent_WebConsole_t; + +typedef struct VREvent_InputBindingLoad_t +{ + PropertyContainerHandle_t ulAppContainer; + uint64_t pathMessage; + uint64_t pathUrl; +} VREvent_InputBindingLoad_t; + typedef struct HiddenAreaMesh_t { struct HmdVector2_t * pVertexData; // const struct vr::HmdVector2_t * @@ -1491,6 +1629,12 @@ typedef struct Compositor_OverlaySettings struct HmdMatrix44_t transform; } Compositor_OverlaySettings; +typedef struct VRBoneTransform_t +{ + struct HmdVector4_t position; + struct HmdQuaternionf_t orientation; +} VRBoneTransform_t; + typedef struct CameraVideoStreamFrameHeader_t { enum EVRTrackedCameraFrameType eFrameType; @@ -1510,6 +1654,14 @@ typedef struct DriverDirectMode_FrameTiming uint32_t m_nReprojectionFlags; } DriverDirectMode_FrameTiming; +typedef struct ImuSample_t +{ + double fSampleTime; + struct HmdVector3d_t vAccel; + struct HmdVector3d_t vGyro; + uint32_t unOffScaleFlags; +} ImuSample_t; + typedef struct AppOverrideKeys_t { char * pchKey; // const char * @@ -1648,6 +1800,55 @@ typedef struct NotificationBitmap_t int32_t m_nBytesPerPixel; } NotificationBitmap_t; +typedef struct InputAnalogActionData_t +{ + bool bActive; + VRInputValueHandle_t activeOrigin; + float x; + float y; + float z; + float deltaX; + float deltaY; + float deltaZ; + float fUpdateTime; +} InputAnalogActionData_t; + +typedef struct InputDigitalActionData_t +{ + bool bActive; + VRInputValueHandle_t activeOrigin; + bool bState; + bool bChanged; + float fUpdateTime; +} InputDigitalActionData_t; + +typedef struct InputPoseActionData_t +{ + bool bActive; + VRInputValueHandle_t activeOrigin; + struct TrackedDevicePose_t pose; +} InputPoseActionData_t; + +typedef struct InputSkeletonActionData_t +{ + bool bActive; + VRInputValueHandle_t activeOrigin; +} InputSkeletonActionData_t; + +typedef struct InputOriginInfo_t +{ + VRInputValueHandle_t devicePath; + TrackedDeviceIndex_t trackedDeviceIndex; + char * rchRenderModelComponentName[128]; //char[128] +} InputOriginInfo_t; + +typedef struct VRActiveActionSet_t +{ + VRActionSetHandle_t ulActionSet; + VRInputValueHandle_t ulRestrictedToDevice; + VRActionSetHandle_t ulSecondaryActionSet; +} VRActiveActionSet_t; + typedef struct COpenVRContext { intptr_t m_pVRSystem; // class vr::IVRSystem * @@ -1663,6 +1864,8 @@ typedef struct COpenVRContext intptr_t m_pVRTrackedCamera; // class vr::IVRTrackedCamera * intptr_t m_pVRScreenshots; // class vr::IVRScreenshots * intptr_t m_pVRDriverManager; // class vr::IVRDriverManager * + intptr_t m_pVRInput; // class vr::IVRInput * + intptr_t m_pVRIOBuffer; // class vr::IVRIOBuffer * } COpenVRContext; @@ -2053,6 +2256,37 @@ struct VR_IVRDriverManager_FnTable { uint32_t (OPENVR_FNTABLE_CALLTYPE *GetDriverCount)(); uint32_t (OPENVR_FNTABLE_CALLTYPE *GetDriverName)(DriverId_t nDriver, char * pchValue, uint32_t unBufferSize); + DriverHandle_t (OPENVR_FNTABLE_CALLTYPE *GetDriverHandle)(char * pchDriverName); +}; + +struct VR_IVRInput_FnTable +{ + EVRInputError (OPENVR_FNTABLE_CALLTYPE *SetActionManifestPath)(char * pchActionManifestPath); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetActionSetHandle)(char * pchActionSetName, VRActionSetHandle_t * pHandle); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetActionHandle)(char * pchActionName, VRActionHandle_t * pHandle); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetInputSourceHandle)(char * pchInputSourcePath, VRInputValueHandle_t * pHandle); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *UpdateActionState)(struct VRActiveActionSet_t * pSets, uint32_t unSizeOfVRSelectedActionSet_t, uint32_t unSetCount); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetDigitalActionData)(VRActionHandle_t action, struct InputDigitalActionData_t * pActionData, uint32_t unActionDataSize); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetAnalogActionData)(VRActionHandle_t action, struct InputAnalogActionData_t * pActionData, uint32_t unActionDataSize); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetPoseActionData)(VRActionHandle_t action, ETrackingUniverseOrigin eOrigin, float fPredictedSecondsFromNow, struct InputPoseActionData_t * pActionData, uint32_t unActionDataSize); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetSkeletalActionData)(VRActionHandle_t action, EVRSkeletalTransformSpace eBoneParent, float fPredictedSecondsFromNow, struct InputSkeletonActionData_t * pActionData, uint32_t unActionDataSize, struct VRBoneTransform_t * pTransformArray, uint32_t unTransformArrayCount); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetSkeletalActionDataCompressed)(VRActionHandle_t action, EVRSkeletalTransformSpace eBoneParent, float fPredictedSecondsFromNow, void * pvCompressedData, uint32_t unCompressedSize, uint32_t * punRequiredCompressedSize); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *UncompressSkeletalActionData)(void * pvCompressedBuffer, uint32_t unCompressedBufferSize, EVRSkeletalTransformSpace * peBoneParent, struct VRBoneTransform_t * pTransformArray, uint32_t unTransformArrayCount); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *TriggerHapticVibrationAction)(VRActionHandle_t action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetActionOrigins)(VRActionSetHandle_t actionSetHandle, VRActionHandle_t digitalActionHandle, VRInputValueHandle_t * originsOut, uint32_t originOutCount); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetOriginLocalizedName)(VRInputValueHandle_t origin, char * pchNameArray, uint32_t unNameArraySize); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *GetOriginTrackedDeviceInfo)(VRInputValueHandle_t origin, struct InputOriginInfo_t * pOriginInfo, uint32_t unOriginInfoSize); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *ShowActionOrigins)(VRActionSetHandle_t actionSetHandle, VRActionHandle_t ulActionHandle); + EVRInputError (OPENVR_FNTABLE_CALLTYPE *ShowBindingsForActionSet)(struct VRActiveActionSet_t * pSets, uint32_t unSizeOfVRSelectedActionSet_t, uint32_t unSetCount, VRInputValueHandle_t originToHighlight); +}; + +struct VR_IVRIOBuffer_FnTable +{ + EIOBufferError (OPENVR_FNTABLE_CALLTYPE *Open)(char * pchPath, EIOBufferMode mode, uint32_t unElementSize, uint32_t unElements, IOBufferHandle_t * pulBuffer); + EIOBufferError (OPENVR_FNTABLE_CALLTYPE *Close)(IOBufferHandle_t ulBuffer); + EIOBufferError (OPENVR_FNTABLE_CALLTYPE *Read)(IOBufferHandle_t ulBuffer, void * pDst, uint32_t unBytes, uint32_t * punRead); + EIOBufferError (OPENVR_FNTABLE_CALLTYPE *Write)(IOBufferHandle_t ulBuffer, void * pSrc, uint32_t unBytes); + PropertyContainerHandle_t (OPENVR_FNTABLE_CALLTYPE *PropertyContainer)(IOBufferHandle_t ulBuffer); }; diff --git a/OpenVR/headers/openvr_driver.h b/OpenVR/headers/openvr_driver.h index 301cd37..5ece0a0 100644 --- a/OpenVR/headers/openvr_driver.h +++ b/OpenVR/headers/openvr_driver.h @@ -73,6 +73,11 @@ struct HmdQuaternion_t double w, x, y, z; }; +struct HmdQuaternionf_t +{ + float w, x, y, z; +}; + struct HmdColor_t { float r, g, b, a; @@ -112,6 +117,8 @@ enum ETextureType TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurfaceRef TextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure + TextureType_DXGISharedHandle = 5, // Handle is a HANDLE DXGI share handle, only supported for Overlay render targets. + // this texture is used directly by our renderer, so only perform atomic (copyresource or resolve) on it }; enum EColorSpace @@ -173,6 +180,8 @@ enum ETrackedControllerRole TrackedControllerRole_Invalid = 0, // Invalid value for controller type TrackedControllerRole_LeftHand = 1, // Tracked device associated with the left hand TrackedControllerRole_RightHand = 2, // Tracked device associated with the right hand + TrackedControllerRole_OptOut = 3, // Tracked device is opting out of left/right hand selection + TrackedControllerRole_Max = 4 }; @@ -199,6 +208,9 @@ enum ETrackingUniverseOrigin TrackingUniverseRawAndUncalibrated = 2, // Poses are provided in the coordinate system defined by the driver. It has Y up and is unified for devices of the same driver. You usually don't want this one. }; +typedef uint64_t WebConsoleHandle_t; +#define INVALID_WEB_CONSOLE_HANDLE ((vr::WebConsoleHandle_t)0) + // Refers to a single container of properties typedef uint64_t PropertyContainerHandle_t; typedef uint32_t PropertyTypeTag_t; @@ -206,6 +218,9 @@ typedef uint32_t PropertyTypeTag_t; static const PropertyContainerHandle_t k_ulInvalidPropertyContainer = 0; static const PropertyTypeTag_t k_unInvalidPropertyTag = 0; +typedef PropertyContainerHandle_t DriverHandle_t; +static const PropertyContainerHandle_t k_ulInvalidDriverHandle = 0; + // Use these tags to set/get common types as struct properties static const PropertyTypeTag_t k_unFloatPropertyTag = 1; static const PropertyTypeTag_t k_unInt32PropertyTag = 2; @@ -224,6 +239,7 @@ static const PropertyTypeTag_t k_unActionPropertyTag = 32; static const PropertyTypeTag_t k_unInputValuePropertyTag = 33; static const PropertyTypeTag_t k_unWildcardPropertyTag = 34; static const PropertyTypeTag_t k_unHapticVibrationPropertyTag = 35; +static const PropertyTypeTag_t k_unSkeletonPropertyTag = 36; static const PropertyTypeTag_t k_unOpenVRInternalReserved_Start = 1000; static const PropertyTypeTag_t k_unOpenVRInternalReserved_End = 10000; @@ -274,6 +290,9 @@ enum ETrackedDeviceProperty Prop_ResourceRoot_String = 1035, Prop_RegisteredDeviceType_String = 1036, Prop_InputProfilePath_String = 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided + Prop_NeverTracked_Bool = 1038, // Used for devices that will never have a valid pose by design + Prop_NumCameras_Int32 = 1039, + Prop_CameraFrameLayout_Int32 = 1040, // EVRTrackedCameraFrameLayout value // Properties that are unique to TrackedDeviceClass_HMD Prop_ReportsTimeSinceVSync_Bool = 2000, @@ -330,9 +349,18 @@ enum ETrackedDeviceProperty Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, // placeholder icon for sensor/base if not yet detected/loaded Prop_DoNotApplyPrediction_Bool = 2054, Prop_CameraToHeadTransforms_Matrix34_Array = 2055, + Prop_DistortionMeshResolution_Int32 = 2056, // custom resolution of compositor calls to IVRSystem::ComputeDistortion Prop_DriverIsDrawingControllers_Bool = 2057, Prop_DriverRequestsApplicationPause_Bool = 2058, Prop_DriverRequestsReducedRendering_Bool = 2059, + Prop_MinimumIpdStepMeters_Float = 2060, + Prop_AudioBridgeFirmwareVersion_Uint64 = 2061, + Prop_ImageBridgeFirmwareVersion_Uint64 = 2062, + Prop_ImuToHeadTransform_Matrix34 = 2063, + Prop_ImuFactoryGyroBias_Vector3 = 2064, + Prop_ImuFactoryGyroScale_Vector3 = 2065, + Prop_ImuFactoryAccelerometerBias_Vector3 = 2066, + Prop_ImuFactoryAccelerometerScale_Vector3 = 2067, // Properties that are unique to TrackedDeviceClass_Controller Prop_AttachedDeviceId_String = 3000, @@ -554,6 +582,8 @@ enum EVREventType VREvent_SceneFocusChanged = 405, // data is process - New app got access to draw the scene VREvent_InputFocusChanged = 406, // data is process VREvent_SceneApplicationSecondaryRenderingStarted = 407, // data is process + VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, // data is process + VREvent_ActionBindingReloaded = 409, // data is process - The App that action binds reloaded for VREvent_HideRenderModels = 410, // Sent to the scene application to request hiding render models temporarily VREvent_ShowRenderModels = 411, // Sent to the scene application to request restoring render model visibility @@ -575,11 +605,12 @@ enum EVREventType VREvent_OverlayGamepadFocusGained = 511, // Sent to an overlay when IVROverlay::SetFocusOverlay is called on it VREvent_OverlayGamepadFocusLost = 512, // Send to an overlay when it previously had focus and IVROverlay::SetFocusOverlay is called on something else VREvent_OverlaySharedTextureChanged = 513, - VREvent_DashboardGuideButtonDown = 514, - VREvent_DashboardGuideButtonUp = 515, + //VREvent_DashboardGuideButtonDown = 514, // These are no longer sent + //VREvent_DashboardGuideButtonUp = 515, VREvent_ScreenshotTriggered = 516, // Screenshot button combo was pressed, Dashboard should request a screenshot VREvent_ImageFailed = 517, // Sent to overlays when a SetOverlayRaw or SetOverlayfromFail fails to load VREvent_DashboardOverlayCreated = 518, + VREvent_SwitchGamepadFocus = 519, // Screenshot API VREvent_RequestScreenshot = 520, // Sent by vrclient application to compositor to take a screenshot @@ -589,6 +620,8 @@ enum EVREventType VREvent_ScreenshotProgressToDashboard = 524, // Sent by compositor to the dashboard that a completed screenshot was submitted VREvent_PrimaryDashboardDeviceChanged = 525, + VREvent_RoomViewShown = 526, // Sent by compositor whenever room-view is enabled + VREvent_RoomViewHidden = 527, // Sent by compositor whenever room-view is disabled VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, @@ -667,6 +700,8 @@ enum EVREventType VREvent_MessageOverlayCloseRequested = 1651, VREvent_Input_HapticVibration = 1700, // data is hapticVibration + VREvent_Input_BindingLoadFailed = 1701, // data is process + VREvent_Input_BindingLoadSuccessful = 1702, // data is process // Vendors are free to expose private events in this reserved region VREvent_VendorSpecific_Reserved_Start = 10000, @@ -791,6 +826,7 @@ struct VREvent_Process_t struct VREvent_Overlay_t { uint64_t overlayHandle; + uint64_t devicePath; }; @@ -823,6 +859,8 @@ struct VREvent_Reserved_t { uint64_t reserved0; uint64_t reserved1; + uint64_t reserved2; + uint64_t reserved3; }; struct VREvent_PerformanceTest_t @@ -891,6 +929,18 @@ struct VREvent_HapticVibration_t float fAmplitude; }; +struct VREvent_WebConsole_t +{ + WebConsoleHandle_t webConsoleHandle; +}; + +struct VREvent_InputBindingLoad_t +{ + vr::PropertyContainerHandle_t ulAppContainer; + uint64_t pathMessage; + uint64_t pathUrl; +}; + /** NOTE!!! If you change this you MUST manually update openvr_interop.cs.py */ typedef union @@ -917,6 +967,8 @@ typedef union VREvent_Property_t property; VREvent_DualAnalog_t dualAnalog; VREvent_HapticVibration_t hapticVibration; + VREvent_WebConsole_t webConsole; + VREvent_InputBindingLoad_t inputBinding; } VREvent_Data_t; @@ -952,6 +1004,12 @@ enum EVRInputError VRInputError_IPCError = 7, VRInputError_NoActiveActionSet = 8, VRInputError_InvalidDevice = 9, + VRInputError_InvalidSkeleton = 10, + VRInputError_InvalidBoneCount = 11, + VRInputError_InvalidCompressedData = 12, + VRInputError_NoData = 13, + VRInputError_BufferTooSmall = 14, + VRInputError_MismatchedActionManifest = 15, }; @@ -1136,6 +1194,14 @@ enum EVRNotificationError }; +/** Holds the transform for a single bone */ +struct VRBoneTransform_t +{ + HmdVector4_t position; + HmdQuaternionf_t orientation; +}; + + /** error codes returned by Vr_Init */ // Please add adequate error description to https://developer.valvesoftware.com/w/index.php?title=Category:SteamVRHelp @@ -1185,6 +1251,7 @@ enum EVRInitError VRInitError_Init_FirmwareUpdateBusy = 138, VRInitError_Init_FirmwareRecoveryBusy = 139, VRInitError_Init_USBServiceBusy = 140, + VRInitError_Init_VRWebHelperStartupFailed = 141, VRInitError_Driver_Failed = 200, VRInitError_Driver_Unknown = 201, @@ -1274,6 +1341,14 @@ enum EVRTrackedCameraError VRTrackedCameraError_InvalidFrameBufferSize = 115, }; +enum EVRTrackedCameraFrameLayout +{ + EVRTrackedCameraFrameLayout_Mono = 0x0001, + EVRTrackedCameraFrameLayout_Stereo = 0x0002, + EVRTrackedCameraFrameLayout_VerticalLayout = 0x0010, // Stereo frames are Top/Bottom (left/right) + EVRTrackedCameraFrameLayout_HorizontalLayout = 0x0020, // Stereo frames are Left/Right +}; + enum EVRTrackedCameraFrameType { VRTrackedCameraFrameType_Distorted = 0, // This is the camera video frame size in pixels, still distorted. @@ -1313,6 +1388,32 @@ struct DriverDirectMode_FrameTiming uint32_t m_nReprojectionFlags; }; +enum EVSync +{ + VSync_None, + VSync_WaitRender, // block following render work until vsync + VSync_NoWaitRender, // do not block following render work (allow to get started early) +}; + +/** raw IMU data provided by IVRIOBuffer from paths to tracked devices with IMUs */ +enum Imu_OffScaleFlags +{ + OffScale_AccelX = 0x01, + OffScale_AccelY = 0x02, + OffScale_AccelZ = 0x04, + OffScale_GyroX = 0x08, + OffScale_GyroY = 0x10, + OffScale_GyroZ = 0x20, +}; + +struct ImuSample_t +{ + double fSampleTime; + HmdVector3d_t vAccel; + HmdVector3d_t vGyro; + uint32_t unOffScaleFlags; +}; + #pragma pack( pop ) // figure out how to import from the VR API dll @@ -1404,6 +1505,16 @@ enum ECameraCompatibilityMode MAX_CAMERA_COMPAT_MODES }; +enum ETrackedCameraRoomViewMode +{ + TRACKED_CAMERA_ROOMVIEW_MODE_DEFAULT = 0, + TRACKED_CAMERA_ROOMVIEW_MODE_EDGE_A, + TRACKED_CAMERA_ROOMVIEW_MODE_EDGE_B, + TRACKED_CAMERA_ROOMVIEW_MODE_VIDEO_TRANSLUSCENT, + TRACKED_CAMERA_ROOMVIEW_MODE_VIDEO_OPAQUE, + TRACKED_CAMERA_ROOMVIEW_MODE_COUNT, +}; + #ifdef _MSC_VER #define VR_CAMERA_DECL_ALIGN( x ) __declspec( align( x ) ) #else @@ -1545,10 +1656,14 @@ namespace vr static const char * const k_pch_SteamVR_RetailDemo_Bool = "retailDemo"; static const char * const k_pch_SteamVR_IpdOffset_Float = "ipdOffset"; static const char * const k_pch_SteamVR_AllowSupersampleFiltering_Bool = "allowSupersampleFiltering"; + static const char * const k_pch_SteamVR_SupersampleManualOverride_Bool = "supersampleManualOverride"; static const char * const k_pch_SteamVR_EnableLinuxVulkanAsync_Bool = "enableLinuxVulkanAsync"; static const char * const k_pch_SteamVR_AllowDisplayLockedMode_Bool = "allowDisplayLockedMode"; static const char * const k_pch_SteamVR_HaveStartedTutorialForNativeChaperoneDriver_Bool = "haveStartedTutorialForNativeChaperoneDriver"; static const char * const k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; + static const char * const k_pch_SteamVR_DebugInput = "debugInput"; + static const char * const k_pch_SteamVR_LegacyInputRebinding = "legacyInputRebinding"; + static const char * const k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; //----------------------------------------------------------------------------- // lighthouse keys @@ -1560,6 +1675,7 @@ namespace vr static const char * const k_pch_Lighthouse_PrimaryBasestation_Int32 = "primarybasestation"; static const char * const k_pch_Lighthouse_DBHistory_Bool = "dbhistory"; static const char * const k_pch_Lighthouse_EnableBluetooth_Bool = "enableBluetooth"; + static const char * const k_pch_Lighthouse_PowerManagedBaseStations_String = "PowerManagedBaseStations"; //----------------------------------------------------------------------------- // null keys @@ -1635,6 +1751,7 @@ namespace vr static const char * const k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB"; static const char * const k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA"; static const char * const k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength"; + static const char * const k_pch_Camera_RoomViewMode_Int32 = "cameraRoomViewMode"; //----------------------------------------------------------------------------- // audio keys @@ -1661,6 +1778,8 @@ namespace vr static const char * const k_pch_Dashboard_Section = "dashboard"; static const char * const k_pch_Dashboard_EnableDashboard_Bool = "enableDashboard"; static const char * const k_pch_Dashboard_ArcadeMode_Bool = "arcadeMode"; + static const char * const k_pch_Dashboard_EnableWebUI = "webUI"; + static const char * const k_pch_Dashboard_EnableWebUIDevTools = "webUIDevTools"; //----------------------------------------------------------------------------- // model skin keys @@ -1670,6 +1789,23 @@ namespace vr // driver keys - These could be checked in any driver_ section static const char * const k_pch_Driver_Enable_Bool = "enable"; + //----------------------------------------------------------------------------- + // web interface keys + static const char* const k_pch_WebInterface_Section = "WebInterface"; + static const char* const k_pch_WebInterface_WebPort_String = "WebPort"; + + //----------------------------------------------------------------------------- + // tracking overrides - keys are device paths, values are the device paths their + // tracking/pose information overrides + static const char* const k_pch_TrackingOverride_Section = "TrackingOverrides"; + + //----------------------------------------------------------------------------- + // per-app keys - the section name for these is the app key itself. Some of these are prefixed by the controller type + static const char* const k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; + static const char* const k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; + static const char* const k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; + static const char* const k_pch_App_ActionManifestURL_String = "ActionManifestURL"; + } // namespace vr // iservertrackeddevicedriver.h @@ -1858,7 +1994,14 @@ namespace vr // ----------------------------------- /** Specific to Oculus compositor support, textures supplied must be created using this method. */ - virtual void CreateSwapTextureSet( uint32_t unPid, uint32_t unFormat, uint32_t unWidth, uint32_t unHeight, vr::SharedTextureHandle_t( *pSharedTextureHandles )[ 3 ] ) {} + struct SwapTextureSetDesc_t + { + uint32_t nWidth; + uint32_t nHeight; + uint32_t nFormat; + uint32_t nSampleCount; + }; + virtual void CreateSwapTextureSet( uint32_t unPid, const SwapTextureSetDesc_t *pSwapTextureSetDesc, vr::SharedTextureHandle_t( *pSharedTextureHandles )[ 3 ] ) {} /** Used to textures created using CreateSwapTextureSet. Only one of the set's handles needs to be used to destroy the entire set. */ virtual void DestroySwapTextureSet( vr::SharedTextureHandle_t sharedTextureHandle ) {} @@ -1871,7 +2014,18 @@ namespace vr /** Call once per layer to draw for this frame. One shared texture handle per eye. Textures must be created * using CreateSwapTextureSet and should be alternated per frame. Call Present once all layers have been submitted. */ - virtual void SubmitLayer( vr::SharedTextureHandle_t sharedTextureHandles[ 2 ], const vr::VRTextureBounds_t( &bounds )[ 2 ], const vr::HmdMatrix34_t *pPose ) {} + struct SubmitLayerPerEye_t + { + // Shared texture handles (depth not always provided). + vr::SharedTextureHandle_t hTexture, hDepthTexture; + + // Valid region of provided texture (and depth). + vr::VRTextureBounds_t bounds; + + // Projection matrix used to render the depth buffer. + vr::HmdMatrix44_t mProjection; + }; + virtual void SubmitLayer( const SubmitLayerPerEye_t( &perEye )[ 2 ], const vr::HmdMatrix34_t *pPose ) {} /** Submits queued layers for display. */ virtual void Present( vr::SharedTextureHandle_t syncTexture ) {} @@ -1883,7 +2037,7 @@ namespace vr virtual void GetFrameTiming( DriverDirectMode_FrameTiming *pFrameTiming ) {} }; - static const char *IVRDriverDirectModeComponent_Version = "IVRDriverDirectModeComponent_004"; + static const char *IVRDriverDirectModeComponent_Version = "IVRDriverDirectModeComponent_005"; } @@ -1939,7 +2093,6 @@ namespace vr class ITrackedDeviceServerDriver; struct TrackedDeviceDriverInfo_t; struct DriverPose_t; -typedef PropertyContainerHandle_t DriverHandle_t; /** This interface is provided by vrserver to allow the driver to notify * the system when something changes about a device. These changes must @@ -2130,6 +2283,8 @@ class CVRPropertyHelpers template< typename T> ETrackedPropertyError SetPropertyVector( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, PropertyTypeTag_t unExpectedTag, std::vector *vecProperties ); + /** Returns true if the specified property is set on the specified container */ + bool IsPropertySet( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, ETrackedPropertyError *peError = nullptr ); private: template T GetPropertyHelper( PropertyContainerHandle_t ulContainerHandle, ETrackedDeviceProperty prop, ETrackedPropertyError *pError, T bDefault, PropertyTypeTag_t unTypeTag ); @@ -2394,9 +2549,19 @@ ETrackedPropertyError CVRPropertyHelpers::GetPropertyVector( PropertyContainerHa return err; } +inline bool CVRPropertyHelpers::IsPropertySet( PropertyContainerHandle_t ulContainer, ETrackedDeviceProperty prop, ETrackedPropertyError *peError ) +{ + ETrackedPropertyError error; + GetProperty( ulContainer, prop, nullptr, 0, nullptr, &error ); + if ( peError ) + *peError = error; + return error == TrackedProp_Success || error == TrackedProp_BufferTooSmall; +} + } + // ivrdriverinput.h namespace vr { @@ -2436,6 +2601,12 @@ namespace vr /** Creates a haptic component for the device */ virtual EVRInputError CreateHapticComponent( PropertyContainerHandle_t ulContainer, const char *pchName, VRInputComponentHandle_t *pHandle ) = 0; + /** Creates a skeleton component. */ + virtual EVRInputError CreateSkeletonComponent( PropertyContainerHandle_t ulContainer, const char *pchName, const char *pchSkeletonPath, const char *pchBasePosePath, const VRBoneTransform_t *pGripLimitTransforms, uint32_t unGripLimitTransformCount, VRInputComponentHandle_t *pHandle ) = 0; + + /** Updates a skeleton component. */ + virtual EVRInputError UpdateSkeletonComponent( VRInputComponentHandle_t ulComponent, const VRBoneTransform_t *pTransforms, uint32_t unTransformCount ) = 0; + }; static const char * const IVRDriverInput_Version = "IVRDriverInput_001"; @@ -2585,6 +2756,14 @@ static const char *IVRWatchdogHost_Version = "IVRWatchdogHost_001"; // ivrvirtualdisplay.h namespace vr { + struct PresentInfo_t + { + SharedTextureHandle_t backbufferTextureHandle; + EVSync vsync; + uint64_t nFrameId; + double flVSyncTimeInSeconds; + }; + // ---------------------------------------------------------------------------------------------- // Purpose: This component is used for drivers that implement a virtual display (e.g. wireless). // ---------------------------------------------------------------------------------------------- @@ -2593,7 +2772,7 @@ namespace vr public: /** Submits final backbuffer for display. */ - virtual void Present( vr::SharedTextureHandle_t backbufferTextureHandle ) = 0; + virtual void Present( const PresentInfo_t *pPresentInfo, uint32_t unPresentInfoSize ) = 0; /** Block until the last presented buffer start scanning out. */ virtual void WaitForPresent() = 0; @@ -2602,7 +2781,7 @@ namespace vr virtual bool GetTimeSinceLastVsync( float *pfSecondsSinceLastVsync, uint64_t *pulFrameCounter ) = 0; }; - static const char *IVRVirtualDisplay_Version = "IVRVirtualDisplay_001"; + static const char *IVRVirtualDisplay_Version = "IVRVirtualDisplay_002"; /** Returns the current IVRVirtualDisplay pointer or NULL the interface could not be found. */ VR_INTERFACE vr::IVRVirtualDisplay *VR_CALLTYPE VRVirtualDisplay(); @@ -2635,6 +2814,56 @@ static const char * const IVRResources_Version = "IVRResources_001"; } +// ivriobuffer.h +namespace vr +{ + +typedef uint64_t IOBufferHandle_t; +static const uint64_t k_ulInvalidIOBufferHandle = 0; + + enum EIOBufferError + { + IOBuffer_Success = 0, + IOBuffer_OperationFailed = 100, + IOBuffer_InvalidHandle = 101, + IOBuffer_InvalidArgument = 102, + IOBuffer_PathExists = 103, + IOBuffer_PathDoesNotExist = 104, + IOBuffer_Permission = 105, + }; + + enum EIOBufferMode + { + IOBufferMode_Read = 0x0001, + IOBufferMode_Write = 0x0002, + IOBufferMode_Create = 0x0200, + }; + + // ---------------------------------------------------------------------------------------------- + // Purpose: + // ---------------------------------------------------------------------------------------------- + class IVRIOBuffer + { + public: + /** opens an existing or creates a new IOBuffer of unSize bytes */ + virtual vr::EIOBufferError Open( const char *pchPath, vr::EIOBufferMode mode, uint32_t unElementSize, uint32_t unElements, vr::IOBufferHandle_t *pulBuffer ) = 0; + + /** closes a previously opened or created buffer */ + virtual vr::EIOBufferError Close( vr::IOBufferHandle_t ulBuffer ) = 0; + + /** reads up to unBytes from buffer into *pDst, returning number of bytes read in *punRead */ + virtual vr::EIOBufferError Read( vr::IOBufferHandle_t ulBuffer, void *pDst, uint32_t unBytes, uint32_t *punRead ) = 0; + + /** writes unBytes of data from *pSrc into a buffer. */ + virtual vr::EIOBufferError Write( vr::IOBufferHandle_t ulBuffer, void *pSrc, uint32_t unBytes ) = 0; + + /** retrieves the property container of an buffer. */ + virtual vr::PropertyContainerHandle_t PropertyContainer( vr::IOBufferHandle_t ulBuffer ) = 0; + }; + + static const char *IVRIOBuffer_Version = "IVRIOBuffer_001"; +} + // ivrdrivermanager.h namespace vr { @@ -2646,6 +2875,8 @@ class IVRDriverManager /** Returns the length of the number of bytes necessary to hold this string including the trailing null. */ virtual uint32_t GetDriverName( vr::DriverId_t nDriver, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) = 0; + + virtual DriverHandle_t GetDriverHandle( const char *pchDriverName ) = 0; }; static const char * const IVRDriverManager_Version = "IVRDriverManager_001"; @@ -2787,6 +3018,16 @@ namespace vr return m_pVRDriverInput; } + IVRIOBuffer *VRIOBuffer() + { + if ( !m_pVRIOBuffer ) + { + EVRInitError eError; + m_pVRIOBuffer = (IVRIOBuffer *)VRDriverContext()->GetGenericInterface( IVRIOBuffer_Version, &eError ); + } + return m_pVRIOBuffer; + } + private: CVRPropertyHelpers m_propertyHelpers; CVRHiddenAreaHelpers m_hiddenAreaHelpers; @@ -2799,6 +3040,7 @@ namespace vr IVRDriverManager *m_pVRDriverManager; IVRResources *m_pVRResources; IVRDriverInput *m_pVRDriverInput; + IVRIOBuffer *m_pVRIOBuffer; }; inline COpenVRDriverContext &OpenVRInternal_ModuleServerDriverContext() @@ -2818,6 +3060,7 @@ namespace vr inline IVRDriverManager *VR_CALLTYPE VRDriverManager() { return OpenVRInternal_ModuleServerDriverContext().VRDriverManager(); } inline IVRResources *VR_CALLTYPE VRResources() { return OpenVRInternal_ModuleServerDriverContext().VRResources(); } inline IVRDriverInput *VR_CALLTYPE VRDriverInput() { return OpenVRInternal_ModuleServerDriverContext().VRDriverInput(); } + inline IVRIOBuffer *VR_CALLTYPE VRIOBuffer() { return OpenVRInternal_ModuleServerDriverContext().VRIOBuffer(); } inline void COpenVRDriverContext::Clear() { @@ -2829,6 +3072,7 @@ namespace vr m_pVRDriverManager = nullptr; m_pVRResources = nullptr; m_pVRDriverInput = nullptr; + m_pVRIOBuffer = nullptr; } inline EVRInitError COpenVRDriverContext::InitServer() diff --git a/OpenVR/samples/driver_sample/driverlog.cpp b/OpenVR/samples/driver_sample/driverlog.cpp index a635aac..08a1510 100644 --- a/OpenVR/samples/driver_sample/driverlog.cpp +++ b/OpenVR/samples/driver_sample/driverlog.cpp @@ -7,6 +7,9 @@ static vr::IVRDriverLog * s_pLogFile = NULL; +#if !defined( WIN32) +#define vsnprintf_s vsnprintf +#endif bool InitDriverLog( vr::IVRDriverLog *pDriverLog ) { @@ -24,11 +27,7 @@ void CleanupDriverLog() static void DriverLogVarArgs( const char *pMsgFormat, va_list args ) { char buf[1024]; -#if defined( WIN32 ) - vsprintf_s( buf, pMsgFormat, args ); -#else - vsnprintf( buf, sizeof(buf), pMsgFormat, args ); -#endif + vsnprintf_s( buf, sizeof(buf), pMsgFormat, args ); if( s_pLogFile ) s_pLogFile->Log( buf );