aruametello / openxr_loader-dll-proxy

OpenXR DLL proxy to tweak controler position and rotation offsets
7 stars 0 forks source link

Controller Position Offset, and "'openxr\openxr.h': No such file or directory" #1

Open PTVoltz opened 1 year ago

PTVoltz commented 1 year ago

Easy enough thing - I've found a use-case for Controller Position Offset XD

Due to an issue between OpenXR and the new(ish Pico 4 Headset, it has some serious issues with offsets - the controllers being offset from the hands by a substantial amount, both in position and rotation. From my testing it depends on the game - normally being 20 degrees tilted upwards (inYaw), and anywhere from 5mm to a full fist length (around 10-20cm) upwards (towards the thumb, don't remember which x/y/z coord that is rn).

I had a go trying to add Position Offset adjustment myself, and while it seemed easy enough I couldn't test it, and there's likely some problems given I'm far more used to C# than I am C/C++. As such - I had a bunch of issues with even the un-modified program refusing to compile, stating that the OpenXR include files don't exist - despite me adding the OpenXR SDK in what I think was the correct way.

So, in short: position offset would be nice, I tried it and have no idea what I'm doing, and the compiler is complaining that files that exist actually don't.

aruametello commented 1 year ago

Pico 4 Headset

i have the same Pico 4, migrated from a Quest 1 and uninronically tried again to implement offsets due to this. I backpedalled on it when i found an accidental fix. I use Virtual Desktop for PCVR and when i run steamVR from VD, it runs in a way that any following OpenXR aplication will have screwed offsets... BUT if i run the steamVR.exe directly (can be run from the steam client instead of VD) it runs in "oculus touch emulation something" and it sees the controllers as a pair of oculus touch, with "correct" position and rotation. (regardless that is very lazy of my part, but try it if you can)

As such - I had a bunch of issues with even the un-modified program refusing to compile

My bad, i should have provided compiling instructions since the whole thing was jury riggged in like 10 hours.

position offset would be nice

indeed, i actually tried to pull that off but either my math sucks (more likely) or i have the wrong data to produce the solution. (less likely)

The src i sent in the link actually does show a vertical offset because that is what annoyed me the most, really crap to look into ironsights that much above where they should be... So i tried and got stuck on this:

if i add "+10cm" to the Y coordinate, that is added after my hand rotation (why? i dunno), so the hand position looks corrected when aiming the index finger at the horizon, but if i point my index "UP", my hand position gets shifter "+10cm to my face instead of UP", so something around "rotate the positional offset matrix before applying it?" i didn't figured that out.

(check the code around main.c: 1476 on the attachment as a starting point)

dll_proxy_gcc.zip

PTVoltz commented 1 year ago

Huh... will have to check that "fix" you mentioned - I run with a cable through the default Streaming Assistant, might see if I can test a few more things with it. Most likely though what you're seeing is a side-effect of VD more than anything. I would grab it but my Wifi is ass so Wired is much nicer for stability and visual clarity (and I'd rather not have to buy another piece of software just to fix what the company themselves should have done).

As for the rest - figured there was something upwith the build XD. I do have CodeBlocks still lying around so will experiment. Most likely though, OpenXR itself calculates position before rotation so it's just overriding what order you put it in.

And hey, whether I can actually help here or not - Imma use this as a way to (and excuse to) learn a little C. When I said I'm "more comfortable with C#", what I really meant was "I have never touched C or C++ before but I can vaguely follow what's happening".

PTVoltz commented 1 year ago

Very sorry, but I'm finding even more issues... it was still throwing "file doesn't exist" no matter where I put the OpenXR SDK or how I referred to it. Ended up having to replace the library reference with a direct folder reference (i.e. "#include "C:\Users\User\etc.") which surprisingly worked.

Except NOW it's throwing an "Error: Parameter Name Omitted" on line 574. And I have no idea what that means...

Including a quick copy-paste of the build log, see if you can see why it's doing things. Also tried it in the command line with hte same result, thinking it's probably me using a slightly wrong compiler. new 1.txt

Really feeling like I might be out of my depth already XD

aruametello commented 1 year ago

Except NOW it's throwing an "Error: Parameter Name Omitted" on line 574. And I have no idea what that means...

i am going to take another look into the "positional offsets" over the weekend (probably sunday).

i will also try to provide a regular "makefile" compatible with the msys2 enviroment so the building process is easier on the next update.


main.c: 574 seems to be a few "malloc" lines... also i dont remember to get this exact error message ever before.

the message you got seems to be a "incorrect call" to a function (my guess), given the source code "compiles on my machine" (ouch). Try the following:

Those settings are not "directly saved into the codeblocks project file", but instead into your "default compiler settings". (another caveat that would be solved by providing a regular makefile with the project)

PTVoltz commented 1 year ago

...yeah I've tried a bunch of stuff, and temporarily just erased the C++ compiler from the settings panel so I know that isn't being called - from what I can gather the -wall flag was already in a section of the project settings, but I moved it to the default Compiler flags as well. Didn't change anything. Same with adding the std=99 flag, also tried a couple of the other C language standard flags I saw with mixed results (no change on std=11, and it refused to do anything on std=17 (claiming the command line option was invalid, despite being a default option).

I might just wait for you to do a proper Make-file setup, it obviously just doesn't like me XD

aruametello commented 1 year ago

@PTVoltz it looks i figured it out, the update with position offsets is up.

but it still does not include the makefile this time.

https://github.com/aruametello/openxr_loader-dll-proxy/releases/tag/v0.4