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
15 KiB

9 months ago
define(["./defaultValue-81eec7ed","./Matrix2-47e98d76","./ArcType-fc72c06c","./GeometryOffsetAttribute-8c5e10db","./BoundingRectangle-c745bb9d","./Transforms-08771371","./RuntimeError-8952249c","./ComponentDatatype-a15c9a19","./EllipsoidGeodesic-19e75e11","./EllipsoidTangentPlane-aa2df207","./GeometryAttribute-64b853f6","./GeometryInstance-4fbf16ba","./GeometryPipeline-7ffd77ba","./IndexDatatype-f1dcdf35","./PolygonGeometryLibrary-3e37a9d7","./PolygonPipeline-32809f7a","./VertexFormat-a0b706b0","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda","./WebGLConstants-508b9636","./AxisAlignedBoundingBox-8b0fdc16","./IntersectionTests-bc78300e","./Plane-3f01019d","./AttributeCompression-80665726","./EncodedCartesian3-d9f5c4a4","./arrayRemoveDuplicates-dc2f4046","./EllipsoidRhumbLine-6145377b","./GeometryAttributes-32b29525"],(function(e,t,o,i,n,r,a,s,l,c,u,p,m,y,g,d,h,f,b,_,P,x,C,w,T,I,A,E){"use strict";const v=new t.Cartographic,G=new t.Cartographic;function O(e,t,o,i){const n=i.cartesianToCartographic(e,v).height,r=i.cartesianToCartographic(t,G);r.height=n,i.cartographicToCartesian(r,t);const a=i.cartesianToCartographic(o,G);a.height=n-100,i.cartographicToCartesian(a,o)}const V=new n.BoundingRectangle,F=new t.Cartesian3,D=new t.Cartesian3,L=new t.Cartesian3,N=new t.Cartesian3,H=new t.Cartesian3,R=new t.Cartesian3;let M=new t.Cartesian3,S=new t.Cartesian3,B=new t.Cartesian3;const k=new t.Cartesian2,z=new t.Cartesian2,W=new t.Cartesian3,Y=new r.Quaternion,U=new t.Matrix3,j=new t.Matrix3;function Q(o){const n=o.vertexFormat,a=o.geometry,l=o.shadowVolume,c=a.attributes.position.values;let p=c.length;const m=o.wall,y=o.top||m,g=o.bottom||m;if(n.st||n.normal||n.tangent||n.bitangent||l){const e=o.boundingRectangle,i=o.tangentPlane,d=o.ellipsoid,h=o.stRotation,f=o.perPositionHeight,b=k;b.x=e.x,b.y=e.y;const _=n.st?new Float32Array(p/3*2):void 0;let P;n.normal&&(P=f&&y&&!m?a.attributes.normal.values:new Float32Array(p));const x=n.tangent?new Float32Array(p):void 0,C=n.bitangent?new Float32Array(p):void 0,w=l?new Float32Array(p):void 0;let T=0,I=0,A=D,E=L,v=N,G=!0,V=U,Q=j;if(0!==h){let e=r.Quaternion.fromAxisAngle(i._plane.normal,h,Y);V=t.Matrix3.fromQuaternion(e,V),e=r.Quaternion.fromAxisAngle(i._plane.normal,-h,Y),Q=t.Matrix3.fromQuaternion(e,Q)}else V=t.Matrix3.clone(t.Matrix3.IDENTITY,V),Q=t.Matrix3.clone(t.Matrix3.IDENTITY,Q);let q=0,K=0;y&&g&&(q=p/2,K=p/3,p/=2);for(let r=0;r<p;r+=3){const a=t.Cartesian3.fromArray(c,r,W);if(n.st){let o=t.Matrix3.multiplyByVector(V,a,F);o=d.scaleToGeodeticSurface(o,o);const n=i.projectPointOntoPlane(o,z);t.Cartesian2.subtract(n,b,n);const r=s.CesiumMath.clamp(n.x/e.width,0,1),l=s.CesiumMath.clamp(n.y/e.height,0,1);g&&(_[T+K]=r,_[T+1+K]=l),y&&(_[T]=r,_[T+1]=l),T+=2}if(n.normal||n.tangent||n.bitangent||l){const e=I+1,i=I+2;if(m){if(r+3<p){const e=t.Cartesian3.fromArray(c,r+3,H);if(G){const o=t.Cartesian3.fromArray(c,r+p,R);f&&O(a,e,o,d),t.Cartesian3.subtract(e,a,e),t.Cartesian3.subtract(o,a,o),A=t.Cartesian3.normalize(t.Cartesian3.cross(o,e,A),A),G=!1}t.Cartesian3.equalsEpsilon(e,a,s.CesiumMath.EPSILON10)&&(G=!0)}(n.tangent||n.bitangent)&&(v=d.geodeticSurfaceNormal(a,v),n.tangent&&(E=t.Cartesian3.normalize(t.Cartesian3.cross(v,A,E),E)))}else A=d.geodeticSurfaceNormal(a,A),(n.tangent||n.bitangent)&&(f&&(M=t.Cartesian3.fromArray(P,I,M),S=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,M,S),S=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(Q,S,S),S),n.bitangent&&(B=t.Cartesian3.normalize(t.Cartesian3.cross(M,S,B),B))),E=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,A,E),E=t.Cartesian3.normalize(t.Matrix3.multiplyByVector(Q,E,E),E),n.bitangent&&(v=t.Cartesian3.normalize(t.Cartesian3.cross(A,E,v),v)));n.normal&&(o.wall?(P[I+q]=A.x,P[e+q]=A.y,P[i+q]=A.z):g&&(P[I+q]=-A.x,P[e+q]=-A.y,P[i+q]=-A.z),(y&&!f||m)&&(P[I]=A.x,P[e]=A.y,P[i]=A.z)),l&&(m&&(A=d.geodeticSurfaceNormal(a,A)),w[I+q]=-A.x,w[e+q]=-A.y,w[i+q]=-A.z),n.tangent&&(o.wall?(x[I+q]=E.x,x[e+q]=E.y,x[i+q]=E.z):g&&(x[I+q]=-E.x,x[e+q]=-E.y,x[i+q]=-E.z),y&&(f?(x[I]=S.x,x[e]=S.y,x[i]=S.z):(x[I]=E.x,x[e]=E.y,x[i]=E.z))),n.bitangent&&(g&&(C[I+q]=v.x,C[e+q]=v.y,C