2 lines
7.9 KiB
JavaScript
2 lines
7.9 KiB
JavaScript
|
define(["./AxisAlignedBoundingBox-07c6b7f2","./Matrix2-9aa31791","./when-4bbc8319","./TerrainEncoding-ba779f11","./IndexDatatype-b7d979a6","./ComponentDatatype-93750d1a","./RuntimeError-346a3079","./Transforms-d13cc04e","./WebMercatorProjection-58801a11","./createTaskProcessorWorker","./AttributeCompression-af389d04","./WebGLConstants-1c8239cc","./combine-83860057"],(function(e,t,r,i,n,o,a,s,d,c,h,u,I){"use strict";function l(){a.DeveloperError.throwInstantiationError()}Object.defineProperties(l.prototype,{errorEvent:{get:a.DeveloperError.throwInstantiationError},credit:{get:a.DeveloperError.throwInstantiationError},tilingScheme:{get:a.DeveloperError.throwInstantiationError},ready:{get:a.DeveloperError.throwInstantiationError},readyPromise:{get:a.DeveloperError.throwInstantiationError},hasWaterMask:{get:a.DeveloperError.throwInstantiationError},hasVertexNormals:{get:a.DeveloperError.throwInstantiationError},availability:{get:a.DeveloperError.throwInstantiationError}});var g=[];l.getRegularGridIndices=function(e,t){var i=g[e];r.defined(i)||(g[e]=i=[]);var n=i[t];return r.defined(n)||v(e,t,n=e*t<o.CesiumMath.SIXTY_FOUR_KILOBYTES?i[t]=new Uint16Array((e-1)*(t-1)*6):i[t]=new Uint32Array((e-1)*(t-1)*6),0),n};var m=[];l.getRegularGridIndicesAndEdgeIndices=function(e,t){var i=m[e];r.defined(i)||(m[e]=i=[]);var n=i[t];if(!r.defined(n)){var o=l.getRegularGridIndices(e,t),a=E(e,t),s=a.westIndicesSouthToNorth,d=a.southIndicesEastToWest,c=a.eastIndicesNorthToSouth,h=a.northIndicesWestToEast;n=i[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:d,eastIndicesNorthToSouth:c,northIndicesWestToEast:h}}return n};var T=[];function E(e,t){var r,i=new Array(t),n=new Array(e),o=new Array(t),a=new Array(e);for(r=0;r<e;++r)a[r]=r,n[r]=e*t-1-r;for(r=0;r<t;++r)o[r]=(r+1)*e-1,i[r]=(t-r-1)*e;return{westIndicesSouthToNorth:i,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:a}}function v(e,t,r,i){for(var n=0,o=0;o<t-1;++o){for(var a=0;a<e-1;++a){var s=n,d=s+e,c=d+1,h=s+1;r[i++]=s,r[i++]=d,r[i++]=h,r[i++]=h,r[i++]=d,r[i++]=c,++n}++n}}function p(e,t,r,i){for(var n=e[0],o=e.length,a=1;a<o;++a){var s=e[a];r[i++]=n,r[i++]=s,r[i++]=t,r[i++]=t,r[i++]=s,r[i++]=t+1,n=s,++t}return i}l.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){var i=T[e];r.defined(i)||(T[e]=i=[]);var o=i[t];if(!r.defined(o)){var a=e*t,s=(e-1)*(t-1)*6,d=2*e+2*t,c=a+d,h=s+6*Math.max(0,d-4),u=E(e,t),I=u.westIndicesSouthToNorth,g=u.southIndicesEastToWest,m=u.eastIndicesNorthToSouth,p=u.northIndicesWestToEast,f=n.IndexDatatype.createTypedArray(c,h);v(e,t,f,0),l.addSkirtIndices(I,g,m,p,a,f,s),o=i[t]={indices:f,westIndicesSouthToNorth:I,southIndicesEastToWest:g,eastIndicesNorthToSouth:m,northIndicesWestToEast:p,indexCountWithoutSkirts:s}}return o},l.addSkirtIndices=function(e,t,r,i,n,o,a){var s=n;a=p(e,s,o,a),a=p(t,s+=e.length,o,a),a=p(r,s+=t.length,o,a),p(i,s+=r.length,o,a)},l.heightmapTerrainQuality=.25,l.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*l.heightmapTerrainQuality/(t*r)},l.prototype.requestTileGeometry=a.DeveloperError.throwInstantiationError,l.prototype.getLevelMaximumGeometricError=a.DeveloperError.throwInstantiationError,l.prototype.getTileDataAvailable=a.DeveloperError.throwInstantiationError,l.prototype.loadTileDataAvailability=a.DeveloperError.throwInstantiationError;var f=32767,y=new t.Cartesian3,N=new t.Cartesian3,w=new t.Cartesian3,S=new t.Cartographic,M=new t.Cartesian2;function x(e,r,i,n,a,s,d,c,h){var u=Number.POSITIVE_INFINITY,I=a.north,l=a.south,g=a.east,m=a.west;g<m&&(g+=o.CesiumMath.TWO_PI);for(var T=e.length,E=0;E<T;++E){var v=e[E],p=i[v],f=n[v];S.longitude=o.CesiumMath.lerp(m,g,f.x),S.latitude=o.CesiumMath.lerp(l,I,f.y),S.height=p-r;var N=s.cartographicToCartesian(S,y);t.Matrix4.multiplyByPoint(d,N,N),t.Cartesian3.minimumByComponent(N,c,c),t.Cartesian3.maximumByComponent(N,h,h),u=Math.min(u,S.height)}return u}function b(e,t,i,n,a,s,c,h,u,I,l,g,m,T){var E=r.defined(c),v=u.north,p=u.south,f=u.east,N=u.west;f<N&&(f+=o.CesiumMath.TWO_PI);for(var w=i.length,x=0;x<w;++x)
|