2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
|
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-e66fad2a","./Cartesian2-44433f55","./Transforms-d9350502","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./GeometryAttribute-424f2c6a","./GeometryAttributes-90846c5f","./AttributeCompression-170b3be0","./GeometryPipeline-5896d55c","./EncodedCartesian3-86f19ac2","./IndexDatatype-66caba23","./IntersectionTests-d04ec592","./Plane-94f78648","./GeometryOffsetAttribute-84f7eff3","./VertexFormat-cc24f342","./GeometryInstance-505d80ea","./arrayRemoveDuplicates-b817241d","./BoundingRectangle-d1dbcdbd","./EllipsoidTangentPlane-d3a474ef","./ArcType-2b58731c","./EllipsoidRhumbLine-862a2df4","./PolygonPipeline-94be9b1d","./PolygonGeometryLibrary-f3f95c31","./EllipsoidGeodesic-7779e55a"],function(Y,e,U,j,Q,t,r,q,K,a,o,D,i,L,n,s,Z,b,N,l,u,H,p,c,R,M,y){"use strict";var J=new j.Cartographic,X=new j.Cartographic;var S=new u.BoundingRectangle,$=new j.Cartesian3,ee=new j.Cartesian3,te=new j.Cartesian3,re=new j.Cartesian3,ae=new j.Cartesian3,oe=new j.Cartesian3,ie=new j.Cartesian3,ne=new j.Cartesian3,se=new j.Cartesian3,le=new j.Cartesian2,ue=new j.Cartesian2,ce=new j.Cartesian3,pe=new Q.Quaternion,ye=new Q.Matrix3,me=new Q.Matrix3;function B(e){var t,r,a,o=e.vertexFormat,i=e.geometry,n=e.shadowVolume,s=i.attributes.position.values,l=s.length,u=e.wall,c=e.top||u,p=e.bottom||u;if(o.st||o.normal||o.tangent||o.bitangent||n){var y=e.boundingRectangle,m=e.tangentPlane,g=e.ellipsoid,d=e.stRotation,h=e.perPositionHeight,f=le;f.x=y.x,f.y=y.y;var b,v=o.st?new Float32Array(l/3*2):void 0;o.normal&&(b=h&&c&&!u?i.attributes.normal.values:new Float32Array(l));var _,P=o.tangent?new Float32Array(l):void 0,C=o.bitangent?new Float32Array(l):void 0,w=n?new Float32Array(l):void 0,x=0,T=0,I=ee,A=te,E=re,G=!0,O=ye,V=me;V=0!==d?(_=Q.Quaternion.fromAxisAngle(m._plane.normal,d,pe),O=Q.Matrix3.fromQuaternion(_,O),_=Q.Quaternion.fromAxisAngle(m._plane.normal,-d,pe),Q.Matrix3.fromQuaternion(_,V)):(O=Q.Matrix3.clone(Q.Matrix3.IDENTITY,O),Q.Matrix3.clone(Q.Matrix3.IDENTITY,V));var F=0,D=0;c&&p&&(F=l/2,D=l/3,l/=2);for(var L=0;L<l;L+=3){var N,H,R,M,S,B,k,z,W=j.Cartesian3.fromArray(s,L,ce);o.st&&(N=Q.Matrix3.multiplyByVector(O,W,$),N=g.scaleToGeodeticSurface(N,N),H=m.projectPointOntoPlane(N,ue),j.Cartesian2.subtract(H,f,H),R=U.CesiumMath.clamp(H.x/y.width,0,1),M=U.CesiumMath.clamp(H.y/y.height,0,1),p&&(v[x+D]=R,v[x+1+D]=M),c&&(v[x]=R,v[x+1]=M),x+=2),(o.normal||o.tangent||o.bitangent||n)&&(S=T+1,B=T+2,u?(L+3<l&&(k=j.Cartesian3.fromArray(s,L+3,ae),G&&(z=j.Cartesian3.fromArray(s,L+l,oe),h&&function(e,t,r,a){var o=a.cartesianToCartographic(e,J).height,i=a.cartesianToCartographic(t,X);i.height=o,a.cartographicToCartesian(i,t);var n=a.cartesianToCartographic(r,X);n.height=o-100,a.cartographicToCartesian(n,r)}(W,k,z,g),j.Cartesian3.subtract(k,W,k),j.Cartesian3.subtract(z,W,z),I=j.Cartesian3.normalize(j.Cartesian3.cross(z,k,I),I),G=!1),j.Cartesian3.equalsEpsilon(k,W,U.CesiumMath.EPSILON10)&&(G=!0)),(o.tangent||o.bitangent)&&(E=g.geodeticSurfaceNormal(W,E),o.tangent&&(A=j.Cartesian3.normalize(j.Cartesian3.cross(E,I,A),A)))):(I=g.geodeticSurfaceNormal(W,I),(o.tangent||o.bitangent)&&(h&&(ie=j.Cartesian3.fromArray(b,T,ie),ne=j.Cartesian3.cross(j.Cartesian3.UNIT_Z,ie,ne),ne=j.Cartesian3.normalize(Q.Matrix3.multiplyByVector(V,ne,ne),ne),o.bitangent&&(se=j.Cartesian3.normalize(j.Cartesian3.cross(ie,ne,se),se))),A=j.Cartesian3.cross(j.Cartesian3.UNIT_Z,I,A),A=j.Cartesian3.normalize(Q.Matrix3.multiplyByVector(V,A,A),A),o.bitangent&&(E=j.Cartesian3.normalize(j.Cartesian3.cross(I,A,E),E)))),o.normal&&(e.wall?(b[T+F]=I.x,b[S+F]=I.y,b[B+F]=I.z):p&&(b[T+F]=-I.x,b[S+F]=-I.y,b[B+F]=-I.z),(c&&!h||u)&&(b[T]=I.x,b[S]=I.y,b[B]=I.z)),n&&(u&&(I=g.geodeticSurfaceNormal(W,I)),w[T+F]=-I.x,w[S+F]=-I.y,w[B+F]=-I.z),o.tangent&&(e.wall?(P[T+F]=A.x,P[S+F]=A.y,P[B+F]=A.z):p&&(P[T+F]=-A.x,P[S+F]=-A.y,P[B+F]=-A.z),c&&(h?(P[T]=ne.x,P[S]=ne.y,P[B]=ne.z):(P[T]=A.x,P[S]=A.y,P[B]=A.z))),o.bitangent&&(p&&(C[T+F]=E.x,C[S+F]=E.y,C[B+F]=E.z),c&&(h?(C[T]=se.x,C[S]=se.y,C[B]=se.z):(C[T]=E.x,C[S]=E.y,C[B]=E.z))),T+=3)}o.st&&(i.attribu
|