Skip to content

Commit

Permalink
use epsilon instead of zero for minimal near plane distance
Browse files Browse the repository at this point in the history
  • Loading branch information
UX3D-labode committed Nov 6, 2020
1 parent f9f48e4 commit bc8893f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/user_camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class UserCamera extends gltfCamera
let zNear = this.zoom - (longestDistance * 0.6);
let zFar = this.zoom + (longestDistance * 0.6);

zNear = Math.max(zNear, 0.0); // should not be negative
zNear = Math.max(zNear, Number.EPSILON); // should not be negative
zFar = Math.abs(zFar);

this.znear = zNear;
Expand Down

0 comments on commit bc8893f

Please sign in to comment.