// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../../core/mathUtils ../../../core/unitUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/ellipsoidUtils ../../../geometry/Extent ../../ViewingMode ../environment/atmosphereUtils".split(" "),function(p,n,u,l,q,r,v,w,x){function t(c,b,a,d){a=2/a;c/b>a?(d.far=c,d.near=d.far/b):(d.near=a,d.far=d.near*b);return d}class y{constructor(c,b){this._elevationProvider=c;this._referenceEllipsoid=r.getReferenceEllipsoid(b);this._unitInMeters=u.getMetersPerUnitForSR(b, this._referenceEllipsoid.metersPerDegree)}compute(c,b,a,d,m){m||={near:0,far:0};var e=c[2]*this._unitInMeters,g=e;d=e-d;var h=this._elevationProvider?.visibleElevationBounds;h&&(e=0<=d?g-this._unitInMeters*h.min:this._unitInMeters*h.max-g);a=null!=a?a:new v({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});g=Math.max(a.xmax-a.xmin,a.ymax-a.ymin,4*Math.max(a.xmax-a.xmin,a.ymax-a.ymin));l.subtract(f,b,c);k[0]=0