private void CreateEye(Pvr_UnitySDKAPI.Eye eyeSide) { string nm = name + (eyeSide == Pvr_UnitySDKAPI.Eye.LeftEye ? " LeftEye" : " RightEye"); GameObject go = new GameObject(nm); go.transform.parent = transform; go.AddComponent <Camera>().enabled = true; var picovrEye = go.AddComponent <Pvr_UnitySDKEye>(); picovrEye.eyeSide = eyeSide; }
private void CreateEye(Pvr_UnitySDKAPI.Eye eye) { string nm = name + (eye == Pvr_UnitySDKAPI.Eye.LeftEye ? " LeftEye" : " RightEye"); GameObject go = new GameObject(nm); go.transform.parent = transform; go.AddComponent <Camera>().enabled = true; #if !UNITY_5 if (GetComponent <GUILayer>() != null) { go.AddComponent <GUILayer>(); } if (GetComponent("FlareLayer") != null) { go.AddComponent <FlareLayer>(); } #endif var picovrEye = go.AddComponent <Pvr_UnitySDKEye>(); picovrEye.eye = eye; }
private void RecordEnableLayers(Pvr_UnitySDKAPI.Eye eyeSide, int layerIndex, ref List <int> lEnableLayers, ref List <int> rEnableLayers) { switch (eyeSide) { case Pvr_UnitySDKAPI.Eye.LeftEye: if (lEnableLayers.Contains(layerIndex)) { Debug.LogError(string.Format("LeftEye layerIndex:{0} is already exist! Don't add the same layerIndex more than once!", layerIndex)); return; } lEnableLayers.Add(layerIndex); break; case Pvr_UnitySDKAPI.Eye.RightEye: if (rEnableLayers.Contains(layerIndex)) { Debug.LogError(string.Format("RightEye layerIndex:{0} is already exist! Don't add the same layerIndex more than once!", layerIndex)); return; } rEnableLayers.Add(layerIndex); break; } }
/// <summary> /// 左右眼投影矩阵(Unity Editor 模拟) /// </summary> public Matrix4x4 Projection(Pvr_UnitySDKAPI.Eye eye) { return(eye == Pvr_UnitySDKAPI.Eye.LeftEye ? leftEyeProj : rightEyeProj); }