Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        m_poseController   = FindObjectOfType <TangoARPoseController>();
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
        }
    }
Exemplo n.º 2
0
        void Start()
        {
            markers = new List <Transform>();

            TangoApplication tango = FindObjectOfType <TangoApplication>();

            tango.Register(this);

            player = FindObjectOfType <TangoARPoseController>().transform;
        }
Exemplo n.º 3
0
    /// <summary>
    /// Draws development options.
    ///
    /// These should only be set while in development.
    /// </summary>
    /// <param name="tangoApplication">Tango application.</param>
    private void _DrawDevelopmentOptions(TangoApplication tangoApplication)
    {
        GUILayout.Label("Development Options (Disable these before publishing)", GUILayout.ExpandWidth(true));
        EditorGUI.indentLevel++;
        tangoApplication.m_allowOutOfDateTangoAPI = EditorGUILayout.Toggle(
            "Allow out of date API", m_tangoApplication.m_allowOutOfDateTangoAPI);
        EditorGUI.indentLevel--;

        EditorGUILayout.Space();
    }
Exemplo n.º 4
0
 /// <summary>
 /// Unity Start() callback, we set up some initial values here.
 /// </summary>
 void Start()
 {
     m_currentFPS          = 0;
     m_framesSinceUpdate   = 0;
     m_currentTime         = 0.0f;
     m_FPSText             = "FPS = Calculating";
     m_label               = new Rect(Screen.width * 0.025f - 50, Screen.height * 0.96f - 25, 600.0f, 50.0f);
     m_tangoApplication    = FindObjectOfType <TangoApplication>();
     m_tangoServiceVersion = TangoApplication.GetTangoServiceVersion();
 }
Exemplo n.º 5
0
 public void RegisterApplication()
 {
     isNewMap           = false;
     UIManager.gs       = UIManager.guistate.SelecMapMenu;
     m_tangoApplication = FindObjectOfType <TangoApplication>();
     if (m_tangoApplication != null)
     {
         m_tangoApplication.Register(this);
         m_tangoApplication.RequestPermissions();
     }
 }
Exemplo n.º 6
0
    /// @cond
    /// <summary>
    /// Use this for initialization.
    /// </summary>
    public void Start()
    {
        m_pointCloud       = FindObjectOfType <TangoPointCloud>();
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        // All child objects are disabled until the floor is found.
        foreach (Transform t in transform)
        {
            t.gameObject.SetActive(false);
        }
    }
Exemplo n.º 7
0
    /// <summary>
    /// Start is called on the frame when a script is enabled.
    /// </summary>
    public void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication == null)
        {
            Debug.LogError("An instance of TangoApplication was not found in the scene.");
        }

        m_tangoARScreen       = GetComponent <TangoARScreen>();
        m_characterController = GetComponent <CharacterController>();
    }
 /// <summary>
 /// Unity Start() callback, we set up some initial values here.
 /// </summary>
 public void Start()
 {
     m_currentFPS          = 0;
     m_framesSinceUpdate   = 0;
     m_currentTime         = 0.0f;
     m_fpsText             = "FPS = Calculating";
     m_tangoApplication    = FindObjectOfType <TangoApplication>();
     m_tangoPose           = FindObjectOfType <TangoARPoseController>();
     m_arCameraPostProcess = FindObjectOfType <ARCameraPostProcess>();
     m_tangoServiceVersion = TangoApplication.GetTangoServiceVersion();
 }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("ajax list adf startup");

        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            m_tangoApplication.RequestPermissions();
        }
    }
Exemplo n.º 10
0
 public override void OnInit()
 {
     //直接可以拿到,但是为了使用方便
     m_tangoApplication = TangoService.Instance.m_tangoApplication;
     //这里采用一个引用
     m_poseController = TangoService.Instance.m_poseController;
     if (m_tangoApplication != null)
     {
         m_tangoApplication.Register(this);
     }
     base.OnInit();
 }
Exemplo n.º 11
0
    /// <summary>
    /// Draws development options.
    ///
    /// These should only be set while in development.
    /// </summary>
    /// <param name="tangoApplication">Tango application.</param>
    private void _DrawDevelopmentOptions(TangoApplication tangoApplication)
    {
        GUILayout.Label("Development Options (Disable these before publishing)", GUILayout.ExpandWidth(true));
        EditorGUI.indentLevel++;
        tangoApplication.m_allowOutOfDateTangoAPI = EditorGUILayout.Toggle(
            "Allow out of date API", m_tangoApplication.m_allowOutOfDateTangoAPI);
        tangoApplication.m_testEnvironment = (GameObject)EditorGUILayout.ObjectField(
            "Test Environment", m_tangoApplication.m_testEnvironment, typeof(GameObject), false);
        EditorGUI.indentLevel--;

        EditorGUILayout.Space();
    }
Exemplo n.º 12
0
 private bool failsafeSetTangoManager()
 {
     if (tangoManager != null)
     {
         return(true);
     }
     else
     {
         tangoManager = GameObject.FindObjectOfType <TangoApplication>();
         return(tangoManager != null);
     }
 }
