當前位置: 首頁>>代碼示例>>C#>>正文


C# Tango.TangoApplication類代碼示例

本文整理匯總了C#中Tango.TangoApplication的典型用法代碼示例。如果您正苦於以下問題:C# TangoApplication類的具體用法?C# TangoApplication怎麽用?C# TangoApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TangoApplication類屬於Tango命名空間,在下文中一共展示了TangoApplication類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Start

    /// <summary>
    /// Use this for initialization.
    /// </summary>
    public void Start() 
    {
        m_tangoApplication = FindObjectOfType<TangoApplication>();
        m_tangoApplication.Register(this);

        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));

        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_triangles = new int[VERT_COUNT];
        // Assign triangles, note: this is just for visualizing point in the mesh data.
        for (int i = 0; i < VERT_COUNT; i++)
        {
            m_triangles[i] = i;
        }

        m_mesh = GetComponent<MeshFilter>().mesh;
        m_mesh.Clear();
        m_mesh.triangles = m_triangles;
        m_mesh.RecalculateBounds();
        m_mesh.RecalculateNormals();
       
    }
開發者ID:GulfstreamPD,項目名稱:tango-examples-unity,代碼行數:32,代碼來源:Pointcloud.cs

示例2: CheckForTangoApplication

 /// <summary>
 /// Check for a usable tango application component in the scene. Draw warning if 
 /// one could not be found.
 /// 
 /// Should be called first before using any other TangoPrefabInspectorHelper function
 /// during a given frame, to determine if a valid TangoApplication reference exists
 /// with which to call other TangoPrefabInspectorHelper methods.
 /// </summary>
 /// <returns><c>true</c>, if a tango application on an active GameObject can be identified, 
 /// <c>false</c> otherwise.</returns>
 /// <param name="inspectedBehaviour">Prefab behavior that's being inspected.</param>
 /// <param name="tangoApplication">Prefab inspector's reference to Tango Application, or
 /// null if no Tango Application on an active GameObject can be identified.</param>
 public static bool CheckForTangoApplication(MonoBehaviour inspectedBehaviour,
                                             ref TangoApplication tangoApplication)
 {
     if (tangoApplication == null || !tangoApplication.gameObject.activeInHierarchy)
     {
         tangoApplication = GameObject.FindObjectOfType<TangoApplication>();
     }
     
     // Note: .isActiveAndEnabled is the appropriate thing to check here because all Register() 
     // calls on existing Tango prefabs are called in Start(), which won't occur until both the
     // behaviour is enabled and the game object it is attached to is active.
     // 
     // Conversely, if any of the tango prefabs called Register() in Awake(), the correct thing
     // to check against would be .gameObject.activeInHeirarchy, since Awake is called when the
     // game object it is attached to is active, regardless of whether the behaviour itself is
     // enabled.
     if (tangoApplication == null && inspectedBehaviour.isActiveAndEnabled)
     {
         EditorGUILayout.HelpBox("Could not find an active TangoApplication component in the scene.\n\n"
                                 + "Component will not function correctly if it cannot find "
                                 + "an active TangoApplication component at runtime.",
                                 MessageType.Warning);
         return false;
     }
     
     return tangoApplication != null;
 }
開發者ID:kyr7,項目名稱:tango-examples-unity,代碼行數:40,代碼來源:TangoPrefabInspectorHelper.cs

示例3: Start

 /// <summary>
 /// Use this for initialization.
 /// </summary>
 public void Start()
 {
     m_marker.SetActive(false);
     m_pointCloud = FindObjectOfType<TangoPointCloud>();
     m_pointCloudFloor = FindObjectOfType<TangoPointCloudFloor>();
     m_tangoApplication = FindObjectOfType<TangoApplication>();
 }
開發者ID:kyr7,項目名稱:tango-examples-unity,代碼行數:10,代碼來源:TangoFloorFindingUIController.cs

示例4: Start

    /// <summary>
    /// Start this instance.
    /// </summary>
    private void Start()
    {
        Application.targetFrameRate = 60;

        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);
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it!
                StartCoroutine(_InformUserNoTangoCore());
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
開發者ID:GulfstreamPD,項目名稱:tango-examples-unity,代碼行數:29,代碼來源:CustomTangoController.cs

示例5: Start

    // Use this for initialization
    void Start ()
    {
        // Initialize some variables
        m_tangoRotation = Quaternion.Euler(90,0,0);
        m_tangoPosition = Vector3.zero;
        m_startPosition = transform.position;
        m_tangoApplication = FindObjectOfType<TangoApplication>();
        if(m_tangoApplication != null)
        {
            // Request Tango permissions
            m_tangoApplication.RegisterPermissionsCallback(PermissionsCallback);
            m_tangoApplication.RequestNecessaryPermissionsAndConnect();
            m_tangoApplication.Register(this);
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }

        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));
        
        m_dTuc = new Matrix4x4();
        m_dTuc.SetColumn (0, new Vector4 (1.0f, 0.0f, 0.0f, 0.0f));
        m_dTuc.SetColumn (1, new Vector4 (0.0f, 1.0f, 0.0f, 0.0f));
        m_dTuc.SetColumn (2, new Vector4 (0.0f, 0.0f, -1.0f, 0.0f));
        m_dTuc.SetColumn (3, new Vector4 (0.0f, 0.0f, 0.0f, 1.0f));


        Application.targetFrameRate = 60;

    }
開發者ID:GulfstreamPD,項目名稱:tango-examples-unity,代碼行數:36,代碼來源:PoseController.cs

