コード例 #1
0
 /// <summary>
 /// Start this instance.
 /// </summary>
 void Start()
 {
     m_tangoApplication = GetComponent <TangoApplication>();
     m_tangoApplication.RegisterPermissionsCallback(_OnTangoPermissionsEvent);
     m_tangoApplication.RegisterOnTangoConnect(_OnTangoServiceConnected);
     m_tangoApplication.RegisterOnTangoDisconnect(_OnTangoServiceDisconnected);
     m_tangoApplication.Register(this);
     AndroidHelper.InitTangoUx(m_tangoApplication.m_enableMotionTracking);
 }
コード例 #2
0
 /// <summary>
 /// Start this instance.
 /// </summary>
 public void Start()
 {
     m_tangoApplication = GetComponent <TangoApplication>();
     m_tangoApplication.RegisterPermissionsCallback(_OnTangoPermissionsEvent);
     m_tangoApplication.RegisterOnTangoConnect(_OnTangoServiceConnected);
     m_tangoApplication.RegisterOnTangoDisconnect(_OnTangoServiceDisconnected);
     m_tangoApplication.Register(this);
     AndroidHelper.InitTangoUx();
     SetHoldPosture(m_holdPosture);
 }
コード例 #3
0
    /// <summary>
    /// Initialize the AR Screen.
    /// </summary>
    private void Start()
    {
        m_tangoApplication = FindObjectOfType<TangoApplication>();
        m_arCameraPostProcess = gameObject.GetComponent<ARCameraPostProcess>();
        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);
        }

        if (m_enableOcclusion)
        {
            TangoPointCloud pointCloud = FindObjectOfType<TangoPointCloud>();
            if (pointCloud != null)
            {
                Renderer renderer = pointCloud.GetComponent<Renderer>();
                renderer.enabled = true;

                // Set the renderpass as background renderqueue's number minus one. YUV2RGB shader executes in
                // Background queue which is 1000.
                // But since we want to write depth data to Z buffer before YUV2RGB shader executes so that YUV2RGB
                // data ignores Ztest from the depth data we set renderqueue of PointCloud as 999.
                renderer.material.renderQueue = BACKGROUND_RENDER_QUEUE - 1;
                renderer.material.SetFloat("point_size", POINTCLOUD_SPLATTER_UPSAMPLE_SIZE);
                pointCloud.m_updatePointsMesh = true;
            }
            else
            {
                Debug.Log("Point Cloud data is not available, occlusion is not possible.");
            }
        }
    }
コード例 #4
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);
        }
    }
コード例 #5
0
ファイル: TangoUx.cs プロジェクト: techierajan/FirstLight
 /// <summary>
 /// Start this instance.
 /// </summary>
 public void Start()
 {
     m_tangoApplication = GetComponent<TangoApplication>();
     m_tangoApplication.RegisterPermissionsCallback(_OnTangoPermissionsEvent);
     m_tangoApplication.RegisterOnTangoConnect(_OnTangoServiceConnected);
     m_tangoApplication.RegisterOnTangoDisconnect(_OnTangoServiceDisconnected);
     m_tangoApplication.Register(this);
     AndroidHelper.InitTangoUx();
 }