فهرست منبع

Src: Update Calling Args to Support Reversed Depth (#31508)

* Update calling args
WestLangley 5 ماه پیش
والد
کامیت
ec43e8d493

+ 1 - 1
src/lights/LightShadow.js

@@ -204,7 +204,7 @@ class LightShadow {
 		shadowCamera.updateMatrixWorld();
 
 		_projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
-		this._frustum.setFromProjectionMatrix( _projScreenMatrix );
+		this._frustum.setFromProjectionMatrix( _projScreenMatrix, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );
 
 		if ( shadowCamera.reversedDepth ) {
 

+ 1 - 1
src/lights/PointLightShadow.js

@@ -108,7 +108,7 @@ class PointLightShadow extends LightShadow {
 		shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );
 
 		_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
-		this._frustum.setFromProjectionMatrix( _projScreenMatrix );
+		this._frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
 
 	}
 

+ 10 - 5
src/math/FrustumArray.js

@@ -54,7 +54,8 @@ class FrustumArray {
 
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix,
-				this.coordinateSystem
+				camera.coordinateSystem,
+				camera.reversedDepth
 			);
 
 			if ( _frustum.intersectsObject( object ) ) {
@@ -96,7 +97,8 @@ class FrustumArray {
 
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix,
-				this.coordinateSystem
+				camera.coordinateSystem,
+				camera.reversedDepth
 			);
 
 			if ( _frustum.intersectsSprite( sprite ) ) {
@@ -138,7 +140,8 @@ class FrustumArray {
 
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix,
-				this.coordinateSystem
+				camera.coordinateSystem,
+				camera.reversedDepth
 			);
 
 			if ( _frustum.intersectsSphere( sphere ) ) {
@@ -180,7 +183,8 @@ class FrustumArray {
 
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix,
-				this.coordinateSystem
+				camera.coordinateSystem,
+				camera.reversedDepth
 			);
 
 			if ( _frustum.intersectsBox( box ) ) {
@@ -222,7 +226,8 @@ class FrustumArray {
 
 			_frustum.setFromProjectionMatrix(
 				_projScreenMatrix,
-				this.coordinateSystem
+				camera.coordinateSystem,
+				camera.reversedDepth
 			);
 
 			if ( _frustum.containsPoint( point ) ) {

+ 3 - 1
src/objects/BatchedMesh.js

@@ -1529,9 +1529,11 @@ class BatchedMesh extends Mesh {
 			_matrix
 				.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
 				.multiply( this.matrixWorld );
+
 			_frustum.setFromProjectionMatrix(
 				_matrix,
-				renderer.coordinateSystem
+				camera.coordinateSystem,
+				camera.reversedDepth
 			);
 
 		}

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -1556,7 +1556,7 @@ class WebGLRenderer {
 			renderStateStack.push( currentRenderState );
 
 			_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
-			_frustum.setFromProjectionMatrix( _projScreenMatrix );
+			_frustum.setFromProjectionMatrix( _projScreenMatrix, WebGLCoordinateSystem, camera.reversedDepth );
 
 			_localClippingEnabled = this.localClippingEnabled;
 			_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled );

+ 1 - 1
src/renderers/common/Renderer.js

@@ -1412,7 +1412,7 @@ class Renderer {
 		if ( ! camera.isArrayCamera ) {
 
 			_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
-			frustum.setFromProjectionMatrix( _projScreenMatrix, coordinateSystem );
+			frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
 
 		}
 

粤ICP备19079148号