Jump to content

Gui Vr Sample - cursor rotation


photo

Recommended Posts

Hello,

I have made a project based on the Vr Sample in 2.8 SDK. When in Vr, the white gui cursor which points from the right oculus controller when the gui is active, is now rotated 180 degree around the z axis ( pointing backwards to the player instead of pointing forward). I was looking for it, but cant find it - where can I reset the angle of its rotation?

Thanks

Link to comment

Hi Piotr,

To change the direction of the pointer, you need to fix one line in the source code.
Open the file named VRPlayerVR.cpp and find the line number 755.
Replace it with:
Vec3 p1 = p0 + Vec3(normalize(getDirectionNZ(m) + getDirectionY(m))) * 10.0f;
or:
Vec3 p1 = p0 + Vec3(getDirectionY(m))) * 10.0f;
for directions as in the first and second image respectively.

first_cursor_direction.png

second_cursor_direction.png

Link to comment
×
×
  • Create New...