Beispiel #1
0
    void Update()
    {
        if (DataManager == null)
        {
            return;
        }

        _DataManager = DataManager.GetComponent <ServerDataManager>();
        if (_DataManager == null)
        {
            return;
        }

        if (_DataManager.isReaderClosed())
        {
            return;
        }

        _DepthData = _DataManager.GetChosenDepthData();
        if (_DepthData == null)
        {
            return;
        }

        _ColorData = _DataManager.GetChosenColorData();
        if (_ColorData == null)
        {
            return;
        }


        // 1) Send general data
        //CustomMessagesPointCloud.Instance.SendGeneralData(_DataManager.DSPWidth, _DataManager.DSPHeight);
        CustomMessagesPointCloud.Instance.SendDepthData(_DepthData);

        /*
         * Debug.Log("DSPWidth: " + _DataManager.DSPWidth);
         * Debug.Log("DSPHeight: " + _DataManager.DSPHeight);*/

        //CustomMessagesPointCloud.Instance.SendColorData(_ColorData);

        // 2) Send depth data 1

        // 3) Send depth data 2

        // 4) Send R data

        // 5) Send G data

        // 6) Send B data
    }
Beispiel #2
0
    void Update()
    {
        if (DataManager == null)
        {
            return;
        }

        _DataManager = DataManager.GetComponent <ServerDataManager>();
        if (_DataManager == null)
        {
            return;
        }

        _DepthData = _DataManager.GetChosenDepthData();
        if (_DepthData == null)
        {
            return;
        }

        _ColorData = _DataManager.GetChosenColorData();
        if (_ColorData == null)
        {
            return;
        }

        if (firstPass) // If first time transmitting, send general info
        {
            CustomMessagesPointCloud.Instance.SendGeneralData(_DataManager.ClipWidth, _DataManager.ClipHeight);
            firstPass = false;
        }
        else           // Else just send depth & RGB each frame
        {
            CustomMessagesPointCloud.Instance.SendDepthData(_DepthData);
            CustomMessagesPointCloud.Instance.SendColorData(_ColorData);
        }
    }
    void Update()
    {
        _DataManager = DataManager.GetComponent <ServerDataManager>();
        if (_DataManager == null)
        {
            return;
        }

        if (_DataManager.GetDownsampleSize() == 1)
        {
            return;
        }

        if (_Mesh == null)
        {
            width  = _DataManager.DSPWidth;
            height = _DataManager.DSPHeight;
            _Mesh  = new Mesh();
            GetComponent <MeshFilter>().mesh = _Mesh;
            CreateMesh(width, height);
        }

        _DepthData = _DataManager.GetChosenDepthData();
        if (_DepthData == null)
        {
            return;
        }

        _ColorData = _DataManager.GetChosenColorData();
        if (_ColorData == null)
        {
            return;
        }

        RefreshMesh(width, height);
    }