Skip to content

Commit

Permalink
Merge pull request #1386 from xeokit/extend-default-far-clip
Browse files Browse the repository at this point in the history
Change default far plane distance from 2000 to 10000
  • Loading branch information
xeolabs authored Feb 28, 2024
2 parents a75d947 + 877cbc1 commit cff27a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/viewer/scene/camera/Ortho.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Ortho extends Component {
inverseMatrix: math.mat4(),
transposedMatrix: math.mat4(),
near: 0.1,
far: 2000.0
far: 10000.0
});

this._inverseMatrixDirty = true;
Expand Down Expand Up @@ -168,12 +168,12 @@ class Ortho extends Component {
*
* Fires a "far" event on change.
*
* Default value is ````2000.0````.
* Default value is ````10000.0````.
*
* @param {Number} value New far ortho plane position.
*/
set far(value) {
const far = (value !== undefined && value !== null) ? value : 2000.0;
const far = (value !== undefined && value !== null) ? value : 10000.0;
if (this._state.far === far) {
return;
}
Expand Down
8 changes: 6 additions & 2 deletions src/viewer/scene/camera/Perspective.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Perspective extends Component {
inverseMatrix: math.mat4(),
transposedMatrix: math.mat4(),
near: 0.1,
far: 2000.0
far: 10000.0
});

this._inverseMatrixDirty = true;
Expand Down Expand Up @@ -190,10 +190,12 @@ class Perspective extends Component {
*
* Fires a "far" event on change.
*
* Default value is ````10000.0````.
*
* @param {Number} value New Perspective far plane position.
*/
set far(value) {
const far = (value !== undefined && value !== null) ? value : 2000.0;
const far = (value !== undefined && value !== null) ? value : 10000.0;
if (this._state.far === far) {
return;
}
Expand All @@ -205,6 +207,8 @@ class Perspective extends Component {
/**
* Gets the position of this Perspective's far plane on the positive View-space Z-axis.
*
* Default value is ````10000.0````.
*
* @return {Number} The Perspective's far plane position.
*/
get far() {
Expand Down

0 comments on commit cff27a8

Please sign in to comment.