88
99using System ;
1010using System . Runtime . InteropServices ;
11+ using Valve . VR ;
1112
1213#if UNITY_5_3_OR_NEWER
1314using UnityEngine ;
@@ -79,11 +80,6 @@ public struct IVRSystem
7980 [ MarshalAs ( UnmanagedType . FunctionPtr ) ]
8081 internal _GetDeviceToAbsoluteTrackingPose GetDeviceToAbsoluteTrackingPose ;
8182
82- [ UnmanagedFunctionPointer ( CallingConvention . StdCall ) ]
83- internal delegate void _ResetSeatedZeroPose ( ) ;
84- [ MarshalAs ( UnmanagedType . FunctionPtr ) ]
85- internal _ResetSeatedZeroPose ResetSeatedZeroPose ;
86-
8783 [ UnmanagedFunctionPointer ( CallingConvention . StdCall ) ]
8884 internal delegate HmdMatrix34_t _GetSeatedZeroPoseToStandingAbsoluteTrackingPose ( ) ;
8985 [ MarshalAs ( UnmanagedType . FunctionPtr ) ]
@@ -549,6 +545,11 @@ public struct IVRChaperone
549545 [ MarshalAs ( UnmanagedType . FunctionPtr ) ]
550546 internal _ForceBoundsVisible ForceBoundsVisible ;
551547
548+ [ UnmanagedFunctionPointer ( CallingConvention . StdCall ) ]
549+ internal delegate void _ResetZeroPose ( ETrackingUniverseOrigin eTrackingUniverseOrigin ) ;
550+ [ MarshalAs ( UnmanagedType . FunctionPtr ) ]
551+ internal _ResetZeroPose ResetZeroPose ;
552+
552553}
553554
554555[ StructLayout ( LayoutKind . Sequential ) ]
@@ -1996,8 +1997,10 @@ public class Utils
19961997{
19971998 public static IntPtr ToUtf8 ( string managedString )
19981999 {
1999- if ( string . IsNullOrEmpty ( managedString ) )
2000+ if ( managedString == null )
2001+ {
20002002 return IntPtr . Zero ;
2003+ }
20012004
20022005 int size = System . Text . Encoding . UTF8 . GetByteCount ( managedString ) + 1 ;
20032006 if ( buffer . Length < size ) buffer = new byte [ size ] ;
@@ -2082,10 +2085,6 @@ public void GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin,floa
20822085 {
20832086 FnTable . GetDeviceToAbsoluteTrackingPose ( eOrigin , fPredictedSecondsToPhotonsFromNow , pTrackedDevicePoseArray , ( uint ) pTrackedDevicePoseArray . Length ) ;
20842087 }
2085- public void ResetSeatedZeroPose ( )
2086- {
2087- FnTable . ResetSeatedZeroPose ( ) ;
2088- }
20892088 public HmdMatrix34_t GetSeatedZeroPoseToStandingAbsoluteTrackingPose ( )
20902089 {
20912090 HmdMatrix34_t result = FnTable . GetSeatedZeroPoseToStandingAbsoluteTrackingPose ( ) ;
@@ -2710,6 +2709,10 @@ public void ForceBoundsVisible(bool bForce)
27102709 {
27112710 FnTable . ForceBoundsVisible ( bForce ) ;
27122711 }
2712+ public void ResetZeroPose ( ETrackingUniverseOrigin eTrackingUniverseOrigin )
2713+ {
2714+ FnTable . ResetZeroPose ( eTrackingUniverseOrigin ) ;
2715+ }
27132716}
27142717
27152718
@@ -4692,6 +4695,7 @@ public enum ETrackedDeviceProperty
46924695 Prop_DriverProvidedChaperoneVisibility_Bool = 2076 ,
46934696 Prop_HmdColumnCorrectionSettingPrefix_String = 2077 ,
46944697 Prop_CameraSupportsCompatibilityModes_Bool = 2078 ,
4698+ Prop_SupportsRoomViewDepthProjection_Bool = 2079 ,
46954699 Prop_DisplayAvailableFrameRates_Float_Array = 2080 ,
46964700 Prop_DisplaySupportsMultipleFramerates_Bool = 2081 ,
46974701 Prop_DisplayColorMultLeft_Vector3 = 2082 ,
@@ -4898,6 +4902,7 @@ public enum EVREventType
48984902 VREvent_ChaperoneFlushCache = 805 ,
48994903 VREvent_ChaperoneRoomSetupStarting = 806 ,
49004904 VREvent_ChaperoneRoomSetupFinished = 807 ,
4905+ VREvent_StandingZeroPoseReset = 808 ,
49014906 VREvent_AudioSettingsHaveChanged = 820 ,
49024907 VREvent_BackgroundSettingHasChanged = 850 ,
49034908 VREvent_CameraSettingsHaveChanged = 851 ,
@@ -5145,7 +5150,8 @@ public enum EVRApplicationType
51455150 VRApplication_SteamWatchdog = 6 ,
51465151 VRApplication_Bootstrapper = 7 ,
51475152 VRApplication_WebHelper = 8 ,
5148- VRApplication_Max = 9 ,
5153+ VRApplication_OpenXR = 9 ,
5154+ VRApplication_Max = 10 ,
51495155}
51505156public enum EVRFirmwareError
51515157{
@@ -5975,6 +5981,9 @@ private static void _copysign(ref float sizeval, float signval)
59755981}
59765982[ StructLayout ( LayoutKind . Sequential ) ] public struct VRTextureWithPose_t
59775983{
5984+ public IntPtr handle ; // void *
5985+ public ETextureType eType ;
5986+ public EColorSpace eColorSpace ;
59785987 public HmdMatrix34_t mDeviceToAbsoluteTracking ;
59795988}
59805989[ StructLayout ( LayoutKind . Sequential ) ] public struct VRTextureDepthInfo_t
@@ -5985,10 +5994,17 @@ private static void _copysign(ref float sizeval, float signval)
59855994}
59865995[ StructLayout ( LayoutKind . Sequential ) ] public struct VRTextureWithDepth_t
59875996{
5997+ public IntPtr handle ; // void *
5998+ public ETextureType eType ;
5999+ public EColorSpace eColorSpace ;
59886000 public VRTextureDepthInfo_t depth ;
59896001}
59906002[ StructLayout ( LayoutKind . Sequential ) ] public struct VRTextureWithPoseAndDepth_t
59916003{
6004+ public IntPtr handle ; // void *
6005+ public ETextureType eType ;
6006+ public EColorSpace eColorSpace ;
6007+ public HmdMatrix34_t mDeviceToAbsoluteTracking ;
59926008 public VRTextureDepthInfo_t depth ;
59936009}
59946010[ StructLayout ( LayoutKind . Sequential ) ] public struct VRVulkanTextureData_t
@@ -7491,14 +7507,14 @@ public static uint GetInitToken()
74917507 public const ulong k_ulOverlayHandleInvalid = 0 ;
74927508 public const uint k_unMaxDistortionFunctionParameters = 8 ;
74937509 public const uint k_unScreenshotHandleInvalid = 0 ;
7494- public const string IVRSystem_Version = "IVRSystem_021 " ;
7510+ public const string IVRSystem_Version = "IVRSystem_022 " ;
74957511 public const string IVRExtendedDisplay_Version = "IVRExtendedDisplay_001" ;
74967512 public const string IVRTrackedCamera_Version = "IVRTrackedCamera_006" ;
74977513 public const uint k_unMaxApplicationKeyLength = 128 ;
74987514 public const string k_pch_MimeType_HomeApp = "vr/home" ;
74997515 public const string k_pch_MimeType_GameTheater = "vr/game_theater" ;
75007516 public const string IVRApplications_Version = "IVRApplications_007" ;
7501- public const string IVRChaperone_Version = "IVRChaperone_003 " ;
7517+ public const string IVRChaperone_Version = "IVRChaperone_004 " ;
75027518 public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_006" ;
75037519 public const string IVRCompositor_Version = "IVRCompositor_026" ;
75047520 public const uint k_unVROverlayMaxKeyLength = 128 ;
@@ -7657,15 +7673,15 @@ public static uint GetInitToken()
76577673 public const string k_pch_CollisionBounds_EnableDriverImport = "enableDriverBoundsImport" ;
76587674 public const string k_pch_Camera_Section = "camera" ;
76597675 public const string k_pch_Camera_EnableCamera_Bool = "enableCamera" ;
7660- public const string k_pch_Camera_EnableCameraInDashboard_Bool = "enableCameraInDashboard " ;
7676+ public const string k_pch_Camera_ShowOnController_Bool = "showOnController " ;
76617677 public const string k_pch_Camera_EnableCameraForCollisionBounds_Bool = "enableCameraForCollisionBounds" ;
7662- public const string k_pch_Camera_EnableCameraForRoomView_Bool = "enableCameraForRoomView " ;
7678+ public const string k_pch_Camera_RoomView_Int32 = "roomView " ;
76637679 public const string k_pch_Camera_BoundsColorGammaR_Int32 = "cameraBoundsColorGammaR" ;
76647680 public const string k_pch_Camera_BoundsColorGammaG_Int32 = "cameraBoundsColorGammaG" ;
76657681 public const string k_pch_Camera_BoundsColorGammaB_Int32 = "cameraBoundsColorGammaB" ;
76667682 public const string k_pch_Camera_BoundsColorGammaA_Int32 = "cameraBoundsColorGammaA" ;
76677683 public const string k_pch_Camera_BoundsStrength_Int32 = "cameraBoundsStrength" ;
7668- public const string k_pch_Camera_RoomViewMode_Int32 = "cameraRoomViewMode " ;
7684+ public const string k_pch_Camera_RoomViewStyle_Int32 = "roomViewStyle " ;
76697685 public const string k_pch_audio_Section = "audio" ;
76707686 public const string k_pch_audio_SetOsDefaultPlaybackDevice_Bool = "setOsDefaultPlaybackDevice" ;
76717687 public const string k_pch_audio_EnablePlaybackDeviceOverride_Bool = "enablePlaybackDeviceOverride" ;
@@ -8147,5 +8163,5 @@ public static void Shutdown()
81478163
81488164
81498165}
8166+ #endif
81508167
8151- #endif
0 commit comments