예제 #1
0
    public void Set(SteamVR vr, Valve.VR.EVREye eye)
    {
        int i = (int)eye;

        if (hiddenAreaMeshes[i] == null)
        {
            hiddenAreaMeshes[i] = SteamVR_Utils.CreateHiddenAreaMesh(vr.hmd.GetHiddenAreaMesh(eye, Valve.VR.EHiddenAreaMeshType.k_eHiddenAreaMesh_Standard), vr.textureBounds[i]);
        }
        meshFilter.mesh = hiddenAreaMeshes[i];
    }
예제 #2
0
 public void Set(SteamVR vr, Valve.VR.EVREye eye)
 {
     try
     {
         int i = (int)eye;
         if (hiddenAreaMeshes[i] == null)
         {
             hiddenAreaMeshes[i] = SteamVR_Utils.CreateHiddenAreaMesh(vr.hmd.GetHiddenAreaMesh(eye), vr.textureBounds[i]);
         }
         meshFilter.mesh = hiddenAreaMeshes[i];
     } catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
    public static Matrix4x4 GetSteamVRProjectionMatrix(Camera cam, Valve.VR.EVREye eye)
    {
        Valve.VR.HmdMatrix44_t proj = SteamVR.instance.hmd.GetProjectionMatrix(eye, cam.nearClipPlane, cam.farClipPlane);
        Matrix4x4 m = new Matrix4x4();

        m.m00 = proj.m0;
        m.m01 = proj.m1;
        m.m02 = proj.m2;
        m.m03 = proj.m3;
        m.m10 = proj.m4;
        m.m11 = proj.m5;
        m.m12 = proj.m6;
        m.m13 = proj.m7;
        m.m20 = proj.m8;
        m.m21 = proj.m9;
        m.m22 = proj.m10;
        m.m23 = proj.m11;
        m.m30 = proj.m12;
        m.m31 = proj.m13;
        m.m32 = proj.m14;
        m.m33 = proj.m15;
        return(m);
    }