{"size": 3173, "ext": "js", "max_stars_repo_path": "arcgis_js_api/library/4.11/esri/views/3d/terrain/SphericalTile.js", "max_stars_repo_name": "mozenberger/data-management-tools", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "arcgis_js_api/library/4.11/esri/views/3d/terrain/SphericalTile.js", "max_issues_repo_name": "mozenberger/data-management-tools", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "arcgis_js_api/library/4.11/esri/views/3d/terrain/SphericalTile.js", "max_forks_repo_name": "mozenberger/data-management-tools", "max_forks_repo_forks_event_min_datetime": "2019-05-23T17:30:34.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-23T17:30:34.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 352.5555555556, "max_line_length": 528, "alphanum_fraction": 0.7254963757}
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.11/esri/copyright.txt for details.
//>>built
define("require exports ../../../core/tsSupport/extendsHelper ../../../core/libs/gl-matrix-2/vec3 ../../../core/libs/gl-matrix-2/vec3f64 ../support/earthUtils ../support/geometryUtils ../support/mathUtils ./Tile ./TileGeometryFactory".split(" "),function(t,u,p,f,m,g,h,n,q,r){function k(f,d,a,b){a=g.earthRadius+a;var c=Math.cos(f);b[0]=Math.cos(d)*c*a;b[1]=Math.sin(d)*c*a;b[2]=Math.sin(f)*a}return function(l){function d(a,b,c){var e=l.call(this,d.NumSubdivisionsAtLevel)||this;e.obb=Array(8);e.isWebMercator=
!1;e.tileUp=m.vec3f64.create();for(var f=0;8>f;f++)e.obb[f]=m.vec3f64.create();void 0!==a&&e.init(a,b,c);return e}p(d,l);d.prototype.init=function(a,b,c){l.prototype.init.call(this,a,b,c);this.isWebMercator=c.tilingScheme.spatialReference.isWebMercator;b=this.extentWGS84Rad[0];c=this.extentWGS84Rad[1];var e=this.extentWGS84Rad[2],d=this.extentWGS84Rad[3];a=a[0];var h=n.lerp(c,d,.5),m=n.lerp(b,e,.5);this.edgeLen=(e-b)*Math.cos(0===a?0:Math.min(Math.abs(c),Math.abs(d)))*g.earthRadius;this.edgeLen2=
this.edgeLen*this.edgeLen;this.curvatureHeight=g.earthRadius-Math.sqrt(g.earthRadius*g.earthRadius-this.edgeLen2/4);k(h,m,0,this.centerAtSeaLevel);f.vec3.copy(this.tileUp,this.centerAtSeaLevel);f.vec3.normalize(this.tileUp,this.tileUp);this._updateOBB();this.updateRadiusAndCenter()};d.prototype.updateRadiusAndCenter=function(){if(0===this.lij[0])f.vec3.set(this.center,0,0,0),this.radius=g.earthRadius+this.elevationBounds[1];else{l.prototype.updateRadiusAndCenter.call(this);var a=Math.max(f.vec3.squaredDistance(this.center,
this.obb[0]),f.vec3.squaredDistance(this.center,this.obb[1]));this.radius=Math.sqrt(a)}};d.prototype._isVisible=function(){if(!this.intersectsClippingArea)return!1;var a=this.surface.frustum.planes;if(10>this.lij[0])return h.frustum.intersectsSphere(a,h.sphere.wrap(this.radius,this.center));for(var b=this.obb,c=0;6>c;c++){for(var e=void 0,e=0;8>e&&!h.plane.isPointOutside(a[c],b[e]);e++);if(8===e)return!1}return!0};d.prototype.computeElevationBounds=function(){l.prototype.computeElevationBounds.call(this);
this._updateOBB()};d.prototype.createGeometry=function(a,b,c){var e=this._isPole(this.lij[1],this.lij[0]);r.createSphericalGlobeTile(a,this.extent,this.extentWGS84Rad,this.isWebMercator,b,e,c,this.renderData);this.updateMemoryUsed()};d.prototype._updateOBB=function(){for(var a=this.extentWGS84Rad,b=this.obb,c=0;2>c;c++){var e=this.elevationBounds[c],d=4*c;k(a[1],a[0],e,b[d++]);k(a[3],a[0],e,b[d++]);k(a[3],a[2],e,b[d++]);k(a[1],a[2],e,b[d++])}this.isWebMercator&&(a=this._isPole(this.lij[1],this.lij[0]),
2===a?(f.vec3.set(b[1],0,0,g.earthRadius),f.vec3.set(b[2],0,0,g.earthRadius),f.vec3.set(b[5],0,0,g.earthRadius),f.vec3.set(b[6],0,0,g.earthRadius)):1===a&&(f.vec3.set(b[0],0,0,-g.earthRadius),f.vec3.set(b[3],0,0,-g.earthRadius),f.vec3.set(b[4],0,0,-g.earthRadius),f.vec3.set(b[7],0,0,-g.earthRadius)))};d.prototype._isPole=function(a,b){var c=0;a===(1<<b)-1&&(c+=1);0===a&&(c+=2);return c};d.NumSubdivisionsAtLevel=[128,64,32,16,16,8,8,4];return d}(q)});