Example #1
0
        void Update()
        {
            if (!bConnected)
            {
                Connect(ServerIP);
                return;
            }

            float[] vertices;
            byte[]  colors;

            if (bReadyForNextFrame)
            {
                Debug.Log("Requesting frame");

    #if WINDOWS_UWP
                socket.RequestFrame();
                socket.ReceiveFrameAsync();
    #else
                RequestFrame();
    #endif
                bReadyForNextFrame = false;
            }

    #if WINDOWS_UWP
            if (socket.GetFrame(out vertices, out colors))
        #else
            if (ReceiveFrame(out vertices, out colors))
        #endif
            {
                Debug.Log("Frame received");
                pointCloudRenderer.Render(vertices, colors);
                bReadyForNextFrame = true;
            }
        }
    void Update()
    {
        if (!bConnected)
        {
            return;
        }

        if (!ReceivePoints)
        {
            return;
        }

        float[] vertices;
        byte[]  colors;

        if (bReadyForNextFrame)
        {
            if (LogFrameStatus)
            {
                Debug.Log("Requesting frame");
            }

#if WINDOWS_UWP
            socket.RequestFrame();
            socket.ReceiveFrameAsync();
#else
            RequestFrame();
#endif
            bReadyForNextFrame = false;
        }

#if WINDOWS_UWP
        if (socket.GetFrame(out vertices, out colors))
    #else
        if (ReceiveFrame(out vertices, out colors))
    #endif
        {
            if (LogFrameStatus)
            {
                Debug.Log("Frame received");
            }
            Vertices           = vertices;
            bReadyForNextFrame = true;
        }
    }