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


C# TangoApplication.RequestNecessaryPermissionsAndConnect方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: Start

 void Start () {
     tangoApplication = FindObjectOfType<TangoApplication>();
     if(tangoApplication != null) {
         if(AndroidHelper.IsTangoCorePresent()) {
             // Request Tango permissions
             tangoApplication.RegisterPermissionsCallback(_OnTangoApplicationPermissionsEvent);
             tangoApplication.RequestNecessaryPermissionsAndConnect();
         }
     } else {
         Debug.Log("No Tango Manager found in scene.");
     }
 }
開發者ID:GulfstreamPD,項目名稱:tango-examples-unity,代碼行數:12,代碼來源:TangoInitializer.cs

示例4: Start

 // Use this for initialization
 void Start()
 {
     // 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.");
     }
 }
開發者ID:PatHightree,項目名稱:ShaderToy-Walker,代碼行數:17,代碼來源:PoseController.cs

示例5: Start

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

示例6: Start

    /// <summary>
    /// Start is called on the frame when a script is enabled.
    /// </summary>
    public void Start()
    {
        m_tangoApplication = FindObjectOfType<TangoApplication>();
        m_characterController = GetComponent<CharacterController>();

        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.");
        }

        SetPose(transform.position, transform.rotation);
    }
開發者ID:WOSOMTECH,項目名稱:TangoColoredPointCloud,代碼行數:30,代碼來源:TangoDeltaPoseController.cs

示例7: Start

    /// <summary>
    /// Initialize the class.
    /// </summary>
    void Start()
    {
        // Prevent the tablet from falling asleep.
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        m_tangoRotation = Quaternion.identity;
        m_tangoPosition = Vector3.zero;
        m_tangoApplication = FindObjectOfType<TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.RegisterPermissionsCallback(PermissionsCallback);
            m_tangoApplication.RequestNecessaryPermissionsAndConnect();
            m_tangoApplication.Register(this);
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }

        // Get a handle to the rotation and movement toggle elements, and default
        // them to be unchecked.
        if (GameObject.Find("Rotation Toggle") != null)
        {
            m_toggleRotation = GameObject.Find("Rotation Toggle").GetComponent<Toggle>();
            m_toggleRotation.isOn = false;
        }
        if (GameObject.Find("Movement Toggle") != null)
        {
            m_toggleMovement = GameObject.Find("Movement Toggle").GetComponent<Toggle>();
            m_toggleMovement.isOn = false;
        }

        // Track the look rotation difference.
        m_lookRotationDiff = new Quaternion();
        m_lookRotationDiff.x = 0.0f;
        m_lookRotationDiff.y = 0.0f;
        m_lookRotationDiff.z = 0.0f;
        m_lookRotationDiff.w = 0.0f;
    }
開發者ID:techierajan,項目名稱:Allen-Maze,代碼行數:43,代碼來源:PoseController.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: Start

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

            m_scanBounds = GetComponent<BoxCollider>();

            m_exportLock = new Mutex();
            m_progressLock = new Mutex();

            m_tangoApplication.RegisterPermissionsCallback( _OnTangoApplicationPermissionsEvent );
            m_tangoApplication.RequestNecessaryPermissionsAndConnect();

            //m_tangoApplication.Register( this );

            m_request = TangoPoseRequest.IMU_TO_DEVICE | TangoPoseRequest.IMU_TO_CAMERA_DEPTH | TangoPoseRequest.IMU_TO_CAMERA_COLOR;

            m_yuvTexture = m_tangoApplication.GetVideoOverlayTextureYUV();

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

            m_meshes = new Stack<MeshFilter>();
            m_isExporting = false;

            if( m_tangoApplication.m_useExperimentalVideoOverlay ) {
                VideoOverlayProvider.ExperimentalConnectTexture( TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR, m_yuvTexture, OnExperimentalFrameAvailable );
            } else {
                VideoOverlayProvider.ConnectTexture( TangoEnums.TangoCameraId.TANGO_CAMERA_COLOR, m_colourBuffer.GetNativeTextureID() );
            }

            TangoUtility.Init();
        }
開發者ID:broostar,項目名稱:youvebeentangoed,代碼行數:35,代碼來源:TangoPointsMesh.cs


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