예제 #1
0
    public void BuildMesh(bool left, int plat, Material mat)
    {
        curPlatform = plat;

        if (left)
        {
            leftEye = true;
        }

        if (curPlatform != 0)
        {
            androidCalib = new AndroidCalibration();
            androidCalib.UpdateCalibration();
            this.xSize = androidCalib.GetGridSizeX();
            this.ySize = androidCalib.GetGridSizeY();
            android    = true;
        }
        else if (curPlatform == 0)
        {
            pcPlugin   = new CalibrationData();
            this.xSize = pcPlugin.GridX();
            this.ySize = pcPlugin.GridY();
        }
        meshMat = mat;

        if (android == false)
        {
            this.rotation = new Vector3(0.0f, 0.0f, -90.0f);
        }

        else if (android == true)
        {
            if (leftEye)
            {
                this.rotation = new Vector3(0.0f, 0.0f, -90.0f);
            }
            else
            {
                this.rotation = new Vector3(0.0f, 0.0f, 90.0f);
            }
        }

        GenerateMesh();
        WarpMesh();
        FindCenters();
        CreateScreenCamera();

        Destroy(GetComponent <Distortion>());
    }