Exemplo n.º 13
0
    /// <summary>
    /// Raises the enable event.
    /// </summary>
    private void OnEnable()
    {
        m_tangoApplication = (TangoApplication)target;

        // Fixup the old state of TangoApplication before there were two checkboxes.  If only m_enableVideoOverlay was
        // set, then that meant to use the Byte Buffer method.
        if (m_tangoApplication.m_enableVideoOverlay && !m_tangoApplication.m_videoOverlayUseByteBufferMethod &&
            !m_tangoApplication.m_videoOverlayUseTextureIdMethod)
        {
            m_tangoApplication.m_videoOverlayUseByteBufferMethod = true;
        }
    }
Exemplo n.º 14
0
 /// <summary>
 /// Draw video overlay options.
 /// </summary>
 /// <param name="tangoApplication">Tango application.</param>
 private void _DrawVideoOverlayOptions(TangoApplication tangoApplication)
 {
     tangoApplication.m_enableVideoOverlay = EditorGUILayout.Toggle("Enable Video Overlay",
                                                                    tangoApplication.m_enableVideoOverlay);
     if (tangoApplication.m_enableVideoOverlay)
     {
         EditorGUI.indentLevel++;
         tangoApplication.m_useExperimentalVideoOverlay = EditorGUILayout.Toggle("GPU Accelerated (Experimental)",
                                                                                 tangoApplication.m_useExperimentalVideoOverlay);
         EditorGUI.indentLevel--;
     }
     EditorGUILayout.Space();
 }
Exemplo n.º 15
0
    public void CreateNewMap(string Name)
    {
        isNewMap = true;
        mapName  = Name;

        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            m_tangoApplication.RequestPermissions();
        }
    }
Exemplo n.º 16
0
    // Starting functionality
    void Start()
    {
        // Initialize private variables
        rb           = GetComponent <Rigidbody>();
        count        = 0;
        winText.text = "";

        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            m_tangoApplication.RequestPermissions();
        }
    }
    /// <summary>
    /// Use this for initialization.
    /// </summary>
    public void Start()
    {
        Statics.currentTangoState = TangoPoseStates.Connecting;

        tangoApplication = FindObjectOfType <TangoApplication>();
        if (tangoApplication == null)
        {
            tangoApplication = FindObjectOfType <TangoApplication>();
        }
        tangoApplication.Register(this);
        tangoApplication.Startup(AreaDescription.ForUUID(Statics.curADFId));

        startingRotation = transform.rotation;
    }
Exemplo n.º 18
0
    public void Start()
    {
        m_tangoApplication    = FindObjectOfType <TangoApplication>();
        m_tangoPose           = FindObjectOfType <TangoARPoseController>();
        m_tangoServiceVersion = TangoApplication.GetTangoServiceVersion();

        m_tangoApplication.Register(this);

        for (int i = 0; i < _Selectables.Length; i++)
        {
            Debug.Log(_Selectables[i]._SelectableType.ToString() + " " + i);
            _selectablesMap.Add(_Selectables[i]._SelectableType, i);
        }
    }
Exemplo n.º 19
0
    /// <summary>
    /// Draw motion tracking options.
    /// </summary>
    /// <param name="tangoApplication">Tango application.</param>
    private void _DrawMotionTrackingOptions(TangoApplication tangoApplication)
    {
        tangoApplication.m_enableMotionTracking = EditorGUILayout.Toggle(
            "Enable Motion Tracking", tangoApplication.m_enableMotionTracking);
        if (tangoApplication.m_enableMotionTracking)
        {
            ++EditorGUI.indentLevel;
            tangoApplication.m_motionTrackingAutoReset = EditorGUILayout.Toggle(
                "Auto Reset", tangoApplication.m_motionTrackingAutoReset);
            --EditorGUI.indentLevel;
        }

        EditorGUILayout.Space();
    }
Exemplo n.º 20
0
    /// <summary>
    /// Initialize the AR Screen.
    /// </summary>
    private void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.RegisterOnTangoConnect(_SetCameraIntrinsics);

            // Pass YUV textures to shader for process.
            m_textures = m_tangoApplication.GetVideoOverlayTextureYUV();
            m_screenMaterial.SetTexture("_YTex", m_textures.m_videoOverlayTextureY);
            m_screenMaterial.SetTexture("_UTex", m_textures.m_videoOverlayTextureCb);
            m_screenMaterial.SetTexture("_VTex", m_textures.m_videoOverlayTextureCr);
        }
    }
Exemplo n.º 21
0
        void Start()
        {
            tango = FindObjectOfType <TangoApplication>();
            tango.Register(this);

            DeviceOrientationListener.onOrientationChanged += _ => {
                UpdateFOV();
            };

            if (updateFovButton)
            {
                updateFovButton.onClick.AddListener(() => UpdateFOV());
            }
        }
