|
@@ -21370,14 +21370,6 @@ class Camera extends Object3D {
|
|
|
|
|
|
|
|
this.type = 'Camera';
|
|
this.type = 'Camera';
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * The flag that indicates whether the camera uses a reversed depth buffer.
|
|
|
|
|
- *
|
|
|
|
|
- * @type {boolean}
|
|
|
|
|
- * @default false
|
|
|
|
|
- */
|
|
|
|
|
- this.reversedDepth = false;
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* The inverse of the camera's world matrix.
|
|
* The inverse of the camera's world matrix.
|
|
|
*
|
|
*
|
|
@@ -21406,6 +21398,20 @@ class Camera extends Object3D {
|
|
|
*/
|
|
*/
|
|
|
this.coordinateSystem = WebGLCoordinateSystem;
|
|
this.coordinateSystem = WebGLCoordinateSystem;
|
|
|
|
|
|
|
|
|
|
+ this._reversedDepth = false;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The flag that indicates whether the camera uses a reversed depth buffer.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {boolean}
|
|
|
|
|
+ * @default false
|
|
|
|
|
+ */
|
|
|
|
|
+ get reversedDepth() {
|
|
|
|
|
+
|
|
|
|
|
+ return this._reversedDepth;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
copy( source, recursive ) {
|
|
copy( source, recursive ) {
|
|
@@ -26641,7 +26647,8 @@ class FrustumArray {
|
|
|
|
|
|
|
|
_frustum$1.setFromProjectionMatrix(
|
|
_frustum$1.setFromProjectionMatrix(
|
|
|
_projScreenMatrix$2,
|
|
_projScreenMatrix$2,
|
|
|
- this.coordinateSystem
|
|
|
|
|
|
|
+ camera.coordinateSystem,
|
|
|
|
|
+ camera.reversedDepth
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if ( _frustum$1.intersectsObject( object ) ) {
|
|
if ( _frustum$1.intersectsObject( object ) ) {
|
|
@@ -26683,7 +26690,8 @@ class FrustumArray {
|
|
|
|
|
|
|
|
_frustum$1.setFromProjectionMatrix(
|
|
_frustum$1.setFromProjectionMatrix(
|
|
|
_projScreenMatrix$2,
|
|
_projScreenMatrix$2,
|
|
|
- this.coordinateSystem
|
|
|
|
|
|
|
+ camera.coordinateSystem,
|
|
|
|
|
+ camera.reversedDepth
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if ( _frustum$1.intersectsSprite( sprite ) ) {
|
|
if ( _frustum$1.intersectsSprite( sprite ) ) {
|
|
@@ -26725,7 +26733,8 @@ class FrustumArray {
|
|
|
|
|
|
|
|
_frustum$1.setFromProjectionMatrix(
|
|
_frustum$1.setFromProjectionMatrix(
|
|
|
_projScreenMatrix$2,
|
|
_projScreenMatrix$2,
|
|
|
- this.coordinateSystem
|
|
|
|
|
|
|
+ camera.coordinateSystem,
|
|
|
|
|
+ camera.reversedDepth
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if ( _frustum$1.intersectsSphere( sphere ) ) {
|
|
if ( _frustum$1.intersectsSphere( sphere ) ) {
|
|
@@ -26767,7 +26776,8 @@ class FrustumArray {
|
|
|
|
|
|
|
|
_frustum$1.setFromProjectionMatrix(
|
|
_frustum$1.setFromProjectionMatrix(
|
|
|
_projScreenMatrix$2,
|
|
_projScreenMatrix$2,
|
|
|
- this.coordinateSystem
|
|
|
|
|
|
|
+ camera.coordinateSystem,
|
|
|
|
|
+ camera.reversedDepth
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if ( _frustum$1.intersectsBox( box ) ) {
|
|
if ( _frustum$1.intersectsBox( box ) ) {
|
|
@@ -26809,7 +26819,8 @@ class FrustumArray {
|
|
|
|
|
|
|
|
_frustum$1.setFromProjectionMatrix(
|
|
_frustum$1.setFromProjectionMatrix(
|
|
|
_projScreenMatrix$2,
|
|
_projScreenMatrix$2,
|
|
|
- this.coordinateSystem
|
|
|
|
|
|
|
+ camera.coordinateSystem,
|
|
|
|
|
+ camera.reversedDepth
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if ( _frustum$1.containsPoint( point ) ) {
|
|
if ( _frustum$1.containsPoint( point ) ) {
|
|
@@ -28354,9 +28365,11 @@ class BatchedMesh extends Mesh {
|
|
|
_matrix$1
|
|
_matrix$1
|
|
|
.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
|
|
.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
|
|
|
.multiply( this.matrixWorld );
|
|
.multiply( this.matrixWorld );
|
|
|
|
|
+
|
|
|
_frustum.setFromProjectionMatrix(
|
|
_frustum.setFromProjectionMatrix(
|
|
|
_matrix$1,
|
|
_matrix$1,
|
|
|
- renderer.coordinateSystem
|
|
|
|
|
|
|
+ camera.coordinateSystem,
|
|
|
|
|
+ camera.reversedDepth
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -45222,7 +45235,7 @@ class LightShadow {
|
|
|
shadowCamera.updateMatrixWorld();
|
|
shadowCamera.updateMatrixWorld();
|
|
|
|
|
|
|
|
_projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
|
|
_projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
|
|
|
- this._frustum.setFromProjectionMatrix( _projScreenMatrix$1 );
|
|
|
|
|
|
|
+ this._frustum.setFromProjectionMatrix( _projScreenMatrix$1, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );
|
|
|
|
|
|
|
|
if ( shadowCamera.reversedDepth ) {
|
|
if ( shadowCamera.reversedDepth ) {
|
|
|
|
|
|
|
@@ -45699,7 +45712,7 @@ class PointLightShadow extends LightShadow {
|
|
|
shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );
|
|
shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );
|
|
|
|
|
|
|
|
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
|
|
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
|
|
|
- this._frustum.setFromProjectionMatrix( _projScreenMatrix );
|
|
|
|
|
|
|
+ this._frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -57255,34 +57268,34 @@ class CameraHelper extends LineSegments {
|
|
|
|
|
|
|
|
// near
|
|
// near
|
|
|
|
|
|
|
|
- setPoint( 'n1', pointMap, geometry, _camera, - w, - h, nearZ );
|
|
|
|
|
- setPoint( 'n2', pointMap, geometry, _camera, w, - h, nearZ );
|
|
|
|
|
- setPoint( 'n3', pointMap, geometry, _camera, - w, h, nearZ );
|
|
|
|
|
|
|
+ setPoint( 'n1', pointMap, geometry, _camera, -1, -1, nearZ );
|
|
|
|
|
+ setPoint( 'n2', pointMap, geometry, _camera, w, -1, nearZ );
|
|
|
|
|
+ setPoint( 'n3', pointMap, geometry, _camera, -1, h, nearZ );
|
|
|
setPoint( 'n4', pointMap, geometry, _camera, w, h, nearZ );
|
|
setPoint( 'n4', pointMap, geometry, _camera, w, h, nearZ );
|
|
|
|
|
|
|
|
// far
|
|
// far
|
|
|
|
|
|
|
|
- setPoint( 'f1', pointMap, geometry, _camera, - w, - h, farZ );
|
|
|
|
|
- setPoint( 'f2', pointMap, geometry, _camera, w, - h, farZ );
|
|
|
|
|
- setPoint( 'f3', pointMap, geometry, _camera, - w, h, farZ );
|
|
|
|
|
|
|
+ setPoint( 'f1', pointMap, geometry, _camera, -1, -1, farZ );
|
|
|
|
|
+ setPoint( 'f2', pointMap, geometry, _camera, w, -1, farZ );
|
|
|
|
|
+ setPoint( 'f3', pointMap, geometry, _camera, -1, h, farZ );
|
|
|
setPoint( 'f4', pointMap, geometry, _camera, w, h, farZ );
|
|
setPoint( 'f4', pointMap, geometry, _camera, w, h, farZ );
|
|
|
|
|
|
|
|
// up
|
|
// up
|
|
|
|
|
|
|
|
setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, nearZ );
|
|
setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, nearZ );
|
|
|
- setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, nearZ );
|
|
|
|
|
|
|
+ setPoint( 'u2', pointMap, geometry, _camera, -1 * 0.7, h * 1.1, nearZ );
|
|
|
setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, nearZ );
|
|
setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, nearZ );
|
|
|
|
|
|
|
|
// cross
|
|
// cross
|
|
|
|
|
|
|
|
- setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, farZ );
|
|
|
|
|
|
|
+ setPoint( 'cf1', pointMap, geometry, _camera, -1, 0, farZ );
|
|
|
setPoint( 'cf2', pointMap, geometry, _camera, w, 0, farZ );
|
|
setPoint( 'cf2', pointMap, geometry, _camera, w, 0, farZ );
|
|
|
- setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, farZ );
|
|
|
|
|
|
|
+ setPoint( 'cf3', pointMap, geometry, _camera, 0, -1, farZ );
|
|
|
setPoint( 'cf4', pointMap, geometry, _camera, 0, h, farZ );
|
|
setPoint( 'cf4', pointMap, geometry, _camera, 0, h, farZ );
|
|
|
|
|
|
|
|
- setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, nearZ );
|
|
|
|
|
|
|
+ setPoint( 'cn1', pointMap, geometry, _camera, -1, 0, nearZ );
|
|
|
setPoint( 'cn2', pointMap, geometry, _camera, w, 0, nearZ );
|
|
setPoint( 'cn2', pointMap, geometry, _camera, w, 0, nearZ );
|
|
|
- setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, nearZ );
|
|
|
|
|
|
|
+ setPoint( 'cn3', pointMap, geometry, _camera, 0, -1, nearZ );
|
|
|
setPoint( 'cn4', pointMap, geometry, _camera, 0, h, nearZ );
|
|
setPoint( 'cn4', pointMap, geometry, _camera, 0, h, nearZ );
|
|
|
|
|
|
|
|
geometry.getAttribute( 'position' ).needsUpdate = true;
|
|
geometry.getAttribute( 'position' ).needsUpdate = true;
|
|
@@ -74983,7 +74996,7 @@ class WebGLRenderer {
|
|
|
renderStateStack.push( currentRenderState );
|
|
renderStateStack.push( currentRenderState );
|
|
|
|
|
|
|
|
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
|
|
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
|
|
|
- _frustum.setFromProjectionMatrix( _projScreenMatrix );
|
|
|
|
|
|
|
+ _frustum.setFromProjectionMatrix( _projScreenMatrix, WebGLCoordinateSystem, camera.reversedDepth );
|
|
|
|
|
|
|
|
_localClippingEnabled = this.localClippingEnabled;
|
|
_localClippingEnabled = this.localClippingEnabled;
|
|
|
_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled );
|
|
_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled );
|
|
@@ -75810,7 +75823,7 @@ class WebGLRenderer {
|
|
|
|
|
|
|
|
if ( reversedDepthBuffer && camera.reversedDepth !== true ) {
|
|
if ( reversedDepthBuffer && camera.reversedDepth !== true ) {
|
|
|
|
|
|
|
|
- camera.reversedDepth = true;
|
|
|
|
|
|
|
+ camera._reversedDepth = true;
|
|
|
camera.updateProjectionMatrix();
|
|
camera.updateProjectionMatrix();
|
|
|
|
|
|
|
|
}
|
|
}
|