integrated_traffic_vue/public/lib/Cesium/Workers/createVerticesFromQuantized...

2 lines
8.1 KiB
JavaScript
Raw Normal View History

2024-01-31 09:03:02 +08:00
define(["./AxisAlignedBoundingBox-c7183545","./Matrix2-163b5a1d","./Matrix3-b6f074fa","./defaultValue-0a909f67","./TerrainEncoding-01618fc4","./IndexDatatype-2149f06c","./Math-e97915da","./Transforms-713aa3a8","./WebMercatorProjection-8e29b101","./createTaskProcessorWorker","./RuntimeError-06c93819","./AttributeCompression-e18a879a","./ComponentDatatype-77274976","./WebGLConstants-a8cc3e8c","./combine-ca22a614"],(function(e,t,r,n,o,i,a,s,c,d,h,u,l,I,g){"use strict";function m(){s.DeveloperError.throwInstantiationError()}Object.defineProperties(m.prototype,{errorEvent:{get:s.DeveloperError.throwInstantiationError},credit:{get:s.DeveloperError.throwInstantiationError},tilingScheme:{get:s.DeveloperError.throwInstantiationError},ready:{get:s.DeveloperError.throwInstantiationError},readyPromise:{get:s.DeveloperError.throwInstantiationError},hasWaterMask:{get:s.DeveloperError.throwInstantiationError},hasVertexNormals:{get:s.DeveloperError.throwInstantiationError},availability:{get:s.DeveloperError.throwInstantiationError}});const T=[];m.getRegularGridIndices=function(e,t){let r=T[e];n.defined(r)||(T[e]=r=[]);let o=r[t];return n.defined(o)||(o=e*t<a.CesiumMath.SIXTY_FOUR_KILOBYTES?r[t]=new Uint16Array((e-1)*(t-1)*6):r[t]=new Uint32Array((e-1)*(t-1)*6),y(e,t,o,0)),o};const E=[];m.getRegularGridIndicesAndEdgeIndices=function(e,t){let r=E[e];n.defined(r)||(E[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=m.getRegularGridIndices(e,t),i=p(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,d=i.northIndicesWestToEast;o=r[t]={indices:n,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return o};const f=[];function p(e,t){const r=new Array(t),n=new Array(e),o=new Array(t),i=new Array(e);let a;for(a=0;a<e;++a)i[a]=a,n[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,r[a]=(t-a-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:i}}function y(e,t,r,n){let o=0;for(let i=0;i<t-1;++i){for(let t=0;t<e-1;++t){const t=o,i=t+e,a=i+1,s=t+1;r[n++]=t,r[n++]=i,r[n++]=s,r[n++]=s,r[n++]=i,r[n++]=a,++o}++o}}function N(e,t,r,n){let o=e[0];const i=e.length;for(let a=1;a<i;++a){const i=e[a];r[n++]=o,r[n++]=i,r[n++]=t,r[n++]=t,r[n++]=i,r[n++]=t+1,o=i,++t}return n}m.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let r=f[e];n.defined(r)||(f[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=e*t,a=(e-1)*(t-1)*6,s=2*e+2*t,c=n+s,d=a+6*Math.max(0,s-4),h=p(e,t),u=h.westIndicesSouthToNorth,l=h.southIndicesEastToWest,I=h.eastIndicesNorthToSouth,g=h.northIndicesWestToEast,T=i.IndexDatatype.createTypedArray(c,d);y(e,t,T,0),m.addSkirtIndices(u,l,I,g,n,T,a),o=r[t]={indices:T,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:g,indexCountWithoutSkirts:a}}return o},m.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=N(e,s,i,a),s+=e.length,a=N(t,s,i,a),s+=t.length,a=N(r,s,i,a),s+=r.length,N(n,s,i,a)},m.heightmapTerrainQuality=.25,m.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*m.heightmapTerrainQuality/(t*r)},m.prototype.requestTileGeometry=s.DeveloperError.throwInstantiationError,m.prototype.getLevelMaximumGeometricError=s.DeveloperError.throwInstantiationError,m.prototype.getTileDataAvailable=s.DeveloperError.throwInstantiationError,m.prototype.loadTileDataAvailability=s.DeveloperError.throwInstantiationError;const w=32767,M=new r.Cartesian3,S=new r.Cartesian3,x=new r.Cartesian3,b=new r.Cartographic,A=new t.Cartesian2;function C(e,n,o,i,s,c,d,h,u){let l=Number.POSITIVE_INFINITY;const I=s.north,g=s.south;let m=s.east;const T=s.west;m<T&&(m+=a.CesiumMath.TWO_PI);const E=e.length;for(let s=0;s<E;++s){const E=e[s],f=o[E],p=i[E];b.longitude=a.CesiumMath.lerp(T,m,p.x),b.latitude=a.CesiumMath.lerp(g,I,p.y),b.height=f-n;const y=c.cartographicToCartesian(b,M);t.Matrix4.multiplyByPoint(d,y,y),r.Cartesian3.minimumByComponent(y,h,h),r.Cartesian3.maximumByComponent(y,u,u),l=Math.min(l,b.height)}return l}function W(e,t,r,o,i,s,d,h,u,l,I,g,