Skip to content

Commit

Permalink
Update to openvr version 1.14.15
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbruns committed Sep 19, 2020
1 parent 927611d commit 129e382
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 52 deletions.
55 changes: 31 additions & 24 deletions src/openvr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/env python

# Unofficial python bindings for OpenVR API version 1.12.5
# Unofficial python bindings for OpenVR API version 1.14.15
# from https://github.com/cmbruns/pyopenvr
# based on OpenVR C++ API at https://github.com/ValveSoftware/openvr

Expand Down Expand Up @@ -108,8 +108,8 @@ class ID3D12CommandQueue(Structure):
####################

k_nSteamVRVersionMajor = 1
k_nSteamVRVersionMinor = 12
k_nSteamVRVersionBuild = 5
k_nSteamVRVersionMinor = 14
k_nSteamVRVersionBuild = 15
k_nDriverNone = 0xFFFFFFFF
k_unMaxDriverDebugResponseSize = 32768
k_unTrackedDeviceIndex_Hmd = 0
Expand Down Expand Up @@ -162,7 +162,7 @@ class ID3D12CommandQueue(Structure):
VRCompositor_ReprojectionMotion_Enabled = 0x100 # Motion Smoothing is enabled in the UI for the currently running application
VRCompositor_ReprojectionMotion_ForcedOn = 0x200 # Motion Smoothing is forced on in the UI for the currently running application
VRCompositor_ReprojectionMotion_AppThrottled = 0x400 # Application is requesting throttling via ForceInterleavedReprojectionOn
IVRSystem_Version = 'IVRSystem_021'
IVRSystem_Version = 'IVRSystem_022'
k_unMaxApplicationKeyLength = 128 # The maximum length of an application key
k_pch_MimeType_HomeApp = 'vr/home' # Currently recognized mime types
k_pch_MimeType_GameTheater = 'vr/game_theater'
Expand Down Expand Up @@ -305,15 +305,15 @@ class ID3D12CommandQueue(Structure):
k_pch_CollisionBounds_EnableDriverImport = 'enableDriverBoundsImport'
k_pch_Camera_Section = 'camera'
k_pch_Camera_EnableCamera_Bool = 'enableCamera'
k_pch_Camera_EnableCameraInDashboard_Bool = 'enableCameraInDashboard'
k_pch_Camera_ShowOnController_Bool = 'showOnController'
k_pch_Camera_EnableCameraForCollisionBounds_Bool = 'enableCameraForCollisionBounds'
k_pch_Camera_EnableCameraForRoomView_Bool = 'enableCameraForRoomView'
k_pch_Camera_RoomView_Int32 = 'roomView'
k_pch_Camera_BoundsColorGammaR_Int32 = 'cameraBoundsColorGammaR'
k_pch_Camera_BoundsColorGammaG_Int32 = 'cameraBoundsColorGammaG'
k_pch_Camera_BoundsColorGammaB_Int32 = 'cameraBoundsColorGammaB'
k_pch_Camera_BoundsColorGammaA_Int32 = 'cameraBoundsColorGammaA'
k_pch_Camera_BoundsStrength_Int32 = 'cameraBoundsStrength'
k_pch_Camera_RoomViewMode_Int32 = 'cameraRoomViewMode'
k_pch_Camera_RoomViewStyle_Int32 = 'roomViewStyle'
k_pch_audio_Section = 'audio'
k_pch_audio_SetOsDefaultPlaybackDevice_Bool = 'setOsDefaultPlaybackDevice'
k_pch_audio_EnablePlaybackDeviceOverride_Bool = 'enablePlaybackDeviceOverride'
Expand All @@ -331,6 +331,7 @@ class ID3D12CommandQueue(Structure):
k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = 'enablePlaybackMirrorIndependentVolume'
k_pch_audio_LastHmdPlaybackDeviceId_String = 'lastHmdPlaybackDeviceId'
k_pch_audio_VIVEHDMIGain = 'viveHDMIGain'
k_pch_audio_DualSpeakerAndJackOutput_Bool = 'dualSpeakerAndJackOutput'
k_pch_Power_Section = 'power'
k_pch_Power_PowerOffOnExit_Bool = 'powerOffOnExit'
k_pch_Power_TurnOffScreensTimeout_Float = 'turnOffScreensTimeout'
Expand Down Expand Up @@ -372,7 +373,7 @@ class ID3D12CommandQueue(Structure):
k_pch_Input_RightThumbstickRotation_Float = 'rightThumbstickRotation'
k_pch_Input_ThumbstickDeadzone_Float = 'thumbstickDeadzone'
k_pch_GpuSpeed_Section = 'GpuSpeed'
IVRChaperone_Version = 'IVRChaperone_003'
IVRChaperone_Version = 'IVRChaperone_004'
IVRChaperoneSetup_Version = 'IVRChaperoneSetup_006'
IVRCompositor_Version = 'IVRCompositor_026'
k_unHeadsetViewMaxWidth = 3840
Expand Down Expand Up @@ -606,6 +607,7 @@ class ID3D12CommandQueue(Structure):
Prop_DriverProvidedChaperoneVisibility_Bool = ENUM_VALUE_TYPE(2076)
Prop_HmdColumnCorrectionSettingPrefix_String = ENUM_VALUE_TYPE(2077)
Prop_CameraSupportsCompatibilityModes_Bool = ENUM_VALUE_TYPE(2078)
Prop_SupportsRoomViewDepthProjection_Bool = ENUM_VALUE_TYPE(2079)
Prop_DisplayAvailableFrameRates_Float_Array = ENUM_VALUE_TYPE(2080)
Prop_DisplaySupportsMultipleFramerates_Bool = ENUM_VALUE_TYPE(2081)
Prop_DisplayColorMultLeft_Vector3 = ENUM_VALUE_TYPE(2082)
Expand All @@ -629,6 +631,7 @@ class ID3D12CommandQueue(Structure):
Prop_Audio_DefaultPlaybackDeviceId_String = ENUM_VALUE_TYPE(2300)
Prop_Audio_DefaultRecordingDeviceId_String = ENUM_VALUE_TYPE(2301)
Prop_Audio_DefaultPlaybackDeviceVolume_Float = ENUM_VALUE_TYPE(2302)
Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = ENUM_VALUE_TYPE(2303)
Prop_AttachedDeviceId_String = ENUM_VALUE_TYPE(3000)
Prop_SupportedButtons_Uint64 = ENUM_VALUE_TYPE(3001)
Prop_Axis0Type_Int32 = ENUM_VALUE_TYPE(3002)
Expand Down Expand Up @@ -790,6 +793,8 @@ class ID3D12CommandQueue(Structure):
VREvent_RoomViewHidden = ENUM_VALUE_TYPE(527)
VREvent_ShowUI = ENUM_VALUE_TYPE(528)
VREvent_ShowDevTools = ENUM_VALUE_TYPE(529)
VREvent_DesktopViewUpdating = ENUM_VALUE_TYPE(530)
VREvent_DesktopViewReady = ENUM_VALUE_TYPE(531)
VREvent_Notification_Shown = ENUM_VALUE_TYPE(600)
VREvent_Notification_Hidden = ENUM_VALUE_TYPE(601)
VREvent_Notification_BeginInteraction = ENUM_VALUE_TYPE(602)
Expand All @@ -807,6 +812,7 @@ class ID3D12CommandQueue(Structure):
VREvent_ChaperoneFlushCache = ENUM_VALUE_TYPE(805)
VREvent_ChaperoneRoomSetupStarting = ENUM_VALUE_TYPE(806)
VREvent_ChaperoneRoomSetupFinished = ENUM_VALUE_TYPE(807)
VREvent_StandingZeroPoseReset = ENUM_VALUE_TYPE(808)
VREvent_AudioSettingsHaveChanged = ENUM_VALUE_TYPE(820)
VREvent_BackgroundSettingHasChanged = ENUM_VALUE_TYPE(850)
VREvent_CameraSettingsHaveChanged = ENUM_VALUE_TYPE(851)
Expand Down Expand Up @@ -1040,7 +1046,8 @@ class ID3D12CommandQueue(Structure):
VRApplication_SteamWatchdog = ENUM_VALUE_TYPE(6)
VRApplication_Bootstrapper = ENUM_VALUE_TYPE(7)
VRApplication_WebHelper = ENUM_VALUE_TYPE(8)
VRApplication_Max = ENUM_VALUE_TYPE(9)
VRApplication_OpenXR = ENUM_VALUE_TYPE(9)
VRApplication_Max = ENUM_VALUE_TYPE(10)

