Ejemplo n.º 1
0
        public NatNetPoseData FetchFrameData()
        {
            NatNetPoseData poseData = new NatNetPoseData();

            if (connected_)
            {
                //Console.WriteLine("== NatNet Data Update ==");
                NatNetML.FrameOfMocapData data = mNatNet.GetLastFrameOfData();
                poseData = ProcessPoseData(data);
            }

            return(poseData);
        }
        private void GetLastFrameOfDataButton_Click(object sender, EventArgs e)
        {
            // [NatNet] GetLastFrameOfData can be used to poll for the most recent avail frame of mocap data.
            // This mechanism is slower than the event handler mechanism, and in general is not recommended,
            // since it must wait for a frame to become available and apply a lock to that frame while it copies
            // the data to the returned value.

            // get a copy of the most recent frame of data
            // returns null if not available or cannot obtain a lock on it within a specified timeout
            FrameOfMocapData data = m_NatNet.GetLastFrameOfData();

            if (data != null)
            {
                // do something with the data
                String frameInfo = String.Format("FrameID : {0}", data.iFrame);
                OutputMessage(frameInfo);
            }
        }