Finding the OVRCrosshair in 3D Space
Okay, so I have a problem where I need to get the OVRGUI Crosshair's position in 3D space so I can apply raycasting on it. I have dug through all of the Oculus scripts and cannot determine a way to calculate this.
I want to use the way the cursor is currently set up, ie, where it has a certain deadspace where it turns the player once it reaches a certain position in pixels. It is simple to calculate the crosshair when it is initially centered by calculating the forward direction of the centerAnchor. Unfortunately, I do not know how to calculate the offset on the crosshair since it is measured in 2D pixels on the plane instead of a vector3 coordinate in 3D space.
The code that creates the crosshair at the desired location is:
Anyone have any ideas on how to accomplish this? Thanks in advance.
I want to use the way the cursor is currently set up, ie, where it has a certain deadspace where it turns the player once it reaches a certain position in pixels. It is simple to calculate the crosshair when it is initially centered by calculating the forward direction of the centerAnchor. Unfortunately, I do not know how to calculate the offset on the crosshair since it is measured in 2D pixels on the plane instead of a vector3 coordinate in 3D space.
The code that creates the crosshair at the desired location is:
GUI.DrawTexture(new Rect(XL - (ImageCrosshair.width * 0.5f),
YL - (ImageCrosshair.height * 0.5f),
ImageCrosshair.width,
ImageCrosshair.height), ImageCrosshair);
Anyone have any ideas on how to accomplish this? Thanks in advance.
