learning_cesium/js/XbsjCesium/Workers/createVerticesFromQuantized...

2 lines
7.9 KiB
JavaScript
Raw Permalink Normal View History

2024-03-19 18:06:25 +08:00
define(["./AxisAlignedBoundingBox-dcfdb7a9","./Cartesian2-697a9954","./when-54335d57","./TerrainEncoding-24b5ef86","./IndexDatatype-c134ea39","./Math-737a2579","./Transforms-251ff661","./Check-f3fec9b0","./WebMercatorProjection-6a6458e9","./createTaskProcessorWorker","./AttributeCompression-ab5c33b7","./ComponentDatatype-417761a2","./WebGLConstants-4739ce15","./RuntimeError-88a32665"],function(te,re,ne,ie,oe,ae,se,e,de,t,r,n,i,o){"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 a=[];ce.getRegularGridIndices=function(e,t){var r=a[e];ne.defined(r)||(a[e]=r=[]);var n=r[t];return ne.defined(n)||g(e,t,n=e*t<ae.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 d=[];ce.getRegularGridIndicesAndEdgeIndices=function(e,t){var r=d[e];ne.defined(r)||(d[e]=r=[]);var n,i,o,a,s=r[t];return ne.defined(s)||(n=ce.getRegularGridIndices(e,t),i=(a=l(e,t)).westIndicesSouthToNorth,o=a.southIndicesEastToWest,e=a.eastIndicesNorthToSouth,a=a.northIndicesWestToEast,s=r[t]={indices:n,westIndicesSouthToNorth:i,southIndicesEastToWest:o,eastIndicesNorthToSouth:e,northIndicesWestToEast:a}),s};var I=[];function l(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 g(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,d=s+e,c=d+1,h=s+1;r[n++]=s,r[n++]=d,r[n++]=h,r[n++]=h,r[n++]=d,r[n++]=c,++i}++i}}function s(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=I[e];ne.defined(r)||(I[e]=r=[]);var n,i,o,a,s,d,c,h,u=r[t];return ne.defined(u)||(o=(n=e*t)+(d=2*e+2*t),h=(i=(e-1)*(t-1)*6)+6*Math.max(0,d-4),a=(c=l(e,t)).westIndicesSouthToNorth,s=c.southIndicesEastToWest,d=c.eastIndicesNorthToSouth,c=c.northIndicesWestToEast,g(e,t,h=oe.IndexDatatype.createTypedArray(o,h),0),ce.addSkirtIndices(a,s,d,c,n,h,i),u=r[t]={indices:h,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:d,northIndicesWestToEast:c,indexCountWithoutSkirts:i}),u},ce.addSkirtIndices=function(e,t,r,n,i,o,a){a=s(e,i,o,a),a=s(t,i+=e.length,o,a),a=s(r,i+=t.length,o,a),s(n,i+=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 he=32767,ue=new re.Cartesian3,Ie=new re.Cartesian3,le=new re.Cartesian3,ge=new re.Cartographic,me=new re.Cartesian2;function Te(e,t,r,n,i,o,a,s,d){var c=Number.POSITIVE_INFINITY,h=i.north,u=i.south,I=i.east,l=i.west;I<l&&(I+=ae.CesiumMath.TWO_PI);for(var g=e.length,m=0;m<g;++m){var T=e[m],E=r[T],T=n[T];ge.longitude=ae.CesiumMath.lerp(l,I,T.x),ge.latitude=ae.CesiumMath.lerp(u,h,T.y),ge.height=E-t;E=o.cartographicToCartesian(ge,ue);se.Matrix4.multiplyByPoint(a,E,E),re.Cartesian3.minimumByComponent(E,s,s),re.Cartesian3.maximumByComponent(E,d,d),c=Math.min(c,ge.height)}return c}function Ee(e,t,r,n,i,o,a,s,d,c,h,u,I,l){var g=ne.defined(a),m=d.north,T=d.south,E=d.east