Exemplo n.º 1
0
        void _init(Vector2 sz)
        {
            int type = COvrvisionUnity.OV_CAMVR_VGA;

            if (sz.x == 640)
            {
                type = COvrvisionUnity.OV_CAMVR_VGA;
            }
            else if (sz.x == 960)
            {
                type = COvrvisionUnity.OV_CAMVR_FULL;
            }
            else if (sz.x == 1280 && sz.y == 800)
            {
                type = COvrvisionUnity.OV_CAMVR_WIDE;
            }
            else if (sz.x == 1280 && sz.y == 960)
            {
                type = COvrvisionUnity.OV_CAMHD_FULL;
            }
            else if (sz.x == 1920 && sz.y == 1080)
            {
                type = COvrvisionUnity.OV_CAM5MP_FHD;
            }
            else
            {
                return;
            }
            Debug.Log("Initing OVR Textures");
            if (!_ovr.OpenMemory(type, 0.15f))
            {
                Debug.Log("Failed to init OVR Textures");
                return;
            }

            if (!string.IsNullOrEmpty(_config))
            {
                _ovr.LoadCameraConfiguration(_config);
            }
            _ovr.useOvrvisionTrack_Calib = false;
            _ovr.useProcessingQuality    = COvrvisionUnity.OV_CAMQT_DMSRMP;

            for (int i = 0; i < 2; ++i)
            {
                _textures [i]          = new Texture2D(_ovr.imageSizeW, _ovr.imageSizeH, TextureFormat.BGRA32, false);
                _textures [i].wrapMode = TextureWrapMode.Clamp;
                _textures [i].Apply();
                _texturesPtr[i] = _textures [i].GetNativeTexturePtr();
            }

            Debug.Log("Done with OVR Textures");
            _inited = true;
        }
Exemplo n.º 2
0
    void _init(Vector2 sz)
    {
        int type = COvrvisionUnity.OV_CAMVR_VGA;

        if (sz.x == 640)
        {
            type = COvrvisionUnity.OV_CAMVR_VGA;
        }
        else if (sz.x == 960)
        {
            type = COvrvisionUnity.OV_CAMVR_FULL;
        }
        else if (sz.x == 1280 && sz.y == 800)
        {
            type = COvrvisionUnity.OV_CAMVR_WIDE;
        }
        else if (sz.x == 1280 && sz.y == 960)
        {
            type = COvrvisionUnity.OV_CAMHD_FULL;
        }
        else if (sz.x == 1920 && sz.y == 1080)
        {
            type = COvrvisionUnity.OV_CAM5MP_FHD;
        }
        else
        {
            return;
        }
        Debug.Log("Initing OVR Textures");
        if (!_ovr.OpenMemory(type, 0.15f))
        {
            Debug.Log("Failed to init OVR Textures");
            return;
        }

        if (!string.IsNullOrEmpty(_config))
        {
            _ovr.LoadCameraConfiguration(_config);
        }
        _ovr.useOvrvisionTrack_Calib = false;
        _ovr.useProcessingQuality    = COvrvisionUnity.OV_CAMQT_DMSRMP;


        Debug.Log("Done with OVR Textures");
        _inited          = true;
        _texturesUpdated = false;
    }