예제 #1
0
    // Stream outputStream = null;
#endif


#if !UNITY_EDITOR
    async void Start()
    {
        sensorDisplay = GetComponent <SensorDisplay>();
        Debug.Log("Waiting for a connection...");
        //System.Diagnostics.Debug.Write("Waiting for a connection...");
        try {
            socketListener = new StreamSocketListener();
            socketListener.ConnectionReceived += Socket_ConnectionReceived;
            await socketListener.BindServiceNameAsync(port);
        } catch (Exception e) {
            Debug.Log(e.ToString());
            return;
        }

        for (int i = 0; i < TCPPackageConstants.TOTAL_NUM_TF; i++)
        {
            tfDataArr[i] = new tfData();
        }
        Debug.Log("TF array initialized");

        Debug.Log("exit start");
    }
예제 #2
0
 private void setPoseData(byte[] buffer, int startByte, tfData tf_data)
 {
     setVector3Data(buffer, startByte, ref tf_data.position);
     setQuarternionData(buffer, startByte + 12, ref tf_data.orientation);
 }