/** * Cesium - https://github.com/CesiumGS/cesium * * Copyright 2011-2020 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details. */ define(["./when-8d13db60","./Check-70bec281","./Math-61ede240","./Cartographic-f27b0939","./Cartesian2-09435a6c","./BoundingSphere-c409f092","./Cartesian4-5af5bb24","./RuntimeError-ba10bc3e","./WebGLConstants-4c11ee5f","./ComponentDatatype-5862616f","./FeatureDetection-7bd32c34","./Transforms-1509c877","./buildModuleUrl-392763e2","./AttributeCompression-75ce15eb","./IndexDatatype-9435b55f","./IntersectionTests-dbfba52c","./Plane-2bcb9154","./WebMercatorProjection-bc9aa7fe","./createTaskProcessorWorker","./EllipsoidTangentPlane-9c25b2da","./OrientedBoundingBox-7b25e901","./TerrainEncoding-3dab0ca0"],function(Te,f,pe,ve,Ee,ye,e,t,r,i,n,we,o,be,Ne,a,s,Me,d,Ce,xe,Se){function Ae(){f.DeveloperError.throwInstantiationError()}Object.defineProperties(Ae.prototype,{errorEvent:{get:f.DeveloperError.throwInstantiationError},credit:{get:f.DeveloperError.throwInstantiationError},tilingScheme:{get:f.DeveloperError.throwInstantiationError},ready:{get:f.DeveloperError.throwInstantiationError},readyPromise:{get:f.DeveloperError.throwInstantiationError},hasWaterMask:{get:f.DeveloperError.throwInstantiationError},hasVertexNormals:{get:f.DeveloperError.throwInstantiationError},availability:{get:f.DeveloperError.throwInstantiationError}});var h=[];Ae.getRegularGridIndices=function(e,t){if(e*t>=pe.CesiumMath.FOUR_GIGABYTES)throw new f.DeveloperError("The total number of vertices (width * height) must be less than 4,294,967,296.");var r=h[e];Te.defined(r)||(h[e]=r=[]);var i=r[t];return Te.defined(i)||v(e,t,i=e*t=pe.CesiumMath.FOUR_GIGABYTES)throw new f.DeveloperError("The total number of vertices (width * height) must be less than 4,294,967,296.");var r=h[e];Te.defined(r)||(h[e]=r=[]);var i=r[t];return Te.defined(i)||v(e,t,i=e*t=pe.CesiumMath.FOUR_GIGABYTES)throw new f.DeveloperError("The total number of vertices (width * height) must be less than 4,294,967,296.");var r=c[e];Te.defined(r)||(c[e]=r=[]);var i=r[t];if(!Te.defined(i)){var n=Ae.getRegularGridIndices(e,t),o=p(e,t),a=o.westIndicesSouthToNorth,s=o.southIndicesEastToWest,d=o.eastIndicesNorthToSouth,h=o.northIndicesWestToEast;i=r[t]={indices:n,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:d,northIndicesWestToEast:h}}return i};var T=[];function p(e,t){var r,i=new Array(t),n=new Array(e),o=new Array(t),a=new Array(e);for(r=0;r=pe.CesiumMath.FOUR_GIGABYTES)throw new f.DeveloperError("The total number of vertices (width * height) must be less than 4,294,967,296.");var r=T[e];Te.defined(r)||(T[e]=r=[]);var i=r[t];if(!Te.defined(i)){var n=e*t,o=(e-1)*(t-1)*6,a=2*e+2*t,s=n+a,d=3*(e+t-2),h=o+6*Math.max(0,a-4)+d,c=p(e,t),u=c.westIndicesSouthToNorth,l=c.southIndicesEastToWest,I=c.eastIndicesNorthToSouth,m=c.northIndicesWestToEast,g=Ne.IndexDatatype.createTypedArray(s,h);v(e,t,g,0),Ae.addSkirtIndices(u,l,I,m,n,g,o+d),i=r[t]={indices:g,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i},Ae.addSkirtIndices=function(e,t,r,i,n,o,a,s){var d=n;a=u(e,d,o,a,s),a=u(t,d+=e.length,o,a,s),a=u(r,d+=t.length,o,a,s),u(i,d+=r.length,o,a,s)},Ae.heightmapTerrainQuality=.25,Ae.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*Ae.heightmapTerrainQuality/(t*r)},Ae.prototype.requestTileGeometry=f.DeveloperError.throwInstantiationError,Ae.prototype.getLevelMaximumGeometricError=f.DeveloperError.throwInstantiationError,Ae.prototype.getTileDataAvailable=f.DeveloperError.throwInstantiationError,Ae.prototype.loadTileDataAvailability=f.DeveloperError.throwInstantiationError;var Pe=32767,_e=new ve.Cartesian3,Fe=new ve.Cartesian3,Be=new ve.Cartesian3,De=new ve.Cartographic,We=new Ee.Cartesian2,Ge=new ve.Cartesian3,Oe=new ye.Matrix4,Ye=new ye.Matrix4;function ke(e,t,r,i,n,o,a,s,d){var h=Number.POSITIVE_INFINITY,c=n.north,u=n.south,l=n.east,I=n.west;l