Skip to content

Commit 7e30989

Browse files
committed
Access reversedDepth via getter
1 parent b67879b commit 7e30989

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

src/cameras/OrthographicCamera.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class OrthographicCamera extends Camera {
216216

217217
}
218218

219-
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem, this._reversedDepth );
219+
this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem, this.reversedDepth );
220220

221221
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
222222

src/cameras/PerspectiveCamera.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class PerspectiveCamera extends Camera {
374374
const skew = this.filmOffset;
375375
if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
376376

377-
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem, this._reversedDepth );
377+
this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem, this.reversedDepth );
378378

379379
this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
380380

src/helpers/CameraHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class CameraHelper extends LineSegments {
239239

240240
// Adjust z values based on coordinate system
241241

242-
if ( this.camera._reversedDepth === true ) {
242+
if ( this.camera.reversedDepth === true ) {
243243

244244
nearZ = 1;
245245
farZ = 0;

src/lights/LightShadow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ class LightShadow {
204204
shadowCamera.updateMatrixWorld();
205205

206206
_projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
207-
this._frustum.setFromProjectionMatrix( _projScreenMatrix, shadowCamera.coordinateSystem, shadowCamera._reversedDepth );
207+
this._frustum.setFromProjectionMatrix( _projScreenMatrix, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );
208208

209-
if ( shadowCamera._reversedDepth ) {
209+
if ( shadowCamera.reversedDepth ) {
210210

211211
shadowMatrix.set(
212212
0.5, 0.0, 0.0, 0.5,

src/lights/PointLightShadow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class PointLightShadow extends LightShadow {
108108
shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );
109109

110110
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
111-
this._frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera._reversedDepth );
111+
this._frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
112112

113113
}
114114

src/math/FrustumArray.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class FrustumArray {
5555
_frustum.setFromProjectionMatrix(
5656
_projScreenMatrix,
5757
camera.coordinateSystem,
58-
camera._reversedDepth
58+
camera.reversedDepth
5959
);
6060

6161
if ( _frustum.intersectsObject( object ) ) {
@@ -98,7 +98,7 @@ class FrustumArray {
9898
_frustum.setFromProjectionMatrix(
9999
_projScreenMatrix,
100100
camera.coordinateSystem,
101-
camera._reversedDepth
101+
camera.reversedDepth
102102
);
103103

104104
if ( _frustum.intersectsSprite( sprite ) ) {
@@ -141,7 +141,7 @@ class FrustumArray {
141141
_frustum.setFromProjectionMatrix(
142142
_projScreenMatrix,
143143
camera.coordinateSystem,
144-
camera._reversedDepth
144+
camera.reversedDepth
145145
);
146146

147147
if ( _frustum.intersectsSphere( sphere ) ) {
@@ -184,7 +184,7 @@ class FrustumArray {
184184
_frustum.setFromProjectionMatrix(
185185
_projScreenMatrix,
186186
camera.coordinateSystem,
187-
camera._reversedDepth
187+
camera.reversedDepth
188188
);
189189

190190
if ( _frustum.intersectsBox( box ) ) {
@@ -227,7 +227,7 @@ class FrustumArray {
227227
_frustum.setFromProjectionMatrix(
228228
_projScreenMatrix,
229229
camera.coordinateSystem,
230-
camera._reversedDepth
230+
camera.reversedDepth
231231
);
232232

233233
if ( _frustum.containsPoint( point ) ) {

src/objects/BatchedMesh.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ class BatchedMesh extends Mesh {
15331533
_frustum.setFromProjectionMatrix(
15341534
_matrix,
15351535
camera.coordinateSystem,
1536-
camera._reversedDepth
1536+
camera.reversedDepth
15371537
);
15381538

15391539
}

src/renderers/WebGLRenderer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ class WebGLRenderer {
15561556
renderStateStack.push( currentRenderState );
15571557

15581558
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
1559-
_frustum.setFromProjectionMatrix( _projScreenMatrix, WebGLCoordinateSystem, camera._reversedDepth );
1559+
_frustum.setFromProjectionMatrix( _projScreenMatrix, WebGLCoordinateSystem, camera.reversedDepth );
15601560

15611561
_localClippingEnabled = this.localClippingEnabled;
15621562
_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled );
@@ -2381,7 +2381,7 @@ class WebGLRenderer {
23812381

23822382
const reversedDepthBuffer = state.buffers.depth.getReversed();
23832383

2384-
if ( reversedDepthBuffer && camera._reversedDepth !== true ) {
2384+
if ( reversedDepthBuffer && camera.reversedDepth !== true ) {
23852385

23862386
camera._reversedDepth = true;
23872387
camera.updateProjectionMatrix();

src/renderers/common/Renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ class Renderer {
14121412
if ( ! camera.isArrayCamera ) {
14131413

14141414
_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
1415-
frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera._reversedDepth );
1415+
frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
14161416

14171417
}
14181418

0 commit comments

Comments
 (0)