Exemplo n.º 22
0
    // Use this for initialization
    void Start()
    {
        last_timestamp = -1.0;

        pose_queue  = new Queue <TangoPoseData>();
        depth_queue = new Queue <TangoUnityDepth>();
        image_queue = new Queue <ImagePair>();

        m_tangoApplication = GameObject.FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
        }
    }
Exemplo n.º 23
0
    /// <summary>
    /// Initialize the AR Screen.
    /// </summary>
    private void Start()
    {
        // Constant matrix converting start of service frame to Unity world frame.
        m_uwTss = new Matrix4x4();
        m_uwTss.SetColumn(0, new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
        m_uwTss.SetColumn(1, new Vector4(0.0f, 0.0f, 1.0f, 0.0f));
        m_uwTss.SetColumn(2, new Vector4(0.0f, 1.0f, 0.0f, 0.0f));
        m_uwTss.SetColumn(3, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));

        // Constant matrix converting Unity world frame frame to device frame.
        m_cTuc.SetColumn(0, new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
        m_cTuc.SetColumn(1, new Vector4(0.0f, -1.0f, 0.0f, 0.0f));
        m_cTuc.SetColumn(2, new Vector4(0.0f, 0.0f, 1.0f, 0.0f));
        m_cTuc.SetColumn(3, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));

        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            if (AndroidHelper.IsTangoCorePresent())
            {
                // Request Tango permissions
                m_tangoApplication.RegisterPermissionsCallback(_OnTangoApplicationPermissionsEvent);
                m_tangoApplication.RequestNecessaryPermissionsAndConnect();
                m_tangoApplication.Register(this);
                m_renderCamera.clearFlags = CameraClearFlags.SolidColor;
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it.
                Debug.Log("Tango Core is outdated.");
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
        if (m_tangoApplication != null)
        {
            m_textures = m_tangoApplication.GetVideoOverlayTextureYUV();

            // Pass YUV textures to shader for process.
            m_screenMaterial.SetTexture("_YTex", m_textures.m_videoOverlayTextureY);
            m_screenMaterial.SetTexture("_UTex", m_textures.m_videoOverlayTextureCb);
            m_screenMaterial.SetTexture("_VTex", m_textures.m_videoOverlayTextureCr);
        }

        m_tangoApplication.Register(this);
    }
Exemplo n.º 24
0
    /// <summary>
    /// Draw area description options.
    /// </summary>
    /// <param name="tangoApplication">Tango application.</param>
    private void _DrawAreaDescriptionOptions(TangoApplication tangoApplication)
    {
        tangoApplication.m_enableAreaDescriptions = EditorGUILayout.Toggle(
            "Enable Area Descriptions", tangoApplication.m_enableAreaDescriptions);

        if (tangoApplication.m_enableAreaDescriptions)
        {
            ++EditorGUI.indentLevel;
            tangoApplication.m_areaDescriptionLearningMode = EditorGUILayout.Toggle(
                "Learning Mode", tangoApplication.m_areaDescriptionLearningMode);
            --EditorGUI.indentLevel;
        }

        EditorGUILayout.Space();
    }
Exemplo n.º 25
0
    /// <summary>
    /// Start is called on the frame when a script is enabled.
    /// </summary>
    public void Start()
    {
        m_tangoARScreen = GetComponent <TangoARScreen>();

        TangoApplication tangoApplication = FindObjectOfType <TangoApplication>();

        if (tangoApplication != null)
        {
            tangoApplication.Register(this);
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
    // Use this for initialization
    void Start()
    {
        Statics.currentTangoState = TangoPoseStates.Connecting;

        tangoApplication = FindObjectOfType <TangoApplication>();
        if (tangoApplication == null)
        {
            tangoApplication = FindObjectOfType <TangoApplication>();
        }
        tangoApplication.InitProviders(Statics.curADFId);
        tangoApplication.Register(this);
        tangoApplication.ConnectToService();

        startingRotation = transform.rotation;
    }
Exemplo n.º 27
0
    void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        m_pointCloud       = FindObjectOfType <TangoPointCloud>();
        m_imagebuffer      = new TangoUnityImageData();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
Exemplo n.º 28
0
    /// <summary>
    /// Unity Start function.
    /// </summary>
    public void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }

        m_planets    = new GameObject[m_planetsPrefabs.Length];
        m_markerList = new List <TangoSupport.Marker>();
    }
Exemplo n.º 29
0
    /// <summary>
    /// Start this instance.
    /// </summary>
    public void Start()
    {
        m_tangoServiceVersionName = TangoApplication.GetTangoServiceVersion();

        TangoApplication tangoApplication = FindObjectOfType <TangoApplication>();

        if (tangoApplication != null)
        {
            tangoApplication.Register(this);
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
    /// <summary>
    /// Unity Start function.
    ///
    /// We find and assign pose controller and tango application, and register this class to callback events.
    /// </summary>
    public void Start()
    {
        admin = adminToggle.isOn;
        if (!admin)
        {
            adminGUI.SetActive(false);
        }
        m_poseController   = FindObjectOfType <TangoARPoseController>();
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
        }
    }