EVRFirmwareError = ENUM_TYPE
VRFirmwareError_None = ENUM_VALUE_TYPE(0)
Expand Down Expand Up @@ -2815,7 +2822,6 @@ class IVRSystem_FnTable(Structure):
("isDisplayOnDesktop", OPENVR_FNTABLE_CALLTYPE(openvr_bool)),
("setDisplayVisibility", OPENVR_FNTABLE_CALLTYPE(openvr_bool, openvr_bool)),
("getDeviceToAbsoluteTrackingPose", OPENVR_FNTABLE_CALLTYPE(None, ETrackingUniverseOrigin, c_float, POINTER(TrackedDevicePose_t), c_uint32)),
("resetSeatedZeroPose", OPENVR_FNTABLE_CALLTYPE(None)),
("getSeatedZeroPoseToStandingAbsoluteTrackingPose", OPENVR_FNTABLE_CALLTYPE(HmdMatrix34_t)),
("getRawZeroPoseToStandingAbsoluteTrackingPose", OPENVR_FNTABLE_CALLTYPE(HmdMatrix34_t)),
("getSortedTrackedDeviceIndicesOfClass", OPENVR_FNTABLE_CALLTYPE(c_uint32, ETrackedDeviceClass, POINTER(TrackedDeviceIndex_t), c_uint32, TrackedDeviceIndex_t)),
Expand Down Expand Up @@ -3020,20 +3026,6 @@ def getDeviceToAbsoluteTrackingPose(self, origin, predictedSecondsToPhotonsFromN
fn(origin, predictedSecondsToPhotonsFromNow, trackedDevicePoseArrayArg, trackedDevicePoseArrayCount)
return trackedDevicePoseArray

def resetSeatedZeroPose(self) -> None:
"""
Sets the zero pose for the seated tracker coordinate system to the current position and yaw of the HMD. After
ResetSeatedZeroPose all GetDeviceToAbsoluteTrackingPose calls that pass TrackingUniverseSeated as the origin
will be relative to this new zero pose. The new zero coordinate system will not change the fact that the Y axis
is up in the real world, so the next pose returned from GetDeviceToAbsoluteTrackingPose after a call to
ResetSeatedZeroPose may not be exactly an identity matrix.
NOTE: This function overrides the user's previously saved seated zero pose and should only be called as the result of a user action.
Users are also able to set their seated zero pose via the OpenVR Dashboard.
"""
fn = self.function_table.resetSeatedZeroPose
fn()

def getSeatedZeroPoseToStandingAbsoluteTrackingPose(self):
"""
Returns the transform from the seated zero pose to the standing absolute tracking system. This allows
Expand Down Expand Up @@ -3889,6 +3881,7 @@ class IVRChaperone_FnTable(Structure):
("getBoundsColor", OPENVR_FNTABLE_CALLTYPE(None, POINTER(HmdColor_t), c_int, c_float, POINTER(HmdColor_t))),
("areBoundsVisible", OPENVR_FNTABLE_CALLTYPE(openvr_bool)),
("forceBoundsVisible", OPENVR_FNTABLE_CALLTYPE(None, openvr_bool)),
("resetZeroPose", OPENVR_FNTABLE_CALLTYPE(None, ETrackingUniverseOrigin)),
]


Expand Down Expand Up @@ -3970,6 +3963,20 @@ def forceBoundsVisible(self, force) -> None:
fn = self.function_table.forceBoundsVisible
fn(force)

def resetZeroPose(self, trackingUniverseOrigin) -> None:
"""
Sets the zero pose for the given tracker coordinate system to the current position and yaw of the HMD. After
ResetZeroPose all GetDeviceToAbsoluteTrackingPose calls as the origin will be relative to this new zero pose.
The new zero coordinate system will not change the fact that the Y axis is up in the real world, so the next
pose returned from GetDeviceToAbsoluteTrackingPose after a call to ResetZeroPose may not be exactly an
identity matrix.
NOTE: This function overrides the user's previously saved zero pose and should only be called as the result of a user action.
Users are also able to set their zero pose via the OpenVR Dashboard.
"""
fn = self.function_table.resetZeroPose
fn(trackingUniverseOrigin)


class IVRChaperoneSetup_FnTable(Structure):
_fields_ = [
Expand Down
Binary file modified src/openvr/libopenvr_api_32.dll
Binary file not shown.
Binary file modified src/openvr/libopenvr_api_32.so
Binary file not shown.
Binary file modified src/openvr/libopenvr_api_64.dll
Binary file not shown.
Binary file modified src/openvr/libopenvr_api_64.so
Binary file not shown.
2 changes: 1 addition & 1 deletion src/openvr/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# 3) we can import it into your module module
# http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package

__version__ = '1.12.0501'
__version__ = '1.14.1501'
46 changes: 26 additions & 20 deletions src/translate/openvr.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
namespace vr
{
static const uint32_t k_nSteamVRVersionMajor = 1;
static const uint32_t k_nSteamVRVersionMinor = 12;
static const uint32_t k_nSteamVRVersionBuild = 5;
static const uint32_t k_nSteamVRVersionMinor = 14;
static const uint32_t k_nSteamVRVersionBuild = 15;
} // namespace vr

// vrtypes.h
Expand Down Expand Up @@ -441,7 +441,7 @@ enum ETrackedDeviceProperty
Prop_DriverProvidedChaperoneVisibility_Bool = 2076,
Prop_HmdColumnCorrectionSettingPrefix_String = 2077,
Prop_CameraSupportsCompatibilityModes_Bool = 2078,

Prop_SupportsRoomViewDepthProjection_Bool = 2079,
Prop_DisplayAvailableFrameRates_Float_Array = 2080, // populated by compositor from actual EDID list when available from GPU driver
Prop_DisplaySupportsMultipleFramerates_Bool = 2081, // if this is true but Prop_DisplayAvailableFrameRates_Float_Array is empty, explain to user
Prop_DisplayColorMultLeft_Vector3 = 2082,
Expand Down Expand Up @@ -469,7 +469,8 @@ enum ETrackedDeviceProperty

Prop_Audio_DefaultPlaybackDeviceId_String = 2300,
Prop_Audio_DefaultRecordingDeviceId_String = 2301,
Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302,
Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302,
Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303,

// Properties that are unique to TrackedDeviceClass_Controller
Prop_AttachedDeviceId_String = 3000,
Expand Down Expand Up @@ -784,6 +785,8 @@ enum EVREventType
VREvent_RoomViewHidden = 527, // Sent by compositor whenever room-view is disabled
VREvent_ShowUI = 528, // data is showUi
VREvent_ShowDevTools = 529, // data is showDevTools
VREvent_DesktopViewUpdating = 530,
VREvent_DesktopViewReady = 531,

VREvent_Notification_Shown = 600,
VREvent_Notification_Hidden = 601,
Expand All @@ -805,6 +808,7 @@ enum EVREventType
VREvent_ChaperoneFlushCache = 805, // Sent when the process needs to reload any cached data it retrieved from VRChaperone()
VREvent_ChaperoneRoomSetupStarting = 806, // Triggered by CVRChaperoneClient::RoomSetupStarting
VREvent_ChaperoneRoomSetupFinished = 807, // Triggered by CVRChaperoneClient::CommitWorkingCopy
VREvent_StandingZeroPoseReset = 808,

VREvent_AudioSettingsHaveChanged = 820,

Expand Down Expand Up @@ -1460,6 +1464,7 @@ enum EVRApplicationType
VRApplication_SteamWatchdog = 6,// Reserved for Steam
VRApplication_Bootstrapper = 7, // reserved for vrstartup
VRApplication_WebHelper = 8, // reserved for vrwebhelper
VRApplication_OpenXR = 9, // reserved for openxr

VRApplication_Max
};
Expand Down Expand Up @@ -2109,17 +2114,6 @@ class IVRSystem
*/
virtual void GetDeviceToAbsoluteTrackingPose( ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, VR_ARRAY_COUNT(unTrackedDevicePoseArrayCount) TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount ) = 0;

/** Sets the zero pose for the seated tracker coordinate system to the current position and yaw of the HMD. After
* ResetSeatedZeroPose all GetDeviceToAbsoluteTrackingPose calls that pass TrackingUniverseSeated as the origin
* will be relative to this new zero pose. The new zero coordinate system will not change the fact that the Y axis
* is up in the real world, so the next pose returned from GetDeviceToAbsoluteTrackingPose after a call to
* ResetSeatedZeroPose may not be exactly an identity matrix.
*
* NOTE: This function overrides the user's previously saved seated zero pose and should only be called as the result of a user action.
* Users are also able to set their seated zero pose via the OpenVR Dashboard.
**/
virtual void ResetSeatedZeroPose() = 0;

/** Returns the transform from the seated zero pose to the standing absolute tracking system. This allows
* applications to represent the seated origin to used or transform object positions from one coordinate
* system to the other.
Expand Down Expand Up @@ -2307,7 +2301,7 @@ class IVRSystem

};

static const char * const IVRSystem_Version = "IVRSystem_021";
static const char * const IVRSystem_Version = "IVRSystem_022";

}

Expand Down Expand Up @@ -2809,15 +2803,15 @@ namespace vr
// camera keys
static const char * const k_pch_Camera_Section = "camera";
static const char * const k_pch_Camera_EnableCamera_Bool = "enableCamera";
static const char * const k_pch_Camera_EnableCameraInDashboard_Bool = "enableCameraInDashboard";
static const char * const k_pch_Camera_ShowOnController_Bool = "showOnController";
static const char * const k_pch_Camera_EnableCameraForCollisionBounds_Bool = "enableCameraForCollisionBounds";
static const char * const k_pch_Camera_EnableCameraForRoomView_Bool = "enableCameraForRoomView";
static const char * const k_pch_Camera_RoomView_Int32 = "roomView";
static const char * const k_pch_Camera_BoundsColorGammaR_Int32 = "cameraBoundsColorGammaR";
static const char * const k_pch_Camera_BoundsColorGammaG_Int32 = "cameraBoundsColorGammaG";
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";
static const char * const k_pch_Camera_RoomViewStyle_Int32 = "roomViewStyle";

//-----------------------------------------------------------------------------
// audio keys
Expand All @@ -2838,6 +2832,7 @@ namespace vr
static const char * const k_pch_audio_EnablePlaybackMirrorIndependentVolume_Bool = "enablePlaybackMirrorIndependentVolume";
static const char * const k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId";
static const char * const k_pch_audio_VIVEHDMIGain = "viveHDMIGain";
static const char * const k_pch_audio_DualSpeakerAndJackOutput_Bool = "dualSpeakerAndJackOutput";

//-----------------------------------------------------------------------------
// power management keys
Expand Down Expand Up @@ -2988,9 +2983,20 @@ class IVRChaperone

/** Force the bounds to show, mostly for utilities **/
virtual void ForceBoundsVisible( bool bForce ) = 0;

/** Sets the zero pose for the given tracker coordinate system to the current position and yaw of the HMD. After
* ResetZeroPose all GetDeviceToAbsoluteTrackingPose calls as the origin will be relative to this new zero pose.
* The new zero coordinate system will not change the fact that the Y axis is up in the real world, so the next
* pose returned from GetDeviceToAbsoluteTrackingPose after a call to ResetZeroPose may not be exactly an
* identity matrix.
*
* NOTE: This function overrides the user's previously saved zero pose and should only be called as the result of a user action.
* Users are also able to set their zero pose via the OpenVR Dashboard.
**/
virtual void ResetZeroPose( ETrackingUniverseOrigin eTrackingUniverseOrigin ) = 0;
};

static const char * const IVRChaperone_Version = "IVRChaperone_003";
static const char * const IVRChaperone_Version = "IVRChaperone_004";

#pragma pack( pop )

Expand Down
Loading

0 comments on commit 129e382

Please sign in to comment.