From 4791c32f63f493c0eec04542d25a9545e45a64d5 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Thu, 31 Oct 2024 20:49:51 +0900 Subject: [PATCH] Fix #834 --- example/src/camera/CameraTransitionManager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example/src/camera/CameraTransitionManager.js b/example/src/camera/CameraTransitionManager.js index bccfb8f71..4c9eacf3f 100644 --- a/example/src/camera/CameraTransitionManager.js +++ b/example/src/camera/CameraTransitionManager.js @@ -285,7 +285,10 @@ export class CameraTransitionManager extends EventDispatcher { const targetNearPlane = MathUtils.lerp( distToPersp + perspectiveCamera.near, distToOrtho + _orthographicCamera.near, alpha ); const targetFarPlane = MathUtils.lerp( distToPersp + perspectiveCamera.far, distToOrtho + _orthographicCamera.far, alpha ); - const planeDelta = targetFarPlane - targetNearPlane; + const planeDelta = Math.max( targetFarPlane, 0 ) - Math.max( targetNearPlane, 0 ); + + // NOTE: The "planeDelta * 1e-5" can wind up being larger than either of the camera near planes, resulting + // in some clipping during the transition phase. // update the camera state transitionCamera.aspect = perspectiveCamera.aspect;