1 /* 2 OpenVR for PyMOL Copyright Notice 3 ===================================== 4 5 The OpenVR for PyMOL source code is copyrighted, but you can freely use and 6 copy it as long as you don't change or remove any of the Copyright notices. 7 OpenVR for PyMOL is made available under the following open-source license 8 terms: 9 10 ------------------------------------------------------------------------------ 11 Copyright (c) 2018 EPAM Systems, Inc. 12 13 Permission is hereby granted, free of charge, to any person obtaining a copy 14 of this software and associated documentation files (the "Software"), to deal 15 in the Software without restriction, including without limitation the rights 16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 copies of the Software, and to permit persons to whom the Software is 18 furnished to do so, subject to the following conditions: 19 20 The above copyright notice and this permission notice shall be included in all 21 copies or substantial portions of the Software. 22 23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 SOFTWARE. 30 ------------------------------------------------------------------------------ 31 32 */ 33 34 #ifndef _H_OpenVRStub 35 #define _H_OpenVRStub 36 37 // system headers 38 #include "openvr.h" 39 40 namespace vr { 41 namespace stub { 42 43 void VR_StubEnable(bool on = true); 44 bool VR_IsStubEnabled(void); 45 46 /** Finds the active installation of the VR API and initializes it. The provided path must be absolute 47 * or relative to the current working directory. These are the local install versions of the equivalent 48 * functions in steamvr.h and will work without a local Steam install. 49 * 50 * This path is to the "root" of the VR API install. That's the directory with 51 * the "drivers" directory and a platform (i.e. "win32") directory in it, not the directory with the DLL itself. 52 * 53 * pStartupInfo is reserved for future use. 54 */ 55 IVRSystem *VR_Init(EVRInitError *peError, EVRApplicationType eApplicationType, const char *pStartupInfo = nullptr); 56 57 /** unloads vrclient.dll. Any interface pointers from the interface are 58 * invalid after this point */ 59 void VR_Shutdown(); 60 61 /** Returns true if there is an HMD attached. This check is as lightweight as possible and 62 * can be called outside of VR_Init/VR_Shutdown. It should be used when an application wants 63 * to know if initializing VR is a possibility but isn't ready to take that step yet. 64 */ 65 bool VR_IsHmdPresent(); 66 67 /** Returns an English string for an EVRInitError. Applications should call VR_GetVRInitErrorAsSymbol instead and 68 * use that as a key to look up their own localized error message. This function may be called outside of VR_Init()/VR_Shutdown(). */ 69 const char *VR_GetVRInitErrorAsEnglishDescription(EVRInitError error); 70 71 IVRSystem *VRSystem(); 72 IVRCompositor *VRCompositor(); 73 IVRInput *VRInput(); 74 75 #define VRSTUB_NOT_IMPLEMENTED \ 76 throw __FUNCTION__; // " not implemented"; 77 78 class VRSystemStub: public IVRSystem { 79 public: 80 // ------------------------------------ 81 // Display Methods 82 // ------------------------------------ 83 84 /** Suggested size for the intermediate render target that the distortion pulls from. */ 85 virtual void GetRecommendedRenderTargetSize( uint32_t *pnWidth, uint32_t *pnHeight ); 86 87 /** The projection matrix for the specified eye */ GetProjectionMatrix(EVREye eEye,float fNearZ,float fFarZ)88 virtual HmdMatrix44_t GetProjectionMatrix( EVREye eEye, float fNearZ, float fFarZ ) { VRSTUB_NOT_IMPLEMENTED } 89 90 /** The components necessary to build your own projection matrix in case your 91 * application is doing something fancy like infinite Z */ 92 virtual void GetProjectionRaw( EVREye eEye, float *pfLeft, float *pfRight, float *pfTop, float *pfBottom ); 93 94 /** Gets the result of the distortion function for the specified eye and input UVs. UVs go from 0,0 in 95 * the upper left of that eye's viewport and 1,1 in the lower right of that eye's viewport. 96 * Returns true for success. Otherwise, returns false, and distortion coordinates are not suitable. */ ComputeDistortion(EVREye eEye,float fU,float fV,DistortionCoordinates_t * pDistortionCoordinates)97 virtual bool ComputeDistortion( EVREye eEye, float fU, float fV, DistortionCoordinates_t *pDistortionCoordinates ) { VRSTUB_NOT_IMPLEMENTED } 98 99 /** Returns the transform from eye space to the head space. Eye space is the per-eye flavor of head 100 * space that provides stereo disparity. Instead of Model * View * Projection the sequence is Model * View * Eye^-1 * Projection. 101 * Normally View and Eye^-1 will be multiplied together and treated as View in your application. 102 */ 103 virtual HmdMatrix34_t GetEyeToHeadTransform( EVREye eEye ); 104 105 /** Returns the number of elapsed seconds since the last recorded vsync event. This 106 * will come from a vsync timer event in the timer if possible or from the application-reported 107 * time if that is not available. If no vsync times are available the function will 108 * return zero for vsync time and frame counter and return false from the method. */ GetTimeSinceLastVsync(float * pfSecondsSinceLastVsync,uint64_t * pulFrameCounter)109 virtual bool GetTimeSinceLastVsync( float *pfSecondsSinceLastVsync, uint64_t *pulFrameCounter ) { VRSTUB_NOT_IMPLEMENTED } 110 111 /** [D3D9 Only] 112 * Returns the adapter index that the user should pass into CreateDevice to set up D3D9 in such 113 * a way that it can go full screen exclusive on the HMD. Returns -1 if there was an error. 114 */ GetD3D9AdapterIndex()115 virtual int32_t GetD3D9AdapterIndex() { VRSTUB_NOT_IMPLEMENTED } 116 117 /** [D3D10/11 Only] 118 * Returns the adapter index that the user should pass into EnumAdapters to create the device 119 * and swap chain in DX10 and DX11. If an error occurs the index will be set to -1. 120 */ GetDXGIOutputInfo(int32_t * pnAdapterIndex)121 virtual void GetDXGIOutputInfo( int32_t *pnAdapterIndex ) { VRSTUB_NOT_IMPLEMENTED } 122 123 /** 124 * Returns platform- and texture-type specific adapter identification so that applications and the 125 * compositor are creating textures and swap chains on the same GPU. If an error occurs the device 126 * will be set to 0. 127 * pInstance is an optional parameter that is required only when textureType is TextureType_Vulkan. 128 * [D3D10/11/12 Only (D3D9 Not Supported)] 129 * Returns the adapter LUID that identifies the GPU attached to the HMD. The user should 130 * enumerate all adapters using IDXGIFactory::EnumAdapters and IDXGIAdapter::GetDesc to find 131 * the adapter with the matching LUID, or use IDXGIFactory4::EnumAdapterByLuid. 132 * The discovered IDXGIAdapter should be used to create the device and swap chain. 133 * [Vulkan Only] 134 * Returns the VkPhysicalDevice that should be used by the application. 135 * pInstance must be the instance the application will use to query for the VkPhysicalDevice. The application 136 * must create the VkInstance with extensions returned by IVRCompositor::GetVulkanInstanceExtensionsRequired enabled. 137 * [macOS Only] 138 * For TextureType_IOSurface returns the id<MTLDevice> that should be used by the application. 139 * On 10.13+ for TextureType_OpenGL returns the 'registryId' of the renderer which should be used 140 * by the application. See Apple Technical Q&A QA1168 for information on enumerating GL Renderers, and the 141 * new kCGLRPRegistryIDLow and kCGLRPRegistryIDHigh CGLRendererProperty values in the 10.13 SDK. 142 * Pre 10.13 for TextureType_OpenGL returns 0, as there is no dependable way to correlate the HMDs MTLDevice 143 * with a GL Renderer. 144 */ 145 virtual void GetOutputDevice( uint64_t *pnDevice, ETextureType textureType, VkInstance_T *pInstance = nullptr ) { VRSTUB_NOT_IMPLEMENTED } 146 147 // ------------------------------------ 148 // Display Mode methods 149 // ------------------------------------ 150 151 /** Use to determine if the headset display is part of the desktop (i.e. extended) or hidden (i.e. direct mode). */ IsDisplayOnDesktop()152 virtual bool IsDisplayOnDesktop() { VRSTUB_NOT_IMPLEMENTED } 153 154 /** Set the display visibility (true = extended, false = direct mode). Return value of true indicates that the change was successful. */ SetDisplayVisibility(bool bIsVisibleOnDesktop)155 virtual bool SetDisplayVisibility( bool bIsVisibleOnDesktop ) { VRSTUB_NOT_IMPLEMENTED } 156 157 // ------------------------------------ 158 // Tracking Methods 159 // ------------------------------------ 160 161 /** The pose that the tracker thinks that the HMD will be in at the specified number of seconds into the 162 * future. Pass 0 to get the state at the instant the method is called. Most of the time the application should 163 * calculate the time until the photons will be emitted from the display and pass that time into the method. 164 * 165 * This is roughly analogous to the inverse of the view matrix in most applications, though 166 * many games will need to do some additional rotation or translation on top of the rotation 167 * and translation provided by the head pose. 168 * 169 * For devices where bPoseIsValid is true the application can use the pose to position the device 170 * in question. The provided array can be any size up to k_unMaxTrackedDeviceCount. 171 * 172 * Seated experiences should call this method with TrackingUniverseSeated and receive poses relative 173 * to the seated zero pose. Standing experiences should call this method with TrackingUniverseStanding 174 * and receive poses relative to the Chaperone Play Area. TrackingUniverseRawAndUncalibrated should 175 * probably not be used unless the application is the Chaperone calibration tool itself, but will provide 176 * poses relative to the hardware-specific coordinate system in the driver. 177 */ GetDeviceToAbsoluteTrackingPose(ETrackingUniverseOrigin eOrigin,float fPredictedSecondsToPhotonsFromNow,VR_ARRAY_COUNT (unTrackedDevicePoseArrayCount)TrackedDevicePose_t * pTrackedDevicePoseArray,uint32_t unTrackedDevicePoseArrayCount)178 virtual void GetDeviceToAbsoluteTrackingPose( ETrackingUniverseOrigin eOrigin, float fPredictedSecondsToPhotonsFromNow, VR_ARRAY_COUNT(unTrackedDevicePoseArrayCount) TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount ) { VRSTUB_NOT_IMPLEMENTED } 179 180 /** Sets the zero pose for the seated tracker coordinate system to the current position and yaw of the HMD. After 181 * ResetSeatedZeroPose all GetDeviceToAbsoluteTrackingPose calls that pass TrackingUniverseSeated as the origin 182 * will be relative to this new zero pose. The new zero coordinate system will not change the fact that the Y axis 183 * is up in the real world, so the next pose returned from GetDeviceToAbsoluteTrackingPose after a call to 184 * ResetSeatedZeroPose may not be exactly an identity matrix. 185 * 186 * NOTE: This function overrides the user's previously saved seated zero pose and should only be called as the result of a user action. 187 * Users are also able to set their seated zero pose via the OpenVR Dashboard. 188 **/ ResetSeatedZeroPose()189 virtual void ResetSeatedZeroPose() { VRSTUB_NOT_IMPLEMENTED } 190 191 /** Returns the transform from the seated zero pose to the standing absolute tracking system. This allows 192 * applications to represent the seated origin to used or transform object positions from one coordinate 193 * system to the other. 194 * 195 * The seated origin may or may not be inside the Play Area or Collision Bounds returned by IVRChaperone. Its position 196 * depends on what the user has set from the Dashboard settings and previous calls to ResetSeatedZeroPose. */ GetSeatedZeroPoseToStandingAbsoluteTrackingPose()197 virtual HmdMatrix34_t GetSeatedZeroPoseToStandingAbsoluteTrackingPose() { VRSTUB_NOT_IMPLEMENTED } 198 199 /** Returns the transform from the tracking origin to the standing absolute tracking system. This allows 200 * applications to convert from raw tracking space to the calibrated standing coordinate system. */ GetRawZeroPoseToStandingAbsoluteTrackingPose()201 virtual HmdMatrix34_t GetRawZeroPoseToStandingAbsoluteTrackingPose() { VRSTUB_NOT_IMPLEMENTED } 202 203 /** Get a sorted array of device indices of a given class of tracked devices (e.g. controllers). Devices are sorted right to left 204 * relative to the specified tracked device (default: hmd -- pass in -1 for absolute tracking space). Returns the number of devices 205 * in the list, or the size of the array needed if not large enough. */ 206 virtual uint32_t GetSortedTrackedDeviceIndicesOfClass( ETrackedDeviceClass eTrackedDeviceClass, VR_ARRAY_COUNT(unTrackedDeviceIndexArrayCount) vr::TrackedDeviceIndex_t *punTrackedDeviceIndexArray, uint32_t unTrackedDeviceIndexArrayCount, vr::TrackedDeviceIndex_t unRelativeToTrackedDeviceIndex = k_unTrackedDeviceIndex_Hmd ) { VRSTUB_NOT_IMPLEMENTED } 207 208 /** Returns the level of activity on the device. */ GetTrackedDeviceActivityLevel(vr::TrackedDeviceIndex_t unDeviceId)209 virtual EDeviceActivityLevel GetTrackedDeviceActivityLevel( vr::TrackedDeviceIndex_t unDeviceId ) { VRSTUB_NOT_IMPLEMENTED } 210 211 /** Convenience utility to apply the specified transform to the specified pose. 212 * This properly transforms all pose components, including velocity and angular velocity 213 */ ApplyTransform(TrackedDevicePose_t * pOutputPose,const TrackedDevicePose_t * pTrackedDevicePose,const HmdMatrix34_t * pTransform)214 virtual void ApplyTransform( TrackedDevicePose_t *pOutputPose, const TrackedDevicePose_t *pTrackedDevicePose, const HmdMatrix34_t *pTransform ) { VRSTUB_NOT_IMPLEMENTED } 215 216 /** Returns the device index associated with a specific role, for example the left hand or the right hand. */ GetTrackedDeviceIndexForControllerRole(vr::ETrackedControllerRole unDeviceType)217 virtual vr::TrackedDeviceIndex_t GetTrackedDeviceIndexForControllerRole( vr::ETrackedControllerRole unDeviceType ) { VRSTUB_NOT_IMPLEMENTED } 218 219 /** Returns the controller type associated with a device index. */ GetControllerRoleForTrackedDeviceIndex(vr::TrackedDeviceIndex_t unDeviceIndex)220 virtual vr::ETrackedControllerRole GetControllerRoleForTrackedDeviceIndex( vr::TrackedDeviceIndex_t unDeviceIndex ) { VRSTUB_NOT_IMPLEMENTED } 221 222 // ------------------------------------ 223 // Property methods 224 // ------------------------------------ 225 226 /** Returns the device class of a tracked device. If there has not been a device connected in this slot 227 * since the application started this function will return TrackedDevice_Invalid. For previous detected 228 * devices the function will return the previously observed device class. 229 * 230 * To determine which devices exist on the system, just loop from 0 to k_unMaxTrackedDeviceCount and check 231 * the device class. Every device with something other than TrackedDevice_Invalid is associated with an 232 * actual tracked device. */ 233 virtual ETrackedDeviceClass GetTrackedDeviceClass( vr::TrackedDeviceIndex_t unDeviceIndex ); 234 235 /** Returns true if there is a device connected in this slot. */ IsTrackedDeviceConnected(vr::TrackedDeviceIndex_t unDeviceIndex)236 virtual bool IsTrackedDeviceConnected( vr::TrackedDeviceIndex_t unDeviceIndex ) { VRSTUB_NOT_IMPLEMENTED } 237 238 /** Returns a bool property. If the device index is not valid or the property is not a bool type this function will return false. */ 239 virtual bool GetBoolTrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L ) { VRSTUB_NOT_IMPLEMENTED } 240 241 /** Returns a float property. If the device index is not valid or the property is not a float type this function will return 0. */ 242 virtual float GetFloatTrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L ) { VRSTUB_NOT_IMPLEMENTED } 243 244 /** Returns an int property. If the device index is not valid or the property is not a int type this function will return 0. */ 245 virtual int32_t GetInt32TrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L ) { VRSTUB_NOT_IMPLEMENTED } 246 247 /** Returns a uint64 property. If the device index is not valid or the property is not a uint64 type this function will return 0. */ 248 virtual uint64_t GetUint64TrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L ) { VRSTUB_NOT_IMPLEMENTED } 249 250 /** Returns a matrix property. If the device index is not valid or the property is not a matrix type, this function will return identity. */ 251 virtual HmdMatrix34_t GetMatrix34TrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, ETrackedPropertyError *pError = 0L ) { VRSTUB_NOT_IMPLEMENTED } 252 253 /** Returns an array of one type of property. If the device index is not valid or the property is not a single value or an array of the specified type, 254 * this function will return 0. Otherwise it returns the number of bytes necessary to hold the array of properties. If unBufferSize is 255 * greater than the returned size and pBuffer is non-NULL, pBuffer is filled with the contents of array of properties. */ 256 virtual uint32_t GetArrayTrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, PropertyTypeTag_t propType, void *pBuffer, uint32_t unBufferSize, ETrackedPropertyError *pError = 0L ) { VRSTUB_NOT_IMPLEMENTED } 257 258 /** Returns a string property. If the device index is not valid or the property is not a string type this function will 259 * return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing 260 * null. Strings will always fit in buffers of k_unMaxPropertyStringSize characters. */ 261 virtual uint32_t GetStringTrackedDeviceProperty( vr::TrackedDeviceIndex_t unDeviceIndex, ETrackedDeviceProperty prop, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize, ETrackedPropertyError *pError = 0L ); 262 263 /** returns a string that corresponds with the specified property error. The string will be the name 264 * of the error enum value for all valid error codes */ GetPropErrorNameFromEnum(ETrackedPropertyError error)265 virtual const char *GetPropErrorNameFromEnum( ETrackedPropertyError error ) { VRSTUB_NOT_IMPLEMENTED } 266 267 // ------------------------------------ 268 // Event methods 269 // ------------------------------------ 270 271 /** Returns true and fills the event with the next event on the queue if there is one. If there are no events 272 * this method returns false. uncbVREvent should be the size in bytes of the VREvent_t struct */ 273 virtual bool PollNextEvent( VREvent_t *pEvent, uint32_t uncbVREvent ); 274 275 /** Returns true and fills the event with the next event on the queue if there is one. If there are no events 276 * this method returns false. Fills in the pose of the associated tracked device in the provided pose struct. 277 * This pose will always be older than the call to this function and should not be used to render the device. 278 uncbVREvent should be the size in bytes of the VREvent_t struct */ PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,VREvent_t * pEvent,uint32_t uncbVREvent,vr::TrackedDevicePose_t * pTrackedDevicePose)279 virtual bool PollNextEventWithPose( ETrackingUniverseOrigin eOrigin, VREvent_t *pEvent, uint32_t uncbVREvent, vr::TrackedDevicePose_t *pTrackedDevicePose ) { VRSTUB_NOT_IMPLEMENTED } 280 281 /** returns the name of an EVREvent enum value */ GetEventTypeNameFromEnum(EVREventType eType)282 virtual const char *GetEventTypeNameFromEnum( EVREventType eType ) { VRSTUB_NOT_IMPLEMENTED } 283 284 // ------------------------------------ 285 // Rendering helper methods 286 // ------------------------------------ 287 288 /** Returns the hidden area mesh for the current HMD. The pixels covered by this mesh will never be seen by the user after the lens distortion is 289 * applied based on visibility to the panels. If this HMD does not have a hidden area mesh, the vertex data and count will be NULL and 0 respectively. 290 * This mesh is meant to be rendered into the stencil buffer (or into the depth buffer setting nearz) before rendering each eye's view. 291 * This will improve performance by letting the GPU early-reject pixels the user will never see before running the pixel shader. 292 * NOTE: Render this mesh with backface culling disabled since the winding order of the vertices can be different per-HMD or per-eye. 293 * Setting the bInverse argument to true will produce the visible area mesh that is commonly used in place of full-screen quads. The visible area mesh covers all of the pixels the hidden area mesh does not cover. 294 * Setting the bLineLoop argument will return a line loop of vertices in HiddenAreaMesh_t->pVertexData with HiddenAreaMesh_t->unTriangleCount set to the number of vertices. 295 */ 296 virtual HiddenAreaMesh_t GetHiddenAreaMesh( EVREye eEye, EHiddenAreaMeshType type = k_eHiddenAreaMesh_Standard ) { VRSTUB_NOT_IMPLEMENTED } 297 298 // ------------------------------------ 299 // Controller methods 300 // ------------------------------------ 301 302 /** Fills the supplied struct with the current state of the controller. Returns false if the controller index 303 * is invalid. */ GetControllerState(vr::TrackedDeviceIndex_t unControllerDeviceIndex,vr::VRControllerState_t * pControllerState,uint32_t unControllerStateSize)304 virtual bool GetControllerState( vr::TrackedDeviceIndex_t unControllerDeviceIndex, vr::VRControllerState_t *pControllerState, uint32_t unControllerStateSize ) { VRSTUB_NOT_IMPLEMENTED } 305 306 /** fills the supplied struct with the current state of the controller and the provided pose with the pose of 307 * the controller when the controller state was updated most recently. Use this form if you need a precise controller 308 * pose as input to your application when the user presses or releases a button. */ GetControllerStateWithPose(ETrackingUniverseOrigin eOrigin,vr::TrackedDeviceIndex_t unControllerDeviceIndex,vr::VRControllerState_t * pControllerState,uint32_t unControllerStateSize,TrackedDevicePose_t * pTrackedDevicePose)309 virtual bool GetControllerStateWithPose( ETrackingUniverseOrigin eOrigin, vr::TrackedDeviceIndex_t unControllerDeviceIndex, vr::VRControllerState_t *pControllerState, uint32_t unControllerStateSize, TrackedDevicePose_t *pTrackedDevicePose ) { VRSTUB_NOT_IMPLEMENTED } 310 311 /** Trigger a single haptic pulse on a controller. After this call the application may not trigger another haptic pulse on this controller 312 * and axis combination for 5ms. */ TriggerHapticPulse(vr::TrackedDeviceIndex_t unControllerDeviceIndex,uint32_t unAxisId,unsigned short usDurationMicroSec)313 virtual void TriggerHapticPulse( vr::TrackedDeviceIndex_t unControllerDeviceIndex, uint32_t unAxisId, unsigned short usDurationMicroSec ) { VRSTUB_NOT_IMPLEMENTED } 314 315 /** returns the name of an EVRButtonId enum value */ GetButtonIdNameFromEnum(EVRButtonId eButtonId)316 virtual const char *GetButtonIdNameFromEnum( EVRButtonId eButtonId ) { VRSTUB_NOT_IMPLEMENTED } 317 318 /** returns the name of an EVRControllerAxisType enum value */ GetControllerAxisTypeNameFromEnum(EVRControllerAxisType eAxisType)319 virtual const char *GetControllerAxisTypeNameFromEnum( EVRControllerAxisType eAxisType ) { VRSTUB_NOT_IMPLEMENTED } 320 321 /** Returns true if this application is receiving input from the system. This would return false if 322 * system-related functionality is consuming the input stream. */ IsInputAvailable()323 virtual bool IsInputAvailable() { VRSTUB_NOT_IMPLEMENTED } 324 325 /** Returns true SteamVR is drawing controllers on top of the application. Applications should consider 326 * not drawing anything attached to the user's hands in this case. */ IsSteamVRDrawingControllers()327 virtual bool IsSteamVRDrawingControllers() { VRSTUB_NOT_IMPLEMENTED } 328 329 /** Returns true if the user has put SteamVR into a mode that is distracting them from the application. 330 * For applications where this is appropriate, the application should pause ongoing activity. */ ShouldApplicationPause()331 virtual bool ShouldApplicationPause() { VRSTUB_NOT_IMPLEMENTED } 332 333 /** Returns true if SteamVR is doing significant rendering work and the game should do what it can to reduce 334 * its own workload. One common way to do this is to reduce the size of the render target provided for each eye. */ ShouldApplicationReduceRenderingWork()335 virtual bool ShouldApplicationReduceRenderingWork() { VRSTUB_NOT_IMPLEMENTED } 336 337 // ------------------------------------ 338 // Debug Methods 339 // ------------------------------------ 340 341 /** Sends a request to the driver for the specified device and returns the response. The maximum response size is 32k, 342 * but this method can be called with a smaller buffer. If the response exceeds the size of the buffer, it is truncated. 343 * The size of the response including its terminating null is returned. */ DriverDebugRequest(vr::TrackedDeviceIndex_t unDeviceIndex,const char * pchRequest,VR_OUT_STRING ()char * pchResponseBuffer,uint32_t unResponseBufferSize)344 virtual uint32_t DriverDebugRequest( vr::TrackedDeviceIndex_t unDeviceIndex, const char *pchRequest, VR_OUT_STRING() char *pchResponseBuffer, uint32_t unResponseBufferSize ) { VRSTUB_NOT_IMPLEMENTED } 345 346 // ------------------------------------ 347 // Firmware methods 348 // ------------------------------------ 349 350 /** Performs the actual firmware update if applicable. 351 * The following events will be sent, if VRFirmwareError_None was returned: VREvent_FirmwareUpdateStarted, VREvent_FirmwareUpdateFinished 352 * Use the properties Prop_Firmware_UpdateAvailable_Bool, Prop_Firmware_ManualUpdate_Bool, and Prop_Firmware_ManualUpdateURL_String 353 * to figure our whether a firmware update is available, and to figure out whether its a manual update 354 * Prop_Firmware_ManualUpdateURL_String should point to an URL describing the manual update process */ PerformFirmwareUpdate(vr::TrackedDeviceIndex_t unDeviceIndex)355 virtual vr::EVRFirmwareError PerformFirmwareUpdate( vr::TrackedDeviceIndex_t unDeviceIndex ) { VRSTUB_NOT_IMPLEMENTED } 356 357 // ------------------------------------ 358 // Application life cycle methods 359 // ------------------------------------ 360 361 /** Call this to acknowledge to the system that VREvent_Quit has been received and that the process is exiting. 362 * This extends the timeout until the process is killed. */ AcknowledgeQuit_Exiting()363 virtual void AcknowledgeQuit_Exiting() { VRSTUB_NOT_IMPLEMENTED } 364 365 /** Call this to tell the system that the user is being prompted to save data. This 366 * halts the timeout and dismisses the dashboard (if it was up). Applications should be sure to actually 367 * prompt the user to save and then exit afterward, otherwise the user will be left in a confusing state. */ AcknowledgeQuit_UserPrompt()368 virtual void AcknowledgeQuit_UserPrompt() { VRSTUB_NOT_IMPLEMENTED } 369 370 }; 371 372 class VRCompositorStub: public IVRCompositor { 373 public: 374 /** Sets tracking space returned by WaitGetPoses */ SetTrackingSpace(ETrackingUniverseOrigin eOrigin)375 virtual void SetTrackingSpace( ETrackingUniverseOrigin eOrigin ) { VRSTUB_NOT_IMPLEMENTED } 376 377 /** Gets current tracking space returned by WaitGetPoses */ GetTrackingSpace()378 virtual ETrackingUniverseOrigin GetTrackingSpace() { VRSTUB_NOT_IMPLEMENTED } 379 380 /** Scene applications should call this function to get poses to render with (and optionally poses predicted an additional frame out to use for gameplay). 381 * This function will block until "running start" milliseconds before the start of the frame, and should be called at the last moment before needing to 382 * start rendering. 383 * 384 * Return codes: 385 * - IsNotSceneApplication (make sure to call VR_Init with VRApplicaiton_Scene) 386 * - DoNotHaveFocus (some other app has taken focus - this will throttle the call to 10hz to reduce the impact on that app) 387 */ 388 virtual EVRCompositorError WaitGetPoses( VR_ARRAY_COUNT(unRenderPoseArrayCount) TrackedDevicePose_t* pRenderPoseArray, uint32_t unRenderPoseArrayCount, 389 VR_ARRAY_COUNT(unGamePoseArrayCount) TrackedDevicePose_t* pGamePoseArray, uint32_t unGamePoseArrayCount ); 390 391 /** Get the last set of poses returned by WaitGetPoses. */ GetLastPoses(VR_ARRAY_COUNT (unRenderPoseArrayCount)TrackedDevicePose_t * pRenderPoseArray,uint32_t unRenderPoseArrayCount,VR_ARRAY_COUNT (unGamePoseArrayCount)TrackedDevicePose_t * pGamePoseArray,uint32_t unGamePoseArrayCount)392 virtual EVRCompositorError GetLastPoses( VR_ARRAY_COUNT( unRenderPoseArrayCount ) TrackedDevicePose_t* pRenderPoseArray, uint32_t unRenderPoseArrayCount, 393 VR_ARRAY_COUNT( unGamePoseArrayCount ) TrackedDevicePose_t* pGamePoseArray, uint32_t unGamePoseArrayCount ) { VRSTUB_NOT_IMPLEMENTED } 394 395 /** Interface for accessing last set of poses returned by WaitGetPoses one at a time. 396 * Returns VRCompositorError_IndexOutOfRange if unDeviceIndex not less than k_unMaxTrackedDeviceCount otherwise VRCompositorError_None. 397 * It is okay to pass NULL for either pose if you only want one of the values. */ GetLastPoseForTrackedDeviceIndex(TrackedDeviceIndex_t unDeviceIndex,TrackedDevicePose_t * pOutputPose,TrackedDevicePose_t * pOutputGamePose)398 virtual EVRCompositorError GetLastPoseForTrackedDeviceIndex( TrackedDeviceIndex_t unDeviceIndex, TrackedDevicePose_t *pOutputPose, TrackedDevicePose_t *pOutputGamePose ) { VRSTUB_NOT_IMPLEMENTED } 399 400 /** Updated scene texture to display. If pBounds is NULL the entire texture will be used. If called from an OpenGL app, consider adding a glFlush after 401 * Submitting both frames to signal the driver to start processing, otherwise it may wait until the command buffer fills up, causing the app to miss frames. 402 * 403 * OpenGL dirty state: 404 * glBindTexture 405 * 406 * Return codes: 407 * - IsNotSceneApplication (make sure to call VR_Init with VRApplicaiton_Scene) 408 * - DoNotHaveFocus (some other app has taken focus) 409 * - TextureIsOnWrongDevice (application did not use proper AdapterIndex - see IVRSystem.GetDXGIOutputInfo) 410 * - SharedTexturesNotSupported (application needs to call CreateDXGIFactory1 or later before creating DX device) 411 * - TextureUsesUnsupportedFormat (scene textures must be compatible with DXGI sharing rules - e.g. uncompressed, no mips, etc.) 412 * - InvalidTexture (usually means bad arguments passed in) 413 * - AlreadySubmitted (app has submitted two left textures or two right textures in a single frame - i.e. before calling WaitGetPoses again) 414 */ 415 virtual EVRCompositorError Submit( EVREye eEye, const Texture_t *pTexture, const VRTextureBounds_t* pBounds = 0, EVRSubmitFlags nSubmitFlags = Submit_Default ); 416 417 /** Clears the frame that was sent with the last call to Submit. This will cause the 418 * compositor to show the grid until Submit is called again. */ ClearLastSubmittedFrame()419 virtual void ClearLastSubmittedFrame() { VRSTUB_NOT_IMPLEMENTED } 420 421 /** Call immediately after presenting your app's window (i.e. companion window) to unblock the compositor. 422 * This is an optional call, which only needs to be used if you can't instead call WaitGetPoses immediately after Present. 423 * For example, if your engine's render and game loop are not on separate threads, or blocking the render thread until 3ms before the next vsync would 424 * introduce a deadlock of some sort. This function tells the compositor that you have finished all rendering after having Submitted buffers for both 425 * eyes, and it is free to start its rendering work. This should only be called from the same thread you are rendering on. */ PostPresentHandoff()426 virtual void PostPresentHandoff() { VRSTUB_NOT_IMPLEMENTED } 427 428 /** Returns true if timing data is filled it. Sets oldest timing info if nFramesAgo is larger than the stored history. 429 * Be sure to set timing.size = sizeof(Compositor_FrameTiming) on struct passed in before calling this function. */ 430 virtual bool GetFrameTiming( Compositor_FrameTiming *pTiming, uint32_t unFramesAgo = 0 ) { VRSTUB_NOT_IMPLEMENTED } 431 432 /** Interface for copying a range of timing data. Frames are returned in ascending order (oldest to newest) with the last being the most recent frame. 433 * Only the first entry's m_nSize needs to be set, as the rest will be inferred from that. Returns total number of entries filled out. */ GetFrameTimings(Compositor_FrameTiming * pTiming,uint32_t nFrames)434 virtual uint32_t GetFrameTimings( Compositor_FrameTiming *pTiming, uint32_t nFrames ) { VRSTUB_NOT_IMPLEMENTED } 435 436 /** Returns the time in seconds left in the current (as identified by FrameTiming's frameIndex) frame. 437 * Due to "running start", this value may roll over to the next frame before ever reaching 0.0. */ GetFrameTimeRemaining()438 virtual float GetFrameTimeRemaining() { VRSTUB_NOT_IMPLEMENTED } 439 440 /** Fills out stats accumulated for the last connected application. Pass in sizeof( Compositor_CumulativeStats ) as second parameter. */ GetCumulativeStats(Compositor_CumulativeStats * pStats,uint32_t nStatsSizeInBytes)441 virtual void GetCumulativeStats( Compositor_CumulativeStats *pStats, uint32_t nStatsSizeInBytes ) { VRSTUB_NOT_IMPLEMENTED } 442 443 /** Fades the view on the HMD to the specified color. The fade will take fSeconds, and the color values are between 444 * 0.0 and 1.0. This color is faded on top of the scene based on the alpha parameter. Removing the fade color instantly 445 * would be FadeToColor( 0.0, 0.0, 0.0, 0.0, 0.0 ). Values are in un-premultiplied alpha space. */ 446 virtual void FadeToColor( float fSeconds, float fRed, float fGreen, float fBlue, float fAlpha, bool bBackground = false ) { VRSTUB_NOT_IMPLEMENTED } 447 448 /** Get current fade color value. */ 449 virtual HmdColor_t GetCurrentFadeColor( bool bBackground = false ) { VRSTUB_NOT_IMPLEMENTED } 450 451 /** Fading the Grid in or out in fSeconds */ FadeGrid(float fSeconds,bool bFadeIn)452 virtual void FadeGrid( float fSeconds, bool bFadeIn ) { VRSTUB_NOT_IMPLEMENTED } 453 454 /** Get current alpha value of grid. */ GetCurrentGridAlpha()455 virtual float GetCurrentGridAlpha() { VRSTUB_NOT_IMPLEMENTED } 456 457 /** Override the skybox used in the compositor (e.g. for during level loads when the app can't feed scene images fast enough) 458 * Order is Front, Back, Left, Right, Top, Bottom. If only a single texture is passed, it is assumed in lat-long format. 459 * If two are passed, it is assumed a lat-long stereo pair. */ SetSkyboxOverride(VR_ARRAY_COUNT (unTextureCount)const Texture_t * pTextures,uint32_t unTextureCount)460 virtual EVRCompositorError SetSkyboxOverride( VR_ARRAY_COUNT( unTextureCount ) const Texture_t *pTextures, uint32_t unTextureCount ) { VRSTUB_NOT_IMPLEMENTED } 461 462 /** Resets compositor skybox back to defaults. */ ClearSkyboxOverride()463 virtual void ClearSkyboxOverride() { VRSTUB_NOT_IMPLEMENTED } 464 465 /** Brings the compositor window to the front. This is useful for covering any other window that may be on the HMD 466 * and is obscuring the compositor window. */ CompositorBringToFront()467 virtual void CompositorBringToFront() { VRSTUB_NOT_IMPLEMENTED } 468 469 /** Pushes the compositor window to the back. This is useful for allowing other applications to draw directly to the HMD. */ CompositorGoToBack()470 virtual void CompositorGoToBack() { VRSTUB_NOT_IMPLEMENTED } 471 472 /** Tells the compositor process to clean up and exit. You do not need to call this function at shutdown. Under normal 473 * circumstances the compositor will manage its own life cycle based on what applications are running. */ CompositorQuit()474 virtual void CompositorQuit() { VRSTUB_NOT_IMPLEMENTED } 475 476 /** Return whether the compositor is fullscreen */ IsFullscreen()477 virtual bool IsFullscreen() { VRSTUB_NOT_IMPLEMENTED } 478 479 /** Returns the process ID of the process that is currently rendering the scene */ GetCurrentSceneFocusProcess()480 virtual uint32_t GetCurrentSceneFocusProcess() { VRSTUB_NOT_IMPLEMENTED } 481 482 /** Returns the process ID of the process that rendered the last frame (or 0 if the compositor itself rendered the frame.) 483 * Returns 0 when fading out from an app and the app's process Id when fading into an app. */ GetLastFrameRenderer()484 virtual uint32_t GetLastFrameRenderer() { VRSTUB_NOT_IMPLEMENTED } 485 486 /** Returns true if the current process has the scene focus */ CanRenderScene()487 virtual bool CanRenderScene() { VRSTUB_NOT_IMPLEMENTED } 488 489 /** Creates a window on the primary monitor to display what is being shown in the headset. */ ShowMirrorWindow()490 virtual void ShowMirrorWindow() { VRSTUB_NOT_IMPLEMENTED } 491 492 /** Closes the mirror window. */ HideMirrorWindow()493 virtual void HideMirrorWindow() { VRSTUB_NOT_IMPLEMENTED } 494 495 /** Returns true if the mirror window is shown. */ IsMirrorWindowVisible()496 virtual bool IsMirrorWindowVisible() { VRSTUB_NOT_IMPLEMENTED } 497 498 /** Writes all images that the compositor knows about (including overlays) to a 'screenshots' folder in the SteamVR runtime root. */ CompositorDumpImages()499 virtual void CompositorDumpImages() { VRSTUB_NOT_IMPLEMENTED } 500 501 /** Let an app know it should be rendering with low resources. */ ShouldAppRenderWithLowResources()502 virtual bool ShouldAppRenderWithLowResources() { VRSTUB_NOT_IMPLEMENTED } 503 504 /** Override interleaved reprojection logic to force on. */ ForceInterleavedReprojectionOn(bool bOverride)505 virtual void ForceInterleavedReprojectionOn( bool bOverride ) { VRSTUB_NOT_IMPLEMENTED } 506 507 /** Force reconnecting to the compositor process. */ ForceReconnectProcess()508 virtual void ForceReconnectProcess() { VRSTUB_NOT_IMPLEMENTED } 509 510 /** Temporarily suspends rendering (useful for finer control over scene transitions). */ SuspendRendering(bool bSuspend)511 virtual void SuspendRendering( bool bSuspend ) { VRSTUB_NOT_IMPLEMENTED } 512 513 /** Opens a shared D3D11 texture with the undistorted composited image for each eye. Use ReleaseMirrorTextureD3D11 when finished 514 * instead of calling Release on the resource itself. */ GetMirrorTextureD3D11(vr::EVREye eEye,void * pD3D11DeviceOrResource,void ** ppD3D11ShaderResourceView)515 virtual vr::EVRCompositorError GetMirrorTextureD3D11( vr::EVREye eEye, void *pD3D11DeviceOrResource, void **ppD3D11ShaderResourceView ) { VRSTUB_NOT_IMPLEMENTED } ReleaseMirrorTextureD3D11(void * pD3D11ShaderResourceView)516 virtual void ReleaseMirrorTextureD3D11( void *pD3D11ShaderResourceView ) { VRSTUB_NOT_IMPLEMENTED } 517 518 /** Access to mirror textures from OpenGL. */ GetMirrorTextureGL(vr::EVREye eEye,vr::glUInt_t * pglTextureId,vr::glSharedTextureHandle_t * pglSharedTextureHandle)519 virtual vr::EVRCompositorError GetMirrorTextureGL( vr::EVREye eEye, vr::glUInt_t *pglTextureId, vr::glSharedTextureHandle_t *pglSharedTextureHandle ) { VRSTUB_NOT_IMPLEMENTED } ReleaseSharedGLTexture(vr::glUInt_t glTextureId,vr::glSharedTextureHandle_t glSharedTextureHandle)520 virtual bool ReleaseSharedGLTexture( vr::glUInt_t glTextureId, vr::glSharedTextureHandle_t glSharedTextureHandle ) { VRSTUB_NOT_IMPLEMENTED } LockGLSharedTextureForAccess(vr::glSharedTextureHandle_t glSharedTextureHandle)521 virtual void LockGLSharedTextureForAccess( vr::glSharedTextureHandle_t glSharedTextureHandle ) { VRSTUB_NOT_IMPLEMENTED } UnlockGLSharedTextureForAccess(vr::glSharedTextureHandle_t glSharedTextureHandle)522 virtual void UnlockGLSharedTextureForAccess( vr::glSharedTextureHandle_t glSharedTextureHandle ) { VRSTUB_NOT_IMPLEMENTED } 523 524 /** [Vulkan Only] 525 * return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing 526 * null. The string will be a space separated list of-required instance extensions to enable in VkCreateInstance */ GetVulkanInstanceExtensionsRequired(VR_OUT_STRING ()char * pchValue,uint32_t unBufferSize)527 virtual uint32_t GetVulkanInstanceExtensionsRequired( VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) { VRSTUB_NOT_IMPLEMENTED } 528 529 /** [Vulkan only] 530 * return 0. Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing 531 * null. The string will be a space separated list of required device extensions to enable in VkCreateDevice */ GetVulkanDeviceExtensionsRequired(VkPhysicalDevice_T * pPhysicalDevice,VR_OUT_STRING ()char * pchValue,uint32_t unBufferSize)532 virtual uint32_t GetVulkanDeviceExtensionsRequired( VkPhysicalDevice_T *pPhysicalDevice, VR_OUT_STRING() char *pchValue, uint32_t unBufferSize ) { VRSTUB_NOT_IMPLEMENTED } 533 534 /** [ Vulkan/D3D12 Only ] 535 * There are two purposes for SetExplicitTimingMode: 536 * 1. To get a more accurate GPU timestamp for when the frame begins in Vulkan/D3D12 applications. 537 * 2. (Optional) To avoid having WaitGetPoses access the Vulkan queue so that the queue can be accessed from 538 * another thread while WaitGetPoses is executing. 539 * 540 * More accurate GPU timestamp for the start of the frame is achieved by the application calling 541 * SubmitExplicitTimingData immediately before its first submission to the Vulkan/D3D12 queue. 542 * This is more accurate because normally this GPU timestamp is recorded during WaitGetPoses. In D3D11, 543 * WaitGetPoses queues a GPU timestamp write, but it does not actually get submitted to the GPU until the 544 * application flushes. By using SubmitExplicitTimingData, the timestamp is recorded at the same place for 545 * Vulkan/D3D12 as it is for D3D11, resulting in a more accurate GPU time measurement for the frame. 546 * 547 * Avoiding WaitGetPoses accessing the Vulkan queue can be achieved using SetExplicitTimingMode as well. If this is desired, 548 * the application should set the timing mode to Explicit_ApplicationPerformsPostPresentHandoff and *MUST* call PostPresentHandoff 549 * itself. If these conditions are met, then WaitGetPoses is guaranteed not to access the queue. Note that PostPresentHandoff 550 * and SubmitExplicitTimingData will access the queue, so only WaitGetPoses becomes safe for accessing the queue from another 551 * thread. */ SetExplicitTimingMode(EVRCompositorTimingMode eTimingMode)552 virtual void SetExplicitTimingMode( EVRCompositorTimingMode eTimingMode ) { VRSTUB_NOT_IMPLEMENTED } 553 554 /** [ Vulkan/D3D12 Only ] 555 * Submit explicit timing data. When SetExplicitTimingMode is true, this must be called immediately before 556 * the application's first vkQueueSubmit (Vulkan) or ID3D12CommandQueue::ExecuteCommandLists (D3D12) of each frame. 557 * This function will insert a GPU timestamp write just before the application starts its rendering. This function 558 * will perform a vkQueueSubmit on Vulkan so must not be done simultaneously with VkQueue operations on another thread. 559 * Returns VRCompositorError_RequestFailed if SetExplicitTimingMode is not enabled. */ SubmitExplicitTimingData()560 virtual EVRCompositorError SubmitExplicitTimingData() { VRSTUB_NOT_IMPLEMENTED } 561 }; 562 563 class VRInputStub: public IVRInput { 564 public: 565 566 // --------------- Handle management --------------- // 567 568 /** Sets the path to the action manifest JSON file that is used by this application. If this information 569 * was set on the Steam partner site, calls to this function are ignored. If the Steam partner site 570 * setting and the path provided by this call are different, VRInputError_MismatchedActionManifest is returned. 571 * This call must be made before the first call to UpdateActionState or IVRSystem::PollNextEvent. */ SetActionManifestPath(const char * pchActionManifestPath)572 virtual EVRInputError SetActionManifestPath( const char *pchActionManifestPath ) { return VRInputError_None; } 573 574 /** Returns a handle for an action set. This handle is used for all performance-sensitive calls. */ GetActionSetHandle(const char * pchActionSetName,VRActionSetHandle_t * pHandle)575 virtual EVRInputError GetActionSetHandle( const char *pchActionSetName, VRActionSetHandle_t *pHandle ) { *pHandle = (VRActionSetHandle_t)0xFACEFACE; return VRInputError_None; } 576 577 /** Returns a handle for an action. This handle is used for all performance-sensitive calls. */ GetActionHandle(const char * pchActionName,VRActionHandle_t * pHandle)578 virtual EVRInputError GetActionHandle( const char *pchActionName, VRActionHandle_t *pHandle ) { *pHandle = (VRActionHandle_t)0xFACEFACE; return VRInputError_None; } 579 580 /** Returns a handle for any path in the input system. E.g. /user/hand/right */ GetInputSourceHandle(const char * pchInputSourcePath,VRInputValueHandle_t * pHandle)581 virtual EVRInputError GetInputSourceHandle( const char *pchInputSourcePath, VRInputValueHandle_t *pHandle ) { *pHandle = (VRInputValueHandle_t)0xFACEFACE; return VRInputError_None; } 582 583 // --------------- Reading action state ------------------- // 584 585 /** Reads the current state into all actions. After this call, the results of Get*Action calls 586 * will be the same until the next call to UpdateActionState. */ UpdateActionState(VR_ARRAY_COUNT (unSetCount)VRActiveActionSet_t * pSets,uint32_t unSizeOfVRSelectedActionSet_t,uint32_t unSetCount)587 virtual EVRInputError UpdateActionState( VR_ARRAY_COUNT( unSetCount ) VRActiveActionSet_t *pSets, uint32_t unSizeOfVRSelectedActionSet_t, uint32_t unSetCount ) { return VRInputError_None; } 588 589 /** Reads the state of a digital action given its handle. This will return VRInputError_WrongType if the type of 590 * action is something other than digital */ 591 virtual EVRInputError GetDigitalActionData( VRActionHandle_t action, InputDigitalActionData_t *pActionData, uint32_t unActionDataSize, VRInputValueHandle_t ulRestrictToDevice ); 592 593 /** Reads the state of an analog action given its handle. This will return VRInputError_WrongType if the type of 594 * action is something other than analog */ 595 virtual EVRInputError GetAnalogActionData( VRActionHandle_t action, InputAnalogActionData_t *pActionData, uint32_t unActionDataSize, VRInputValueHandle_t ulRestrictToDevice ); 596 597 /** Reads the state of a pose action given its handle. */ 598 virtual EVRInputError GetPoseActionData( VRActionHandle_t action, ETrackingUniverseOrigin eOrigin, float fPredictedSecondsFromNow, InputPoseActionData_t *pActionData, uint32_t unActionDataSize, VRInputValueHandle_t ulRestrictToDevice ); 599 600 /** Reads the state of a skeletal action given its handle. */ GetSkeletalActionData(VRActionHandle_t action,InputSkeletalActionData_t * pActionData,uint32_t unActionDataSize,VRInputValueHandle_t ulRestrictToDevice)601 virtual EVRInputError GetSkeletalActionData( VRActionHandle_t action, InputSkeletalActionData_t *pActionData, uint32_t unActionDataSize, VRInputValueHandle_t ulRestrictToDevice ) { VRSTUB_NOT_IMPLEMENTED } 602 603 // --------------- Skeletal Bone Data ------------------- // 604 605 /** Reads the state of the skeletal bone data associated with this action and copies it into the given buffer. */ GetSkeletalBoneData(VRActionHandle_t action,EVRSkeletalTransformSpace eTransformSpace,EVRSkeletalMotionRange eMotionRange,VR_ARRAY_COUNT (unTransformArrayCount)VRBoneTransform_t * pTransformArray,uint32_t unTransformArrayCount,VRInputValueHandle_t ulRestrictToDevice)606 virtual EVRInputError GetSkeletalBoneData( VRActionHandle_t action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalMotionRange eMotionRange, VR_ARRAY_COUNT( unTransformArrayCount ) VRBoneTransform_t *pTransformArray, uint32_t unTransformArrayCount, VRInputValueHandle_t ulRestrictToDevice ) { VRSTUB_NOT_IMPLEMENTED } 607 608 /** Reads the state of the skeletal bone data in a compressed form that is suitable for 609 * sending over the network. The required buffer size will never exceed ( sizeof(VR_BoneTransform_t)*boneCount + 2). 610 * Usually the size will be much smaller. */ GetSkeletalBoneDataCompressed(VRActionHandle_t action,EVRSkeletalTransformSpace eTransformSpace,EVRSkeletalMotionRange eMotionRange,VR_OUT_BUFFER_COUNT (unCompressedSize)void * pvCompressedData,uint32_t unCompressedSize,uint32_t * punRequiredCompressedSize,VRInputValueHandle_t ulRestrictToDevice)611 virtual EVRInputError GetSkeletalBoneDataCompressed( VRActionHandle_t action, EVRSkeletalTransformSpace eTransformSpace, EVRSkeletalMotionRange eMotionRange, VR_OUT_BUFFER_COUNT( unCompressedSize ) void *pvCompressedData, uint32_t unCompressedSize, uint32_t *punRequiredCompressedSize, VRInputValueHandle_t ulRestrictToDevice ) { VRSTUB_NOT_IMPLEMENTED } 612 613 /** Turns a compressed buffer from GetSkeletalBoneDataCompressed and turns it back into a bone transform array. */ DecompressSkeletalBoneData(void * pvCompressedBuffer,uint32_t unCompressedBufferSize,EVRSkeletalTransformSpace * peTransformSpace,VR_ARRAY_COUNT (unTransformArrayCount)VRBoneTransform_t * pTransformArray,uint32_t unTransformArrayCount)614 virtual EVRInputError DecompressSkeletalBoneData( void *pvCompressedBuffer, uint32_t unCompressedBufferSize, EVRSkeletalTransformSpace *peTransformSpace, VR_ARRAY_COUNT( unTransformArrayCount ) VRBoneTransform_t *pTransformArray, uint32_t unTransformArrayCount ) { VRSTUB_NOT_IMPLEMENTED } 615 616 // --------------- Haptics ------------------- // 617 618 /** Triggers a haptic event as described by the specified action */ TriggerHapticVibrationAction(VRActionHandle_t action,float fStartSecondsFromNow,float fDurationSeconds,float fFrequency,float fAmplitude,VRInputValueHandle_t ulRestrictToDevice)619 virtual EVRInputError TriggerHapticVibrationAction( VRActionHandle_t action, float fStartSecondsFromNow, float fDurationSeconds, float fFrequency, float fAmplitude, VRInputValueHandle_t ulRestrictToDevice ) { VRSTUB_NOT_IMPLEMENTED } 620 621 // --------------- Action Origins ---------------- // 622 623 /** Retrieve origin handles for an action */ GetActionOrigins(VRActionSetHandle_t actionSetHandle,VRActionHandle_t digitalActionHandle,VR_ARRAY_COUNT (originOutCount)VRInputValueHandle_t * originsOut,uint32_t originOutCount)624 virtual EVRInputError GetActionOrigins( VRActionSetHandle_t actionSetHandle, VRActionHandle_t digitalActionHandle, VR_ARRAY_COUNT( originOutCount ) VRInputValueHandle_t *originsOut, uint32_t originOutCount ) { VRSTUB_NOT_IMPLEMENTED } 625 626 /** Retrieves the name of the origin in the current language */ GetOriginLocalizedName(VRInputValueHandle_t origin,VR_OUT_STRING ()char * pchNameArray,uint32_t unNameArraySize)627 virtual EVRInputError GetOriginLocalizedName( VRInputValueHandle_t origin, VR_OUT_STRING() char *pchNameArray, uint32_t unNameArraySize ) { VRSTUB_NOT_IMPLEMENTED } 628 629 /** Retrieves useful information for the origin of this action */ GetOriginTrackedDeviceInfo(VRInputValueHandle_t origin,InputOriginInfo_t * pOriginInfo,uint32_t unOriginInfoSize)630 virtual EVRInputError GetOriginTrackedDeviceInfo( VRInputValueHandle_t origin, InputOriginInfo_t *pOriginInfo, uint32_t unOriginInfoSize ) { VRSTUB_NOT_IMPLEMENTED } 631 632 /** Shows the current binding for the action in-headset */ ShowActionOrigins(VRActionSetHandle_t actionSetHandle,VRActionHandle_t ulActionHandle)633 virtual EVRInputError ShowActionOrigins( VRActionSetHandle_t actionSetHandle, VRActionHandle_t ulActionHandle ) { VRSTUB_NOT_IMPLEMENTED } 634 635 /** Shows the current binding all the actions in the specified action sets */ ShowBindingsForActionSet(VR_ARRAY_COUNT (unSetCount)VRActiveActionSet_t * pSets,uint32_t unSizeOfVRSelectedActionSet_t,uint32_t unSetCount,VRInputValueHandle_t originToHighlight)636 virtual EVRInputError ShowBindingsForActionSet( VR_ARRAY_COUNT( unSetCount ) VRActiveActionSet_t *pSets, uint32_t unSizeOfVRSelectedActionSet_t, uint32_t unSetCount, VRInputValueHandle_t originToHighlight ) { VRSTUB_NOT_IMPLEMENTED } 637 }; 638 639 640 } // stub 641 } // vr 642 643 #endif /* _H_OpenVRStub */ 644