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 couple of threads that talk about this problem but none that sufficiently solve my issue.
The set up is that the weapons and shooting script are attached to the right camera. The ray is cast using a simple
with x and y being normalized positions of the player's hand and only the right camera is currently tagged as the main.
It might also be worth noting that the crosshair solution I'm currently using is the VRGUI solution created by boone188 on these forums (Available here: https://developer.oculusvr.com/forums/viewtopic.php?f=37&t=4944 )and that the crosshair controls are currently working independently of the hit detection.
So what I want to know is there any way to negate the distortion effect?
Adding the Oculus causes the raycast that controls the hit detection to veer off target. I've found a couple of threads that talk about this problem but none that sufficiently solve my issue.
The set up is that the weapons and shooting script are attached to the right camera. The ray is cast using a simple
InteractionBox iBox = frame.InteractionBox;
HandList hands = frame.Hands;
Hand firstHand = hands [0];
Vector stabilizedPosition = firstHand.StabilizedPalmPosition;
Vector handCenter = stabilizedPosition;
Vector normalizedPosition = iBox.NormalizePoint(handCenter);
float x = normalizedPosition.x * screenWidth;
float y = normalizedPosition.y * screenHeight;
Camera.main.ScreenPointToRay(new Vector2(x,y));
if (Physics.Raycast (ray, out hit, Range))
{
//hit stuff
}
with x and y being normalized positions of the player's hand and only the right camera is currently tagged as the main.
It might also be worth noting that the crosshair solution I'm currently using is the VRGUI solution created by boone188 on these forums (Available here: https://developer.oculusvr.com/forums/viewtopic.php?f=37&t=4944 )and that the crosshair controls are currently working independently of the hit detection.
So what I want to know is there any way to negate the distortion effect?
