YZProjectCloud/yanzhu-ui-vue3/public/Engine/Workers/createVerticesFromQuantized...

2 lines
8.1 KiB
JavaScript
Raw Normal View History

2025-04-07 00:55:58 +08:00
define(["./AxisAlignedBoundingBox-37250ed6","./Matrix2-e3fb4559","./Cartesian3-7e9cc2ff","./defaultValue-81eec7ed","./TerrainEncoding-2e2628a7","./IndexDatatype-f1e3f799","./Math-5f585871","./Matrix4-d34187af","./Check-741c5f3c","./Transforms-98ffa11d","./WebMercatorProjection-f5706bbf","./createTaskProcessorWorker","./AttributeCompression-e2e3f0dd","./ComponentDatatype-aaeec80f","./WebGLConstants-508b9636","./RuntimeError-26acdd3b","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda"],(function(e,t,r,n,o,i,a,s,c,d,h,u,l,I,g,m,f,T){"use strict";function E(){c.DeveloperError.throwInstantiationError()}Object.defineProperties(E.prototype,{errorEvent:{get:c.DeveloperError.throwInstantiationError},credit:{get:c.DeveloperError.throwInstantiationError},tilingScheme:{get:c.DeveloperError.throwInstantiationError},ready:{get:c.DeveloperError.throwInstantiationError},readyPromise:{get:c.DeveloperError.throwInstantiationError},hasWaterMask:{get:c.DeveloperError.throwInstantiationError},hasVertexNormals:{get:c.DeveloperError.throwInstantiationError},availability:{get:c.DeveloperError.throwInstantiationError}});const p=[];E.getRegularGridIndices=function(e,t){let r=p[e];n.defined(r)||(p[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),M(e,t,o,0)),o};const y=[];E.getRegularGridIndicesAndEdgeIndices=function(e,t){let r=y[e];n.defined(r)||(y[e]=r=[]);let o=r[t];if(!n.defined(o)){const n=E.getRegularGridIndices(e,t),i=w(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 N=[];function w(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 M(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 S(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}E.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let r=N[e];n.defined(r)||(N[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=w(e,t),u=h.westIndicesSouthToNorth,l=h.southIndicesEastToWest,I=h.eastIndicesNorthToSouth,g=h.northIndicesWestToEast,m=i.IndexDatatype.createTypedArray(c,d);M(e,t,m,0),E.addSkirtIndices(u,l,I,g,n,m,a),o=r[t]={indices:m,westIndicesSouthToNorth:u,southIndicesEastToWest:l,eastIndicesNorthToSouth:I,northIndicesWestToEast:g,indexCountWithoutSkirts:a}}return o},E.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=S(e,s,i,a),s+=e.length,a=S(t,s,i,a),s+=t.length,a=S(r,s,i,a),s+=r.length,S(n,s,i,a)},E.heightmapTerrainQuality=.25,E.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*E.heightmapTerrainQuality/(t*r)},E.prototype.requestTileGeometry=c.DeveloperError.throwInstantiationError,E.prototype.getLevelMaximumGeometricError=c.DeveloperError.throwInstantiationError,E.prototype.getTileDataAvailable=c.DeveloperError.throwInstantiationError,E.prototype.loadTileDataAvailability=c.DeveloperError.throwInstantiationError;const b=32767,x=new r.Cartesian3,C=new r.Cartesian3,A=new r.Cartesian3,W=new t.Cartographic,v=new t.Cartesian2;function P(e,t,n,o,i,c,d,h,u){let l=Number.POSITIVE_INFINITY;const I=i.north,g=i.south;let m=i.east;const f=i.west;m<f&&(m+=a.CesiumMath.TWO_PI);const T=e.length;for(let i=0;i<T;++i){const T=e[i],E=n[T],p=o[T];W.longitude=a.CesiumMath.lerp(f,m,p.x),W.latitude=a.CesiumMath.lerp(g,I,p.y),W.height=E-t;const y=c.cartographicToCartesian(W,x);s.Matrix4.multiplyByPoint(d,y,y),r.Cartesian3.minimumByComponent(y,h,h),r.Cartesian3.maxim