示例#1
0
    private float Optimize()
    {
        /*ruisCamera.keystoningCamera.gameObject.SetActive(true);
         *
         * ruisCamera.keystoningCamera.transform.position = ruisCamera.KeystoningHeadTrackerPosition;*/
        float totalError = 0;

        totalError += RUISKeystoning.Optimize(ruisCamera.keystoningCamera, ruisCamera.CreateKeystoningObliqueFrustum(), ruisCamera.associatedDisplay, centerCameraCorners, ref centerSpec);
        totalError += RUISKeystoning.Optimize(ruisCamera.keystoningCamera, ruisCamera.CreateKeystoningObliqueFrustum(), ruisCamera.associatedDisplay, leftCameraCorners, ref leftSpec);
        totalError += RUISKeystoning.Optimize(ruisCamera.keystoningCamera, ruisCamera.CreateKeystoningObliqueFrustum(), ruisCamera.associatedDisplay, rightCameraCorners, ref rightSpec);

        //ruisCamera.keystoningCamera.gameObject.SetActive(false);

        //Debug.Log(totalError);

        return(totalError);
    }
    public static bool ExportKeystoning(RUISKeystoning.KeystoningCorners keystoningCorners, XmlElement xmlElement)
    {
        XmlElement topLeft = xmlElement.OwnerDocument.CreateElement("topLeft");
        XMLUtil.WriteVector2ToXmlElement(topLeft, keystoningCorners[0]);
        xmlElement.AppendChild(topLeft);

        XmlElement topRight = xmlElement.OwnerDocument.CreateElement("topRight");
        XMLUtil.WriteVector2ToXmlElement(topRight, keystoningCorners[1]);
        xmlElement.AppendChild(topRight);

        XmlElement bottomRight = xmlElement.OwnerDocument.CreateElement("bottomRight");
        XMLUtil.WriteVector2ToXmlElement(bottomRight, keystoningCorners[2]);
        xmlElement.AppendChild(bottomRight);

        XmlElement bottomLeft = xmlElement.OwnerDocument.CreateElement("bottomLeft");
        XMLUtil.WriteVector2ToXmlElement(bottomLeft, keystoningCorners[3]);
        xmlElement.AppendChild(bottomLeft);

        return true;
    }