Beispiel #1
0
    void OnVuforiaStarted()
    {
        Debug.Log("OnVuforiaStarted() called.");

        m_StateManager = TrackerManager.Instance.GetStateManager();

        // Check trackers to see if started and start if necessary
        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();
        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();

        if (m_PositionalDeviceTracker != null && m_SmartTerrain != null)
        {
            if (!m_PositionalDeviceTracker.IsActive)
            {
                m_PositionalDeviceTracker.Start();
            }
            if (m_PositionalDeviceTracker.IsActive && !m_SmartTerrain.IsActive)
            {
                m_SmartTerrain.Start();
            }
        }
        else
        {
            if (m_PositionalDeviceTracker == null)
            {
                Debug.Log("PositionalDeviceTracker returned null. GroundPlane not supported on this device.");
            }
            if (m_SmartTerrain == null)
            {
                Debug.Log("SmartTerrain returned null. GroundPlane not supported on this device.");
            }

            MessageBox.DisplayMessageBox(unsupportedDeviceTitle, unsupportedDeviceBody, false, null);
        }
    }
Beispiel #2
0
    public void restart()

    {
        VuforiaBehaviour.Instance.enabled = false;
        // void StopExtendedTracking()

        PositionalDeviceTracker extendedTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();

        if (extendedTracker != null && extendedTracker.IsActive)
        {
            extendedTracker.Stop();
        }

        //void StopTracking()

        TrackerManager.Instance.GetTracker <ObjectTracker>().Stop();

        Task.Delay(2000).Wait();

        //void StartExtendedTracking()

        //PositionalDeviceTracker extendedTracker = TrackerManager.Instance.GetTracker<PositionalDeviceTracker>();
        if (extendedTracker != null && extendedTracker.IsActive)
        {
            extendedTracker.Start();
        }

        //void StartTracking()

        TrackerManager.Instance.GetTracker <ObjectTracker>().Start();

        VuforiaBehaviour.Instance.enabled = true;
    }
Beispiel #3
0
    void OnVuforiaStarted()
    {
        Debug.Log("OnVuforiaStarted() called.");

        m_StateManager = TrackerManager.Instance.GetStateManager();

        // Check trackers to see if started and start if necessary
        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();
        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();

        if (m_PositionalDeviceTracker != null && m_SmartTerrain != null)
        {
            if (!m_PositionalDeviceTracker.IsActive)
            {
                m_PositionalDeviceTracker.Start();
            }
            if (m_PositionalDeviceTracker.IsActive && !m_SmartTerrain.IsActive)
            {
                m_SmartTerrain.Start();
            }
            YiyouStaticDataManager.Instance.StartLoadABAssets();
        }
        else
        {
            SceneManager.LoadScene("wikiSLAM");
        }
    }
    void OnVuforiaStarted()
    {
        Debug.Log("OnVuforiaStarted() called.");

        m_StateManager            = TrackerManager.Instance.GetStateManager();
        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();
        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();
        if (m_PositionalDeviceTracker != null && m_SmartTerrain != null)
        {
            if (!m_PositionalDeviceTracker.IsActive)
            {
                m_PositionalDeviceTracker.Start();
            }
            if (m_PositionalDeviceTracker.IsActive && !m_SmartTerrain.IsActive)
            {
                m_SmartTerrain.Start();
            }
        }
        else
        {
            if (m_PositionalDeviceTracker == null)
            {
                Debug.Log("PositionalDeviceTracker returned null. GroundPlane not supported on this device.");
            }
            if (m_SmartTerrain == null)
            {
                Debug.Log("SmartTerrain returned null. GroundPlane not supported on this device.");
            }
        }
    }
    public virtual void ToggleDeviceTracking(bool enableDeviceTracking)
    {
        if (m_PositionalDeviceTracker != null)
        {
            if (enableDeviceTracking)
            {
                // if the positional device tracker is not yet started, start it
                if (!m_PositionalDeviceTracker.IsActive)
                {
                    if (m_PositionalDeviceTracker.Start())
                    {
                        Debug.Log("Successfully started device tracker");
                    }
                    else
                    {
                        Debug.LogError("Failed to start device tracker");
                    }
                }
            }
            else if (m_PositionalDeviceTracker.IsActive)
            {
                m_PositionalDeviceTracker.Stop();

                Debug.Log("Successfully stopped device tracker");
            }
        }
        else
        {
            Debug.LogError("Failed to toggle device tracker state, make sure device tracker is initialized");
        }

        m_DeviceTrackerEnabled = m_PositionalDeviceTracker.IsActive;
    }
