예제 #1
0
        public bool CheckForSurfaceChanges(out ScreenOrientation orientation)
        {
            int pixelHeightInt = this.mPrimaryCamera.GetPixelHeightInt();
            int pixelWidthInt  = this.mPrimaryCamera.GetPixelWidthInt();
            ScreenOrientation surfaceOrientation = SurfaceUtilities.GetSurfaceOrientation();
            bool result = false;

            if (pixelHeightInt != this.mCameraViewPortHeight || pixelWidthInt != this.mCameraViewPortWidth || this.mProjectionOrientation != surfaceOrientation)
            {
                this.mCameraViewPortHeight  = pixelHeightInt;
                this.mCameraViewPortWidth   = pixelWidthInt;
                this.mProjectionOrientation = surfaceOrientation;
                SurfaceUtilities.OnSurfaceChanged(this.mCameraViewPortWidth, this.mCameraViewPortHeight);
            }
            CameraDeviceImpl cameraDeviceImpl = (CameraDeviceImpl)CameraDevice.Instance;

            if (cameraDeviceImpl.CameraReady && (VuforiaUnity.IsRendererDirty() || this.CameraParameterChanged()))
            {
                this.ConfigureVideoBackground();
                cameraDeviceImpl.ResetDirtyFlag();
                result = true;
                this.mCameraParameterChanged = false;
            }
            orientation = this.mProjectionOrientation;
            return(result);
        }
예제 #2
0
        public bool CheckForSurfaceChanges(out ScreenOrientation orientation)
        {
            ScreenOrientation surfaceOrientation = SurfaceUtilities.GetSurfaceOrientation();
            bool result = false;

            if (Screen.height != this.mScreenHeight || Screen.width != this.mScreenWidth || this.mProjectionOrientation != surfaceOrientation)
            {
                this.mScreenWidth           = Screen.width;
                this.mScreenHeight          = Screen.height;
                this.mProjectionOrientation = surfaceOrientation;
                SurfaceUtilities.OnSurfaceChanged(this.mScreenWidth, this.mScreenHeight);
            }
            CameraDeviceImpl cameraDeviceImpl = (CameraDeviceImpl)CameraDevice.Instance;

            if (cameraDeviceImpl.CameraReady && (VuforiaUnity.IsRendererDirty() || this.CameraParameterChanged()))
            {
                this.ConfigureVideoBackground();
                cameraDeviceImpl.ResetDirtyFlag();
                result = true;
                this.mCameraParameterChanged = false;
            }
            orientation = this.mProjectionOrientation;
            if (Math.Abs(this.mSecondaryCamera.fieldOfView - this.mPrimaryCamera.fieldOfView) > 0.01f)
            {
                Debug.LogWarning("Field of view values of left and right camera are not identical. This is currently not supported by Vuforia!");
            }
            if (Math.Abs(this.mSecondaryCamera.nearClipPlane - this.mPrimaryCamera.nearClipPlane) > 0.01f || Math.Abs(this.mSecondaryCamera.farClipPlane - this.mPrimaryCamera.farClipPlane) > 0.01f)
            {
                Debug.LogWarning("Clip plane positions of left and right camera are not identical. This is currently not supported by Vuforia!");
            }
            if (this.mNeedToCheckStereo && this.mEyewearDevice.IsDualDisplay() && !this.mEyewearDevice.IsDisplayExtended())
            {
                if (this.mSecondaryCamera != null)
                {
                    Debug.Log("Detecting stereo camera setup, setting stereo mode.");
                    this.mEyewearDevice.SetDisplayExtended(true);
                }
                else
                {
                    Debug.LogWarning("Device is a stereo capable eyewear device, but only one camera has been set up.");
                }
                this.mNeedToCheckStereo = false;
            }
            return(result);
        }
        public virtual bool CheckForSurfaceChanges(out ScreenOrientation orientation)
        {
            ScreenOrientation surfaceOrientation = SurfaceUtilities.GetSurfaceOrientation();
            bool result = false;

            if (Screen.height != this.mScreenHeight || Screen.width != this.mScreenWidth || this.mProjectionOrientation != surfaceOrientation)
            {
                this.mScreenWidth           = Screen.width;
                this.mScreenHeight          = Screen.height;
                this.mProjectionOrientation = surfaceOrientation;
                SurfaceUtilities.OnSurfaceChanged(this.mScreenWidth, this.mScreenHeight);
            }
            CameraDeviceImpl cameraDeviceImpl = (CameraDeviceImpl)CameraDevice.Instance;

            if (cameraDeviceImpl.CameraReady && (VuforiaUnity.IsRendererDirty() || this.CameraParameterChanged()))
            {
                this.ConfigureVideoBackground();
                cameraDeviceImpl.ResetDirtyFlag();
                result = true;
                this.mCameraParameterChanged = false;
            }
            orientation = this.mProjectionOrientation;
            return(result);
        }