2 lines
8.8 KiB
JavaScript
2 lines
8.8 KiB
JavaScript
|
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-e66fad2a","./Cartesian2-44433f55","./Transforms-d9350502","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./AttributeCompression-170b3be0","./IndexDatatype-66caba23","./IntersectionTests-d04ec592","./Plane-94f78648","./WebMercatorProjection-c689ba4a","./createTaskProcessorWorker","./EllipsoidTangentPlane-d3a474ef","./OrientedBoundingBox-433a61d3","./TerrainEncoding-9e39caa9"],function(Te,e,pe,Ee,ye,t,r,n,fe,ve,i,o,Ne,a,we,xe,Me){"use strict";function Ce(){e.DeveloperError.throwInstantiationError()}Object.defineProperties(Ce.prototype,{errorEvent:{get:e.DeveloperError.throwInstantiationError},credit:{get:e.DeveloperError.throwInstantiationError},tilingScheme:{get:e.DeveloperError.throwInstantiationError},ready:{get:e.DeveloperError.throwInstantiationError},readyPromise:{get:e.DeveloperError.throwInstantiationError},hasWaterMask:{get:e.DeveloperError.throwInstantiationError},hasVertexNormals:{get:e.DeveloperError.throwInstantiationError},availability:{get:e.DeveloperError.throwInstantiationError}});var s=[];Ce.getRegularGridIndices=function(e,t){var r=s[e];Te.defined(r)||(s[e]=r=[]);var n=r[t];return Te.defined(n)||p(e,t,n=e*t<pe.CesiumMath.SIXTY_FOUR_KILOBYTES?r[t]=new Uint16Array((e-1)*(t-1)*6):r[t]=new Uint32Array((e-1)*(t-1)*6),0),n};var u=[];Ce.getRegularGridIndicesAndEdgeIndices=function(e,t){var r=u[e];Te.defined(r)||(u[e]=r=[]);var n,i,o,a,s,d,c=r[t];return Te.defined(c)||(n=Ce.getRegularGridIndices(e,t),o=(i=T(e,t)).westIndicesSouthToNorth,a=i.southIndicesEastToWest,s=i.eastIndicesNorthToSouth,d=i.northIndicesWestToEast,c=r[t]={indices:n,westIndicesSouthToNorth:o,southIndicesEastToWest:a,eastIndicesNorthToSouth:s,northIndicesWestToEast:d}),c};var g=[];function T(e,t){for(var r=new Array(t),n=new Array(e),i=new Array(t),o=new Array(e),a=0;a<e;++a)n[o[a]=a]=e*t-1-a;for(a=0;a<t;++a)i[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:i,northIndicesWestToEast:o}}function p(e,t,r,n){for(var i=0,o=0;o<t-1;++o){for(var a=0;a<e-1;++a){var s=i+e,d=s+1,c=i+1;r[n++]=i,r[n++]=s,r[n++]=c,r[n++]=c,r[n++]=s,r[n++]=d,++i}++i}}function d(e,t,r,n){for(var i=e[0],o=e.length,a=1;a<o;++a){var s=e[a];r[n++]=i,r[n++]=s,r[n++]=t,r[n++]=t,r[n++]=s,r[n++]=t+1,i=s,++t}return n}Ce.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){var r=g[e];Te.defined(r)||(g[e]=r=[]);var n,i,o,a,s,d,c,u,h,l,I,m=r[t];return Te.defined(m)||(a=(n=e*t)+(o=2*e+2*t),s=(i=(e-1)*(t-1)*6)+6*Math.max(0,o-4),c=(d=T(e,t)).westIndicesSouthToNorth,u=d.southIndicesEastToWest,h=d.eastIndicesNorthToSouth,l=d.northIndicesWestToEast,p(e,t,I=ve.IndexDatatype.createTypedArray(a,s),0),Ce.addSkirtIndices(c,u,h,l,n,I,i),m=r[t]={indices:I,westIndicesSouthToNorth:c,southIndicesEastToWest:u,eastIndicesNorthToSouth:h,northIndicesWestToEast:l,indexCountWithoutSkirts:i}),m},Ce.addSkirtIndices=function(e,t,r,n,i,o,a){var s=i;a=d(e,s,o,a),a=d(t,s+=e.length,o,a),a=d(r,s+=t.length,o,a),d(n,s+=r.length,o,a)},Ce.heightmapTerrainQuality=.25,Ce.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*Ce.heightmapTerrainQuality/(t*r)},Ce.prototype.requestTileGeometry=e.DeveloperError.throwInstantiationError,Ce.prototype.getLevelMaximumGeometricError=e.DeveloperError.throwInstantiationError,Ce.prototype.getTileDataAvailable=e.DeveloperError.throwInstantiationError,Ce.prototype.loadTileDataAvailability=e.DeveloperError.throwInstantiationError;var be=32767,Se=new Ee.Cartesian3,Ae=new Ee.Cartesian3,Pe=new Ee.Cartesian3,We=new Ee.Cartographic,De=new Ee.Cartesian2,Be=new Ee.Cartesian3,Fe=new ye.Matrix4,ke=new ye.Matrix4;function Ve(e,t,r,n,i,o,a,s,d){var c=Number.POSITIVE_INFINITY,u=i.north,h=i.south,l=i.east,I=i.west;l<I&&(l+=pe.CesiumMath.TWO_PI);for(var m=e.length,g=0;g<m;++g){var T=e[g],p=r[T],E=n[T];We.longitude=pe.CesiumMath.lerp(I,l,E.x),We.latitude=pe.CesiumMath.lerp(h,u,E.y),We.height=p-t;var y=o.cartographicToCartesian(We,Se);ye.Matrix4.multiplyByPoint(a,y,y),Ee.Cartesian3.minimumByComponent(y,s,
|