Beispiel #6
0
    public void ResetTrackers()
    {
        Debug.Log("ResetTrackers() called.");

        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();
        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();

        // Stop and restart trackers
        m_SmartTerrain.Stop(); // stop SmartTerrain tracker before PositionalDeviceTracker
        m_PositionalDeviceTracker.Stop();
        m_PositionalDeviceTracker.Start();
        m_SmartTerrain.Start(); // start SmartTerrain tracker after PositionalDeviceTracker
    }
Beispiel #7
0
    public void ResetTrackers()
    {
        Debug.Log("ResetTrackets() Called.");

        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();
        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();


        m_SmartTerrain.Stop();
        m_PositionalDeviceTracker.Stop();
        m_PositionalDeviceTracker.Start();
        m_SmartTerrain.Start();
    }
    void OnTrackerStarted()
    {
        Debug.Log("OnTrackerStarted() called.");

        positionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();

        if (positionalDeviceTracker != null)
        {
            if (!positionalDeviceTracker.IsActive)
            {
                positionalDeviceTracker.Start();
            }

            Debug.Log("PositionalDeviceTracker is Active?: " + positionalDeviceTracker.IsActive);
        }
    }
Beispiel #9
0
    void OnTrackerStarted()
    {
        Debug.Log("OnTrackerStarted() called.");

        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();
        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();

        if (m_PositionalDeviceTracker != null)
        {
            if (!m_PositionalDeviceTracker.IsActive)
            {
                m_PositionalDeviceTracker.Start();
            }

            Debug.Log("PositionalDeviceTracker is Active?: " + m_PositionalDeviceTracker.IsActive +
                      "\nSmartTerrain Tracker is Active?: " + m_SmartTerrain.IsActive);
        }
    }
    /// <summary>
    /// Activar/Desactivar positional tracker
    /// </summary>
    private void SetPositionTrackerVuforia()
    {
        Debug.Log("Set position");
        PositionalDeviceTracker pdt = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();

        if (pdt != null)
        {
            if (IsTrackerPose)
            {
                pdt.Start();
            }
            else
            {
                pdt.Stop();
            }
        }

        finishPositionTracker.Invoke();
    }
        private void EnableDeviceTracker(bool value)
        {
            if (!_arCoreSupport)
            {
                return;
            }

            if (_positionalDeviceTracker == null)
            {
                _positionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();
            }

            if (value)
            {
                _positionalDeviceTracker.Start();
            }
            else
            {
                _positionalDeviceTracker.Stop();
            }
        }
Beispiel #12
0
    void OnVuforiaStarted()
    {
        Debug.Log("OnVuforiaStarted() called.");

        m_StateManager = TrackerManager.Instance.GetStateManager();

        // Check trackers to see if started and start if necessary
        m_PositionalDeviceTracker = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();
        m_SmartTerrain            = TrackerManager.Instance.GetTracker <SmartTerrain>();

        if (m_PositionalDeviceTracker != null && m_SmartTerrain != null)
        {
            if (!m_PositionalDeviceTracker.IsActive)
            {
                m_PositionalDeviceTracker.Start();
            }
            if (m_PositionalDeviceTracker.IsActive && !m_SmartTerrain.IsActive)
            {
                m_SmartTerrain.Start();
            }
        }
        else
        {
            if (m_PositionalDeviceTracker == null)
            {
                Debug.Log("PositionalDeviceTracker returned null. GroundPlane not supported on this device.");
            }
            if (m_SmartTerrain == null)
            {
                Debug.Log("SmartTerrain returned null. GroundPlane not supported on this device.");
            }

            MessageBox.DisplayMessageBox(unsupportedDeviceTitle, unsupportedDeviceBody, false, null);
        }
        m_ContentPositioningBehaviour = m_PlaneFinder.GetComponent <ContentPositioningBehaviour>();
        m_ContentPositioningBehaviour.DuplicateStage = false;
        SetMidAirMode(true);
    }
    private void update_VuforiaConfig_slamMode()
    {
        if (b_slamMode != b_SlamModeBeforeStep && !b_pdtFirstTime)
        {
            pdt_deviceTracker_slamMode = TrackerManager.Instance.GetTracker <PositionalDeviceTracker>();

            if (b_slamMode)
            {
                if (pdt_deviceTracker_slamMode == null)
                {
                    pdt_deviceTracker_slamMode = TrackerManager.Instance.InitTracker <PositionalDeviceTracker>();
                    Debug.LogWarning("PDT ADD POSITION DEVICE");
                }
                pdt_deviceTracker_slamMode.Start();
                Debug.LogWarning("PDT START");
            }
            else
            {
                pdt_deviceTracker_slamMode.Stop();
                Debug.LogWarning("PDT STOP");
            }
        }
        b_SlamModeBeforeStep = b_slamMode;
    }