Exemplo n.º 1
0
        /// <summary>
        /// Update.
        /// </summary>
        private void Update()
        {
            UpdateScreenOrientation();
            s_LocalToWorldTransform = Camera.main.transform.localToWorldMatrix * ARCameraInfo.ScreenRotation;

            if (!s_HasIntrinsics)
            {
                if (Application.isEditor)
                {
                    s_HasIntrinsics   = true;
                    s_FocalLength     = new Vector2(506.4582f, 505.9296f);
                    s_PrincipalPoint  = new Vector2(319.5142f, 242.3049f);
                    s_ImageDimensions = new Vector2Int(640, 480);
                }
                else
                {
                    s_HasIntrinsics = CameraManager.TryGetIntrinsics(out s_CameraIntrinsics);
                    if (s_HasIntrinsics)
                    {
                        s_FocalLength     = new Vector2(125.7424f, 125.7979f); //s_CameraIntrinsics.focalLength;
                        s_PrincipalPoint  = new Vector2(79.99667f, 45.71975f); //s_CameraIntrinsics.principalPoint;
                        s_ImageDimensions = new Vector2Int(160, 90);           //s_CameraIntrinsics.resolution;
                    }
                }
            }

            if (Application.isEditor)
            {
                s_DepthTexture      = EditorDepthFallback;
                s_RawDepthTexture   = EditorDepthFallback;
                s_ConfidenceTexture = EditorDepthFallback;
            }
            else
            {
                if (OcclusionManager == null || OcclusionManager.currentEnvironmentDepthMode == EnvironmentDepthMode.Disabled)
                {
                    return;
                }

                s_DepthTexture      = OcclusionManager.environmentDepthTexture;
                s_RawDepthTexture   = OcclusionManager.GetEnvironmentRawDepthTexture();
                s_ConfidenceTexture = OcclusionManager.GetEnvironmentRawDepthConfidenceTexture();
            }
        }