Пример #1
0
        /// <summary>
        /// Clear async offset that was set with <see cref="SetAsyncOffset"/>
        /// </summary>
        /// <returns></returns>
        public bool ResetAsyncOffset()
        {
            var request = HeadTrackingRequest.CreateEmptyPacketByType(HeadTrackingRequest.Task.ResetAsyncOffset);
            var reply   = SendMessage(request);

            return(reply.ReplyCode == (byte)HeadTrackingResponse.Response.AcceptedYourData);
        }
Пример #2
0
        /// <summary>
        /// Request latest phone pose matrix. You can use it for <see cref="SetAsyncOffset"/>.
        /// This method will block until fresh data is received from mobile phone.
        /// </summary>
        /// <returns>
        /// 4x4 transformation matrix flattened as column-major array.
        /// </returns>
        public float[] GetCurrentPhonePose()
        {
            var request = HeadTrackingRequest.CreateEmptyPacketByType(HeadTrackingRequest.Task.RequestReadOnlyPhonePose);
            var reply   = SendMessage(request);

            var replyData = new float[16];

            Array.Copy(reply.Data, 0, replyData, 0, 16);
            return(replyData);
        }