public Ray ScreenPointToRay(Vector2 screenPoint) { RUISDisplay display = GetDisplayForScreenPoint(screenPoint); if (display) { Camera camera = display.GetCameraForScreenPoint(screenPoint); if (camera) { if (display.enableOculusRift) { screenPoint = display.ConvertOculusScreenPoint(screenPoint); return(camera.ScreenPointToRay(screenPoint)); } else { return(camera.ScreenPointToRay(screenPoint)); } } } return(new Ray(Vector3.zero, Vector3.zero)); }
public Ray ScreenPointToRay(Vector2 screenPoint) { RUISDisplay display = GetDisplayForScreenPoint(screenPoint); if (display) { Camera camera = display.GetCameraForScreenPoint(screenPoint); if (camera) { return(camera.ScreenPointToRay(screenPoint)); } } return(new Ray(Vector3.zero, Vector3.zero)); }
public Ray ScreenPointToRay(Vector2 screenPoint) { RUISDisplay display = GetDisplayForScreenPoint(screenPoint); if (display) { Camera camera = display.GetCameraForScreenPoint(screenPoint); if (camera) { if (UnityEngine.VR.VRSettings.enabled && camera.stereoTargetEye != StereoTargetEyeMask.None) // if(display.isHmdDisplay) { // *** TODO remove this hack when Camera.ScreenPointToRay() works again return(HMDScreenPointToRay(screenPoint, camera)); } else { return(camera.ScreenPointToRay(screenPoint)); } } } return(new Ray(Vector3.zero, Vector3.zero)); }