Esempio n. 1
0
    void ResetUIDir()
    {
        Vector3    dir = Vector3.zero;
        Quaternion qua = Quaternion.identity;

        if (CurJVideoInfo.stereoType == (int)StereoType.ST2D || CurJVideoInfo.stereoType == (int)StereoType.ST3D_LR || CurJVideoInfo.stereoType == (int)StereoType.ST3D_TB)
        {
            dir = PlayerGameobjectControl.Instance.QuadScreen.transform.parent.forward;
            qua = PlayerGameobjectControl.Instance.QuadScreen.transform.parent.rotation;
        }
        else if (CurJVideoInfo.stereoType == (int)StereoType.ST180_2D || CurJVideoInfo.stereoType == (int)StereoType.ST180_LR ||
                 CurJVideoInfo.stereoType == (int)StereoType.ST180_TB || CurJVideoInfo.stereoType == (int)StereoType.ST360_2D ||
                 CurJVideoInfo.stereoType == (int)StereoType.ST360_LR || CurJVideoInfo.stereoType == (int)StereoType.ST360_TB)
        {
            dir = Camera.main.transform.forward;
            qua = Camera.main.transform.rotation;
        }

        Cinema.CinemaUI.transform.forward = dir;

        Vector3 valueDir   = Vector3.Cross(Vector3.forward, dir);
        float   valueAngle = Vector3.Angle(Vector3.forward, dir);
        Vector3 cToUVector = PreDefScrp.RotateAroundAxis(Cinema.CameraToUIPositionVector, valueDir, valueAngle);

        Cinema.CinemaUI.transform.position = Camera.main.transform.position + cToUVector;
        Cinema.CinemaUI.transform.rotation = qua;
        Debug.Log("ResetUIDir");
    }
Esempio n. 2
0
    private void WindowStereoTypeUIReset()
    {
        if (CurJVideoInfo.stereoType == (int)StereoType.ST2D || CurJVideoInfo.stereoType == (int)StereoType.ST3D_LR || CurJVideoInfo.stereoType == (int)StereoType.ST3D_TB)
        {
            Vector3    dir = PlayerGameobjectControl.Instance.QuadScreen.transform.parent.forward;
            Quaternion qua = PlayerGameobjectControl.Instance.QuadScreen.transform.parent.rotation;
            Cinema.CinemaUI.transform.forward = dir;

            Vector3 valueDir   = Vector3.Cross(Vector3.forward, dir);
            float   valueAngle = Vector3.Angle(Vector3.forward, dir);
            Vector3 cToUVector = PreDefScrp.RotateAroundAxis(Cinema.CameraToUIPositionVector, valueDir, valueAngle);
            Cinema.CinemaUI.transform.position = Camera.main.transform.position + cToUVector;
            Cinema.CinemaUI.transform.rotation = qua;
        }
    }
Esempio n. 3
0
    void ResetUIDir()
    {
        Vector3 dir   = Camera.main.transform.forward;
        Vector3 yDir  = PreDefScrp.ComputeProjection(Vector3.up, dir);
        float   angle = Vector3.Angle(OldUIDir, yDir);

        if (angle > 2)
        {
            Vector3 valueDir   = Vector3.Cross(Vector3.forward, yDir);
            float   valueAngle = Vector3.Angle(Vector3.forward, yDir);

            Vector3 cToUVector = PreDefScrp.RotateAroundAxis(CameraToUIVector, valueDir, valueAngle);
            this.transform.forward  = yDir;
            this.transform.position = Camera.main.transform.position + cToUVector;
            OldUIDir = yDir;
        }
    }
Esempio n. 4
0
    void UpdateUIAngleDir()
    {
        Vector3    dir = Camera.main.transform.forward;
        Quaternion qua = Camera.main.transform.rotation;

        Cinema.CinemaUI.transform.forward = dir;

        Vector3 valueDir   = Vector3.Cross(Vector3.forward, dir);
        float   valueAngle = Vector3.Angle(Vector3.forward, dir);
        Vector3 cToUVector = PreDefScrp.RotateAroundAxis(Cinema.CameraToUIPositionVector, valueDir, valueAngle);

        Cinema.CinemaUI.transform.position = Camera.main.transform.position + cToUVector;
        Cinema.CinemaUI.transform.rotation = qua;

        Vector3 cToUVector2 = PreDefScrp.RotateAroundAxis(Cinema.CameraToPlayerPositionVector, valueDir, valueAngle);

        PlayerGameobjectControl.Instance.QuadScreen.transform.parent.forward  = dir;
        PlayerGameobjectControl.Instance.QuadScreen.transform.parent.position = Camera.main.transform.position + cToUVector2;
        PlayerGameobjectControl.Instance.QuadScreen.transform.parent.rotation = qua;
        //CinemaMaterialSetting.GetInstance().ImaxPurple.transform.forward = dir;
        //CinemaMaterialSetting.GetInstance().ImaxPurple.transform.rotation = qua;
        //CinemaMaterialSetting.GetInstance().DriveSceneBox.transform.forward = dir;
        //CinemaMaterialSetting.GetInstance().DriveSceneBox.transform.rotation = qua;
    }