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

[WIP] Allow atom selection via VR controllers #399

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Nargaruga
Copy link

This allows the user to select atoms by pointing the laser and pressing the button mapped to Action1 (typically the trigger), as requested in #378.

Some problems are still present:

  • there is a considerable offset between the laser pointer and the atom that is actually selected. Reducing cRange in layer1/ScenePicking.cpp does not seem to improve the situation by much.

Possible improvements:

  • add the ability to select whole residues;
  • change the laser color when a residue is being pointed at (similar to how the laser becomes blue when aiming at the menu).

Additional notes:

  • this requires openvr_cut_laser to be set to true in layer1/SettingInfo.h;
  • I was not able to compile PyMOL with OpenVR until I added the #include <thread> to contrib/vr/OpenVRControllerModel.cpp (change not included in the commit). Not sure if it's a configuration issue on my end.

@Nargaruga
Copy link
Author

Nargaruga commented Oct 1, 2024

there is a considerable offset between the laser pointer and the atom that is actually selected. Reducing cRange in layer1/ScenePicking.cpp does not seem to improve the situation by much.

Applying a vertical offset to the picking projection parameters seems to solve the issue (see commit 43ab48e). The change does not seem to influence other VR interactions (i.e. with the menu or the sequence viewer).

Before the change (the purple color of the laser indicates that an atom is being pointed at, which shouldn't be the case here)

before_offset

After the change

after_offset

This is a band-aid solution, I assume the correct approach would be to update the following parameters:

void VRSystemStub::GetProjectionRaw(EVREye eEye, float *pfLeft, float *pfRight, float *pfTop, float *pfBottom)
{
if (eEye == Eye_Left) {
*pfLeft = -1.39666343f;
*pfRight = 1.23994398f;
*pfTop = -1.47110546f;
*pfBottom = 1.45868433f;
} else {
*pfLeft = -1.24060011f;
*pfRight = 1.39432383f;
*pfTop = -1.46788049f;
*pfBottom = 1.46032500f;
}
}

But I do not know how they were first extrapolated, nor if they are tied to a specific VR headset (I'm testing the changes on a Meta Quest 3).

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.

1 participant