Ejemplo n.º 1
0
        /// <summary>
        /// Register to get Tango pose callbacks for specific reference frames.
        ///
        /// NOTE: Tango pose callbacks happen on a different thread than the main
        /// Unity thread.
        /// </summary>
        /// <param name="framePairs">The reference frames to get callbacks for.</param>
        internal static void SetCallback(TangoCoordinateFramePair[] framePairs)
        {
            if (m_poseAvailableCallback != null)
            {
                Debug.Log("PoseListener.SetCallback() called when callback is already set.");
                return;
            }

            Debug.Log("PoseListener.SetCallback()");
            m_poseAvailableCallback = new PoseProvider.APIOnPoseAvailable(_OnPoseAvailable);
            PoseProvider.SetCallback(framePairs, m_poseAvailableCallback);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Stop getting Tango pose callbacks.
        /// </summary>
        internal static void Reset()
        {
            // Avoid calling into tango_client_api before the correct library is loaded.
            if (m_poseAvailableCallback != null)
            {
                PoseProvider.ClearCallback();
            }

            m_poseAvailableCallback = null;
            m_motionTrackingData = new TangoPoseData();
            m_areaLearningData = new TangoPoseData();
            m_relocalizationData = new TangoPoseData();
            m_onTangoPoseAvailable = null;
            m_isMotionTrackingPoseAvailable = false;
            m_isAreaLearningPoseAvailable = false;
            m_isRelocalizaitonPoseAvailable = false;

#if UNITY_EDITOR
            m_mostRecentEmulatedRelocalizationTimestamp = -1;
#endif
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Stop getting Tango pose callbacks.
        /// </summary>
        internal static void Reset()
        {
            // Avoid calling into tango_client_api before the correct library is loaded.
            if (m_poseAvailableCallback != null)
            {
                PoseProvider.ClearCallback();
            }

            m_poseAvailableCallback         = null;
            m_motionTrackingData            = new TangoPoseData();
            m_areaLearningData              = new TangoPoseData();
            m_relocalizationData            = new TangoPoseData();
            m_onTangoPoseAvailable          = null;
            m_isMotionTrackingPoseAvailable = false;
            m_isAreaLearningPoseAvailable   = false;
            m_isRelocalizaitonPoseAvailable = false;

#if UNITY_EDITOR
            m_mostRecentEmulatedRelocalizationTimestamp = -1;
#endif
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Register to get Tango pose callbacks for specific reference frames.
 /// 
 /// NOTE: Tango pose callbacks happen on a different thread than the main
 /// Unity thread.
 /// </summary>
 /// <param name="framePairs">The reference frames to get callbacks for.</param>
 internal static void SetCallback(TangoCoordinateFramePair[] framePairs)
 {
     if (m_poseAvailableCallback != null)
     {
         Debug.Log("PoseListener.SetCallback() called when callback is already set.");
         return;
     }
     
     Debug.Log("PoseListener.SetCallback()");
     m_poseAvailableCallback = new PoseProvider.APIOnPoseAvailable(_OnPoseAvailable);
     PoseProvider.SetCallback(framePairs, m_poseAvailableCallback);
 }