Forum Discussion
Metagen
11 years agoHonored Guest
Oculus Distorts Raycast
So essentially I'm creating an on-rails first person shooter using the Oculus and Leap Motion. Adding the Oculus causes the raycast that controls the hit detection to veer off target. I've found a c...
Metagen
11 years agoHonored Guest
So I've implemented a really hacky fix (sort of).
The above is coupled with a spherecast rather than a raycast in an attempt to mask the inaccuracy of the system. It still veers off further to the left by an increasing amount the further you move your hand from the center of the screen.
While it is certainly hitting more now and is a lot more usable than before it is far from an optimal solution.
Can anyone suggest a way to improve the above equation, perhaps a way to proportionally change the values based on how far off target it is?
if (x>0.5)
ray = Camera.main.ScreenPointToRay(new Vector2(640 + x - (320 - Mathf.Abs (x) )/5, y ));
else if (x<0.5)
ray = Camera.main.ScreenPointToRay(new Vector2(640 - x - (320 - Mathf.Abs (x) )/5, y ));
else
ray = Camera.main.ScreenPointToRay(new Vector3(x,y,z));
The above is coupled with a spherecast rather than a raycast in an attempt to mask the inaccuracy of the system. It still veers off further to the left by an increasing amount the further you move your hand from the center of the screen.
While it is certainly hitting more now and is a lot more usable than before it is far from an optimal solution.
Can anyone suggest a way to improve the above equation, perhaps a way to proportionally change the values based on how far off target it is?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 11 months ago
- 2 months ago