Пример #1
0
        /// <summary>
        /// Awake this instance.
        /// </summary>
        void Awake()
        {
            //create empty list for reasons when no data arrives
            emptyPositions    = new Vector3[XsMvnPose.MvnSegmentCount];
            emptyOrientations = new Quaternion[XsMvnPose.MvnSegmentCount];
            for (int i = 0; i < XsMvnPose.MvnSegmentCount; ++i)
            {
                emptyPositions[i]    = Vector3.zero;
                emptyOrientations[i] = Quaternion.identity;
            }

            availableStreams = new bool[NUM_STREAMS];
            poseActors       = new XsStreamReaderThread[NUM_STREAMS];
            for (int i = 0; i < NUM_STREAMS; ++i)
            {
                poseActors[i]       = new XsStreamReaderThread();
                availableStreams[i] = false;    // this is set to true in the read thread when data is received for a stream
            }

            // Make a thread to read from the connection with MVN studio
            connectionThread = new Thread(new ThreadStart(read));
            connectionThread.Start();
        }
Пример #2
0
        /// <summary>
        /// Awake this instance.
        /// </summary>
        void Awake()
        {
            //create empty list for reasons when no data arrives
            emptyPositions = new Vector3[XsMvnPose.MvnSegmentCount];
            emptyOrientations = new Quaternion[XsMvnPose.MvnSegmentCount];
            for (int i = 0; i < XsMvnPose.MvnSegmentCount; ++i)
            {
                emptyPositions[i] = Vector3.zero;
                emptyOrientations[i] = Quaternion.identity;
            }

            availableStreams = new bool[NUM_STREAMS];
            poseActors = new XsStreamReaderThread[NUM_STREAMS];
            for (int i = 0; i < NUM_STREAMS; ++i)
            {
                poseActors[i] = new XsStreamReaderThread();
                availableStreams[i] = false;    // this is set to true in the read thread when data is received for a stream
            }

            // Make a thread to read from the connection with MVN studio
            connectionThread = new Thread(new ThreadStart(read));
            connectionThread.Start();
        }