示例6: _DrawMotionTrackingOptions

    /// <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);

            tangoApplication.m_enableADFLoading = EditorGUILayout.Toggle("Load ADF",
                                                                         tangoApplication.m_enableADFLoading);
            tangoApplication.m_enableAreaLearning = EditorGUILayout.Toggle("Area Learning", 
                                                                           tangoApplication.m_enableAreaLearning);

            tangoApplication.m_enableCloudADF = EditorGUILayout.Toggle("Cloud ADF", tangoApplication.m_enableCloudADF);
            if (tangoApplication.m_enableCloudADF)
            {
                tangoApplication.m_cloudApiKey = EditorGUILayout.TextField("Cloud API Key", tangoApplication.m_cloudApiKey);
            }

            EditorGUI.indentLevel--;
        }
        EditorGUILayout.Space();
    }
開發者ID:gitunit,項目名稱:project-tango-poc,代碼行數:29,代碼來源:TangoInspector.cs

示例7: Start

 /// <summary>
 /// Start this instance.
 /// </summary>
 public void Start()
 {
     m_tangoApplication = GetComponent<TangoApplication>();
     m_tangoApplication.Register(this);
     AndroidHelper.InitTangoUx();
     SetHoldPosture(m_holdPosture);
 }
開發者ID:gitunit,項目名稱:project-tango-poc,代碼行數:10,代碼來源:TangoUx.cs

示例8: Start

    // Use this for initialization
    void Start()
    {
        // Prevent the screen from sleeping
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        // Initialize some variables
        m_tangoRotation = Quaternion.identity;
        m_tangoPosition = Vector3.zero;
        m_startPosition = transform.position;
        m_tangoApplication = FindObjectOfType<TangoApplication>();
        if(m_tangoApplication != null)
        {
            // Request Tango permissions
            m_tangoApplication.RegisterPermissionsCallback(PermissionsCallback);
            m_tangoApplication.RequestNecessaryPermissionsAndConnect();
            m_tangoApplication.Register(this);
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }

        //sp = new SerialPort( "baka", 9600, Parity.None, 8, StopBits.One);

        //sp.Open();

        //sp.ReadTimeout = 50;
    }
開發者ID:techierajan,項目名稱:spiritus-chronomatix,代碼行數:29,代碼來源:PoseController.cs

示例9: _DrawMotionTrackingOptions

    /// <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);

            tangoApplication.m_useLowLatencyIMUIntegration = EditorGUILayout.Toggle("Low Latency Pose",
                                                                                    tangoApplication.m_useLowLatencyIMUIntegration);

            tangoApplication.m_enableAreaLearning = EditorGUILayout.Toggle("Area Learning",
                                                                           tangoApplication.m_enableAreaLearning);
            if (tangoApplication.m_enableAreaLearning)
            {
                EditorGUI.indentLevel++;
                tangoApplication.m_useExperimentalADF = EditorGUILayout.Toggle("High Accuracy (Experimental)",
                                                                               tangoApplication.m_useExperimentalADF);
                EditorGUI.indentLevel--;
            }

            EditorGUI.indentLevel--;
        }
        EditorGUILayout.Space();
    }
開發者ID:BrendaManrique,項目名稱:tango-examples-unity,代碼行數:31,代碼來源:TangoInspector.cs

示例10: Start

 /// <summary>
 /// Use this for initialization.
 /// </summary>
 private void Start() 
 {
     m_currentFPS = 0;
     m_framesSinceUpdate = 0;
     m_currentTime = 0.0f;
     m_fpsText = "FPS = Calculating";
     m_tangoApplication = FindObjectOfType<TangoApplication>();
 }
開發者ID:Jicheng-Yan,項目名稱:tango-examples-unity,代碼行數:11,代碼來源:FPSCounter.cs

示例11: Start

 /// <summary>
 /// Unity start override function.
 /// 
 /// We register this object as a listener to the pose callbacks.
 /// </summary>
 public void Start()
 {
     m_tangoApplication = FindObjectOfType<TangoApplication>();
     
     if (m_tangoApplication != null)
     {
         m_tangoApplication.Register(this);
     }
 }
開發者ID:ekumenlabs,項目名稱:Garkanoid,代碼行數:14,代碼來源:RelocalizingOverlay.cs

示例12: Start

 /// <summary>
 /// Use this for initialization.
 /// </summary>
 private 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>();
 }
開發者ID:JeffPinkston,項目名稱:tango-examples-unity,代碼行數:12,代碼來源:AreaLearningFPSCounter.cs

示例13: Start

 // Use this for initialization
 void Start()
 {
     m_tangoApplication = FindObjectOfType<TangoApplication>();
     m_btnGuiText.text = "Start";
     m_btnGuiText.color = m_txtStartColour;
     ColorBlock cb = m_btnStartStop.colors;
     cb.normalColor = m_btnStartColour;
     m_btnStartStop.colors = cb;
 }
開發者ID:broostar,項目名稱:youvebeentangoed,代碼行數:10,代碼來源:PointMeshGUI.cs

示例14: Start

 /// <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();
 }
開發者ID:GulfstreamPD,項目名稱:tango-examples-unity,代碼行數:13,代碼來源:GUIController.cs

示例15: Start

    /// @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);
        }
    }
開發者ID:kyr7,項目名稱:tango-examples-unity,代碼行數:15,代碼來源:TangoPointCloudFloor.cs


注:本文中的Tango.TangoApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。