Query HMD Location in any game

Hi, I’m designing a peripheral device that needs to know the location of the HMD in order to work
So I’m trying to write a program to query the HMD location while using any OpenXR application. Is this possible?
My implementation currently conflicts with any running VR application causing a blank screen.

You can only have one simultaneous XrSession on most runtimes. So trying to run a 2nd OpenXR program while another one is running isn’t going to work.

Your best option might be an API layer that will load into the running OpenXR application and let you inspect the HMD poses while the application is running. Depending on what you need/want to do with the data, it might be a better practice to then offload these HMD poses to another program via IPC.

This project shows how to make an API layer in C++. One thing you could do is perhaps hook to xrWaitFrame() then add your OpenXR code to query the HMD poses there. You will be left at the mercy of the main application frame loop (and therefore frame rate). If this is a problem, you could also spawn a background thread to poll the HMD poses at all time, even if the main frame loop falls behind.

Thank you for the clarification!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.