You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
26 KiB
2 lines
26 KiB
12 months ago
|
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./AttributeCompression-bb3dc748","./IntersectionTests-8371bf29","./Plane-929e0674","./WebMercatorProjection-a8c0125a","./createTaskProcessorWorker","./EllipsoidTangentPlane-af8ae194","./OrientedBoundingBox-b779e812","./TerrainEncoding-0f15d8e5"],function(Ye,e,We,Xe,Ze,n,t,a,i,r,s,je,l,Ge,qe,Qe){"use strict";var o=Object.freeze({NONE:0,LERC:1}),Je={};Je.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Ke=new Xe.Cartesian3,$e=new Ze.Matrix4,et=new Xe.Cartesian3,tt=new Xe.Cartesian3;Je.computeVertices=function(e){var t,a,i,r,n=Math.cos,s=Math.sin,l=Math.sqrt,o=Math.atan,f=Math.exp,u=We.CesiumMath.PI_OVER_TWO,c=We.CesiumMath.toRadians,d=e.heightmap,h=e.width,m=e.height,g=e.skirtHeight,p=Ye.defaultValue(e.isGeographic,!0),w=Ye.defaultValue(e.ellipsoid,Xe.Ellipsoid.WGS84),x=1/w.maximumRadius,k=e.nativeRectangle,y=e.rectangle;r=Ye.defined(y)?(t=y.west,a=y.south,i=y.east,y.north):p?(t=c(k.west),a=c(k.south),i=c(k.east),c(k.north)):(t=k.west*x,a=u-2*o(f(-k.south*x)),i=k.east*x,u-2*o(f(-k.north*x)));var I=e.relativeToCenter,b=Ye.defined(I);I=b?I:Xe.Cartesian3.ZERO;var v=Ye.defaultValue(e.exaggeration,1),U=Ye.defaultValue(e.includeWebMercatorT,!1),T=Ye.defaultValue(e.structure,Je.DEFAULT_STRUCTURE),M=Ye.defaultValue(T.heightScale,Je.DEFAULT_STRUCTURE.heightScale),V=Ye.defaultValue(T.heightOffset,Je.DEFAULT_STRUCTURE.heightOffset),A=Ye.defaultValue(T.elementsPerHeight,Je.DEFAULT_STRUCTURE.elementsPerHeight),B=Ye.defaultValue(T.stride,Je.DEFAULT_STRUCTURE.stride),D=Ye.defaultValue(T.elementMultiplier,Je.DEFAULT_STRUCTURE.elementMultiplier),S=Ye.defaultValue(T.isBigEndian,Je.DEFAULT_STRUCTURE.isBigEndian),P=Xe.Rectangle.computeWidth(k),E=Xe.Rectangle.computeHeight(k),C=P/(h-1),F=E/(m-1);p||(P*=x,E*=x);var L,O,N=w.radiiSquared,z=N.x,R=N.y,_=N.z,H=65536,Y=-65536,W=Ze.Transforms.eastNorthUpToFixedFrame(I,w),X=Ze.Matrix4.inverseTransformation(W,$e);U&&(L=je.WebMercatorProjection.geodeticLatitudeToMercatorAngle(a),O=1/(je.WebMercatorProjection.geodeticLatitudeToMercatorAngle(r)-L));var Z=et;Z.x=Number.POSITIVE_INFINITY,Z.y=Number.POSITIVE_INFINITY,Z.z=Number.POSITIVE_INFINITY;var j=tt;j.x=Number.NEGATIVE_INFINITY,j.y=Number.NEGATIVE_INFINITY,j.z=Number.NEGATIVE_INFINITY;var G=Number.POSITIVE_INFINITY,q=h*m,Q=q+(0<g?2*h+2*m:0),J=new Array(Q),K=new Array(Q),$=new Array(Q),ee=U?new Array(Q):[],te=0,ae=m,ie=0,re=h;0<g&&(--te,++ae,--ie,++re);for(var ne=te;ne<ae;++ne){var se=ne;se<0&&(se=0),m<=se&&(se=m-1);var le=k.north-F*se,oe=((le=p?c(le):u-2*o(f(-le*x)))-a)/(r-a);oe=We.CesiumMath.clamp(oe,0,1);var fe=ne===te,ue=ne===ae-1;0<g&&(fe?le+=1e-5*E:ue&&(le-=1e-5*E));var ce,de=n(le),he=s(le),me=_*he;U&&(ce=(je.WebMercatorProjection.geodeticLatitudeToMercatorAngle(le)-L)*O);for(var ge=ie;ge<re;++ge){var pe=ge;pe<0&&(pe=0),h<=pe&&(pe=h-1);var we,xe,ke=se*(h*B)+pe*B;if(1===A)we=d[ke];else if(we=0,S)for(xe=0;xe<A;++xe)we=we*D+d[ke+xe];else for(xe=A-1;0<=xe;--xe)we=we*D+d[ke+xe];we=(we*M+V)*v,Y=Math.max(Y,we),H=Math.min(H,we);var ye=k.west+C*pe;p?ye=c(ye):ye*=x;var Ie=(ye-t)/(i-t);Ie=We.CesiumMath.clamp(Ie,0,1);var be=se*h+pe;if(0<g){var ve=ge===ie,Ue=ge===re-1,Te=fe||ue||ve||Ue;if((fe||ue)&&(ve||Ue))continue;Te&&(we-=g,ve?(be=m-se-1+q,ye-=1e-5*P):ue?be=q+m+(h-pe-1):Ue?(be=q+m+h+se,ye+=1e-5*P):fe&&(be=q+m+h+m+pe))}var Me=de*n(ye),Ve=de*s(ye),Ae=z*Me,Be=R*Ve,De=1/l(Ae*Me+Be*Ve+me*he),Se=Ae*De,Pe=Be*De,Ee=me*De,Ce=new Xe.Cartesian3;Ce.x=Se+Me*we,Ce.y=Pe+Ve*we,Ce.z=Ee+he*we,J[be]=Ce,K[be]=we,$[be]=new Xe.Cartesian2(Ie,oe),U&&(ee[be]=ce),Ze.Matrix4.multiplyByPoint(X,Ce,Ke),Xe.Cartesian3.minimumByComponent(Ke,Z,Z),Xe.Cartesian3.maximumByComponent(Ke,j,j),G=Math.min(G,we)}}var Fe,Le,Oe=Ze.BoundingSphere.fromPoints(J);Ye.defined(y)&&(Fe=qe.OrientedBoundingBox.fromRectangle(y,H,Y,w)),b&&(Le=new Qe.EllipsoidalOccluder(w).computeHorizonCullingPointPossiblyUnderEllipsoid(I,J,H));for(var N
|