Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add space reset in openvr bindings #148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add space reset in openvr bindings #148

wants to merge 1 commit into from

Conversation

meir
Copy link

@meir meir commented Feb 7, 2025

Tried to add the spacedrag bindings in SteamVR yesterday but found out the option for the space reset is missing.

This should add it in SteamVR.

Will have to test when i get back home, ill keep the PR in draft until ive managed to test it.

@meir meir force-pushed the main branch 2 times, most recently from 1ab2c2d to c41b5f4 Compare February 7, 2025 17:29
@meir meir marked this pull request as ready for review February 7, 2025 17:38
@meir
Copy link
Author

meir commented Feb 7, 2025

Tested, works in SteamVR now, however there is a bug where the DragReset puts you under the floor and away from the center for some reason, but that lies in the DragReset method

@galister
Copy link
Owner

galister commented Feb 7, 2025

If you want to look further into this, here's some info:

Moving the playspace on SteamVR consists of moving the actual chaperone (the boundary thing that your draw during steamvr room calibration).

When uncalibrated, the chaperone sits at the raw center of the playspace. (This is likely what it resets to as of now.)

Upon room calibration, the chaperone is saved to a file somewhere, and SteamVR will use this calibration for the chaperone on next launch.

Instead of resetting the chaperone by clearing its transform, we want to revert it to the pose that's in the calibration file.

There's an OpenVR method that seems to do just what we need: IVRChaperoneSetup::ReloadFromDisk

@meir
Copy link
Author

meir commented Feb 7, 2025

ahh alright, i'll see tomorrow if i can figure it out, might need to check my actual boundary in SteamVR aswell, i might have it improperly set since OVRAS sometimes broke it and i got sick of fixing it each time it happened

@meir
Copy link
Author

meir commented Feb 8, 2025

couldn't really stop thinking about it, especially since ive recently started learning rust so got a bit too excited about it

but looked into it and ReloadFromDisk wouldnt work since the CommitWorkingCopy would override the saved chaperone, this would technically mean that its overwritten entirely even between restarts, so i changed it out for the previewing the working data so that the saved chaperone stays in tact and does not get ruined

However this does come with another bug, it's only visual and not breaking, but when the preview is showing, the chaperone bounds will just fly away, but the actual playspace goes in the correct position

I'll look later into why this might be happening

@meir
Copy link
Author

meir commented Feb 10, 2025

found the issue with the boundaries flying off, adding an offset to them was breaking it, apparently steamvr already sets the offset when previewing the working set.

@galister
Copy link
Owner

i'm not sure what the nix part is about, we're already included in: https://github.com/nix-community/nixpkgs-xr

if it's needed then please make it into its own PR

@meir
Copy link
Author

meir commented Feb 10, 2025

i added the nix flake for local development, the flake in nixpkgs-xr builds a specific git branch, the one i added is to run/build the local code using nix

@meir
Copy link
Author

meir commented Feb 10, 2025

it is probably better to override the wlx package just like nixpkgs-xr does, im not sure if theres another option in nix to do local development using the nixpkgs-xr

@meir
Copy link
Author

meir commented Feb 10, 2025

removed the nix flake and squashed down the commits into one

i'll make a second pr later tonight with additions for a nix flake for local development on NixOS

@meir
Copy link
Author

meir commented Feb 11, 2025

found another issue before this pr gets merged, when moving, any windows shift with you, when resetting they dont, i'll figure this out later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants