File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Assets/MRTK/Services/DiagnosticsSystem Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -462,6 +462,7 @@ private void LateUpdate()
462
462
463
463
#if WINDOWS_UWP
464
464
private void AppCapture_CapturingChanged ( AppCapture sender , object args ) => appCaptureIsCapturingVideo = sender . IsCapturingVideo ;
465
+ private float previousFieldOfView = - 1.0f ;
465
466
#endif // WINDOWS_UWP
466
467
467
468
private static readonly ProfilerMarker CalculateWindowPositionPerfMarker = new ProfilerMarker ( "[MRTK] MixedRealityToolkitVisualProfiler.CalculateWindowPosition" ) ;
@@ -470,7 +471,13 @@ private Vector3 CalculateWindowPosition(Transform cameraTransform)
470
471
{
471
472
using ( CalculateWindowPositionPerfMarker . Auto ( ) )
472
473
{
473
- float windowDistance = Mathf . Max ( 16.0f / CameraCache . Main . fieldOfView , CameraCache . Main . nearClipPlane + 0.25f ) ;
474
+ float windowDistance =
475
+ #if WINDOWS_UWP
476
+ Mathf . Max ( 16.0f / ( appCaptureIsCapturingVideo ? previousFieldOfView : previousFieldOfView = CameraCache . Main . fieldOfView ) , CameraCache . Main . nearClipPlane + 0.25f ) ;
477
+ #else
478
+ Mathf . Max ( 16.0f / CameraCache . Main . fieldOfView , CameraCache . Main . nearClipPlane + 0.25f ) ;
479
+ #endif // WINDOWS_UWP
480
+
474
481
Vector3 position = cameraTransform . position + ( cameraTransform . forward * windowDistance ) ;
475
482
Vector3 horizontalOffset = cameraTransform . right * windowOffset . x ;
476
483
Vector3 verticalOffset = cameraTransform . up * windowOffset . y ;
You can’t perform that action at this time.
0 commit comments