1 |
- define(["./when-92c6cf3c","./Rectangle-bab7abf0","./arrayFill-0358accf","./buildModuleUrl-3d15f25c","./Cartesian2-6033fa5d","./Cartographic-67e73ef9","./Check-52a7d806","./ComponentDatatype-81047f82","./GeometryAttribute-ef657318","./GeometryAttributes-7f66ea53","./GeometryInstance-da5e91bc","./GeometryOffsetAttribute-b4d599f5","./GeometryPipeline-f4eddf07","./IndexDatatype-4c0e98b8","./Math-92c3b5f7","./PrimitiveType-cdfe443e","./PolygonPipeline-b86e8785","./RectangleGeometryLibrary-12ead223","./VertexFormat-f496a3f1","./Intersect-b97e930a","./Event-3390cd7d","./RuntimeError-c6a62a80","./WebGLConstants-71f10989","./FeatureDetection-067cb23c","./Cartesian4-ad128b5d","./AttributeCompression-49f7b62a","./EncodedCartesian3-b86c8d65","./IntersectionTests-a42760d9","./Plane-f8d22530","./WindingOrder-1b9c8a87","./EllipsoidRhumbLine-8847d1a1"],(function(t,e,a,n,o,r,i,s,u,l,c,p,d,g,h,f,m,v,y,b,_,w,A,x,E,D,P,F,R,L,T){"use strict";var O=new r.t,C=new r.t,N=new r.t,I=new r.t,k=new e.h,S=new o.o,z=new n.i,G=new n.i;function M(t,e){var a=new u.I({attributes:new l.a,primitiveType:f._0x29ba75.TRIANGLES});return a.attributes.position=new u.o({componentDatatype:s.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e.positions}),t.normal&&(a.attributes.normal=new u.o({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.normals})),t.tangent&&(a.attributes.tangent=new u.o({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.tangents})),t.bitangent&&(a.attributes.bitangent=new u.o({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e.bitangents})),a}var H=new r.t,V=new r.t;function U(t,e){var a=t._vertexFormat,n=t._ellipsoid,o=e.height,i=e.width,l=e.northCap,c=e.southCap,p=0,d=o,h=o,m=0;l&&(p=1,h-=1,m+=1),c&&(d-=1,h-=1,m+=1),m+=i*h;for(var y=a.position?new Float64Array(3*m):void 0,b=a.st?new Float32Array(2*m):void 0,_=0,w=0,A=O,x=S,E=Number.MAX_VALUE,D=Number.MAX_VALUE,P=-Number.MAX_VALUE,F=-Number.MAX_VALUE,R=p;R<d;++R)for(var L=0;L<i;++L)v.j.computePosition(e,n,a.st,R,L,A,x),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z,a.st&&(b[w++]=x.x,b[w++]=x.y,E=Math.min(E,x.x),D=Math.min(D,x.y),P=Math.max(P,x.x),F=Math.max(F,x.y));if(l&&(v.j.computePosition(e,n,a.st,0,0,A,x),y[_++]=A.x,y[_++]=A.y,y[_++]=A.z,a.st&&(b[w++]=x.x,b[w++]=x.y,E=x.x,D=x.y,P=x.x,F=x.y)),c&&(v.j.computePosition(e,n,a.st,o-1,0,A,x),y[_++]=A.x,y[_++]=A.y,y[_]=A.z,a.st&&(b[w++]=x.x,b[w]=x.y,E=Math.min(E,x.x),D=Math.min(D,x.y),P=Math.max(P,x.x),F=Math.max(F,x.y))),a.st&&(E<0||D<0||P>1||F>1))for(var T=0;T<b.length;T+=2)b[T]=(b[T]-E)/(P-E),b[T+1]=(b[T+1]-D)/(F-D);var k=function(t,e,a,n){var o=t.length,i=e.normal?new Float32Array(o):void 0,s=e.tangent?new Float32Array(o):void 0,u=e.bitangent?new Float32Array(o):void 0,l=0,c=I,p=N,d=C;if(e.normal||e.tangent||e.bitangent)for(var g=0;g<o;g+=3){var h=r.t.fromArray(t,g,O),m=l+1,v=l+2;d=a.geodeticSurfaceNormal(h,d),(e.tangent||e.bitangent)&&(r.t.cross(r.t.UNIT_Z,d,p),f.p.multiplyByVector(n,p,p),r.t.normalize(p,p),e.bitangent&&r.t.normalize(r.t.cross(d,p,c),c)),e.normal&&(i[l]=d.x,i[m]=d.y,i[v]=d.z),e.tangent&&(s[l]=p.x,s[m]=p.y,s[v]=p.z),e.bitangent&&(u[l]=c.x,u[m]=c.y,u[v]=c.z),l+=3}return M(e,{positions:t,normals:i,tangents:s,bitangents:u})}(y,a,n,e.tangentRotationMatrix),z=6*(i-1)*(h-1);l&&(z+=3*(i-1)),c&&(z+=3*(i-1));var G,H=g.IndexDatatype.createTypedArray(m,z),V=0,U=0;for(G=0;G<h-1;++G){for(var j=0;j<i-1;++j){var B=V,q=B+i,Y=q+1,W=B+1;H[U++]=B,H[U++]=q,H[U++]=W,H[U++]=W,H[U++]=q,H[U++]=Y,++V}++V}if(l||c){var X,$,J=m-1,Q=m-1;if(l&&c&&(J=m-2),V=0,l)for(G=0;G<i-1;G++)$=(X=V)+1,H[U++]=J,H[U++]=X,H[U++]=$,++V;if(c)for(V=(h-1)*i,G=0;G<i-1;G++)$=(X=V)+1,H[U++]=X,H[U++]=Q,H[U++]=$,++V}return k.indices=H,a.st&&(k.attributes.st=new u.o({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:b})),k}function j(t,e,a,n,o){return t[e++]=n[a],t[e++]=n[a+1],t[e++]=n[a+2],t[e++]=o[a],t[e++]=o[a+1],t[e]=o[a+2],t}function B(t,e,a,n){return t[e++]=n[a],t[e++]=n[a+1],t[e++]=n[a],t[e]=n[a+1],t}var q=new y.n;function Y(e,n){var o,i=e._shadowVolume,l=e._offsetAttribute,f=e._vertexFormat,v=e._extrudedHeight,b=e._surfaceHeight,_=e._ellipsoid,w=n.height,A=n.width;if(i){var x=y.n.clone(f,q);x.normal=!0,e._vertexFormat=x}var E=U(e,n);i&&(e._vertexFormat=f);var D=m.A.scaleToGeodeticHeight(E.attributes.position.values,b,_,!1),P=(D=new Float64Array(D)).length,F=2*P,R=new Float64Array(F);R.set(D);var L=m.A.scaleToGeodeticHeight(E.attributes.position.values,v,_);R.set(L,P),E.attributes.position.values=R;var T,k,S=f.normal?new Float32Array(F):void 0,z=f.tangent?new Float32Array(F):void 0,G=f.bitangent?new Float32Array(F):void 0,Y=f.st?new Float32Array(F/3*2):void 0;if(f.normal){for(k=E.attributes.normal.values,S.set(k),o=0;o<P;o++)k[o]=-k[o];S.set(k,P),E.attributes.normal.values=S}if(i){k=E.attributes.normal.values,f.normal||(E.attributes.normal=void 0);var W=new Float32Array(F);for(o=0;o<P;o++)k[o]=-k[o];W.set(k,P),E.attributes.extrudeDirection=new u.o({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:W})}var X,$=t.e(l);if($){var J=P/3*2,Q=new Uint8Array(J);l===p.z.TOP?Q=a.d(Q,1,0,J/2):(X=l===p.z.NONE?0:1,Q=a.d(Q,X)),E.attributes.applyOffset=new u.o({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q})}if(f.tangent){var Z=E.attributes.tangent.values;for(z.set(Z),o=0;o<P;o++)Z[o]=-Z[o];z.set(Z,P),E.attributes.tangent.values=z}if(f.bitangent){var K=E.attributes.bitangent.values;G.set(K),G.set(K,P),E.attributes.bitangent.values=G}f.st&&(T=E.attributes.st.values,Y.set(T),Y.set(T,P/3*2),E.attributes.st.values=Y);var tt=E.indices,et=tt.length,at=P/3,nt=g.IndexDatatype.createTypedArray(F/3,2*et);for(nt.set(tt),o=0;o<et;o+=3)nt[o+et]=tt[o+2]+at,nt[o+1+et]=tt[o+1]+at,nt[o+2+et]=tt[o]+at;E.indices=nt;var ot=n.northCap,rt=n.southCap,it=w,st=2,ut=0,lt=4,ct=4;ot&&(st-=1,it-=1,ut+=1,lt-=2,ct-=1),rt&&(st-=1,it-=1,ut+=1,lt-=2,ct-=1);var pt=2*((ut+=st*A+2*it-lt)+ct),dt=new Float64Array(3*pt),gt=i?new Float32Array(3*pt):void 0,ht=$?new Uint8Array(pt):void 0,ft=f.st?new Float32Array(2*pt):void 0,mt=l===p.z.TOP;$&&!mt&&(X=l===p.z.ALL?1:0,ht=a.d(ht,X));var vt,yt=0,bt=0,_t=0,wt=0,At=A*it;for(o=0;o<At;o+=A)dt=j(dt,yt,vt=3*o,D,L),yt+=6,f.st&&(ft=B(ft,bt,2*o,T),bt+=4),i&&(_t+=3,gt[_t++]=k[vt],gt[_t++]=k[vt+1],gt[_t++]=k[vt+2]),mt&&(ht[wt++]=1,wt+=1);if(rt){var xt=ot?At+1:At;for(vt=3*xt,o=0;o<2;o++)dt=j(dt,yt,vt,D,L),yt+=6,f.st&&(ft=B(ft,bt,2*xt,T),bt+=4),i&&(_t+=3,gt[_t++]=k[vt],gt[_t++]=k[vt+1],gt[_t++]=k[vt+2]),mt&&(ht[wt++]=1,wt+=1)}else for(o=At-A;o<At;o++)dt=j(dt,yt,vt=3*o,D,L),yt+=6,f.st&&(ft=B(ft,bt,2*o,T),bt+=4),i&&(_t+=3,gt[_t++]=k[vt],gt[_t++]=k[vt+1],gt[_t++]=k[vt+2]),mt&&(ht[wt++]=1,wt+=1);for(o=At-1;o>0;o-=A)dt=j(dt,yt,vt=3*o,D,L),yt+=6,f.st&&(ft=B(ft,bt,2*o,T),bt+=4),i&&(_t+=3,gt[_t++]=k[vt],gt[_t++]=k[vt+1],gt[_t++]=k[vt+2]),mt&&(ht[wt++]=1,wt+=1);if(ot){var Et=At;for(vt=3*Et,o=0;o<2;o++)dt=j(dt,yt,vt,D,L),yt+=6,f.st&&(ft=B(ft,bt,2*Et,T),bt+=4),i&&(_t+=3,gt[_t++]=k[vt],gt[_t++]=k[vt+1],gt[_t++]=k[vt+2]),mt&&(ht[wt++]=1,wt+=1)}else for(o=A-1;o>=0;o--)dt=j(dt,yt,vt=3*o,D,L),yt+=6,f.st&&(ft=B(ft,bt,2*o,T),bt+=4),i&&(_t+=3,gt[_t++]=k[vt],gt[_t++]=k[vt+1],gt[_t++]=k[vt+2]),mt&&(ht[wt++]=1,wt+=1);var Dt=function(t,e,a){var n=t.length,o=e.normal?new Float32Array(n):void 0,i=e.tangent?new Float32Array(n):void 0,s=e.bitangent?new Float32Array(n):void 0,u=0,l=0,c=0,p=!0,d=I,g=N,f=C;if(e.normal||e.tangent||e.bitangent)for(var m=0;m<n;m+=6){var v=r.t.fromArray(t,m,O),y=r.t.fromArray(t,(m+6)%n,H);if(p){var b=r.t.fromArray(t,(m+3)%n,V);r.t.subtract(y,v,y),r.t.subtract(b,v,b),f=r.t.normalize(r.t.cross(b,y,f),f),p=!1}r.t.equalsEpsilon(y,v,h.e.EPSILON10)&&(p=!0),(e.tangent||e.bitangent)&&(d=a.geodeticSurfaceNormal(v,d),e.tangent&&(g=r.t.normalize(r.t.cross(d,f,g),g))),e.normal&&(o[u++]=f.x,o[u++]=f.y,o[u++]=f.z,o[u++]=f.x,o[u++]=f.y,o[u++]=f.z),e.tangent&&(i[l++]=g.x,i[l++]=g.y,i[l++]=g.z,i[l++]=g.x,i[l++]=g.y,i[l++]=g.z),e.bitangent&&(s[c++]=d.x,s[c++]=d.y,s[c++]=d.z,s[c++]=d.x,s[c++]=d.y,s[c++]=d.z)}return M(e,{positions:t,normals:o,tangents:i,bitangents:s})}(dt,f,_);f.st&&(Dt.attributes.st=new u.o({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:ft})),i&&(Dt.attributes.extrudeDirection=new u.o({componentDatatype:s.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:gt})),$&&(Dt.attributes.applyOffset=new u.o({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:ht}));var Pt,Ft,Rt,Lt,Tt=g.IndexDatatype.createTypedArray(pt,6*ut);P=dt.length/3;var Ot=0;for(o=0;o<P-1;o+=2){Lt=((Pt=o)+2)%P;var Ct=r.t.fromArray(dt,3*Pt,H),Nt=r.t.fromArray(dt,3*Lt,V);r.t.equalsEpsilon(Ct,Nt,h.e.EPSILON10)||(Rt=((Ft=(Pt+1)%P)+2)%P,Tt[Ot++]=Pt,Tt[Ot++]=Ft,Tt[Ot++]=Lt,Tt[Ot++]=Lt,Tt[Ot++]=Ft,Tt[Ot++]=Rt)}return Dt.indices=Tt,(Dt=d.k.combineInstances([new c.d({geometry:E}),new c.d({geometry:Dt})]))[0]}var W=[new r.t,new r.t,new r.t,new r.t],X=new r.t$1,$=new r.t$1;function J(t,a,n,o,r){if(0===n)return e.h.clone(t,r);var i=v.j.computeOptions(t,a,n,0,k,X),s=i.height,u=i.width,l=W;return v.j.computePosition(i,o,!1,0,0,l[0]),v.j.computePosition(i,o,!1,0,u-1,l[1]),v.j.computePosition(i,o,!1,s-1,0,l[2]),v.j.computePosition(i,o,!1,s-1,u-1,l[3]),e.h.fromCartesianArray(l,o,r)}function Q(a){var n=(a=t.u(a,t.u.EMPTY_OBJECT)).rectangle;if(i.o.typeOf.object("rectangle",n),e.h.validate(n),n.north<n.south)throw new i.t("options.rectangle.north must be greater than or equal to options.rectangle.south");var o=t.u(a.height,0),r=t.u(a.extrudedHeight,o);this._rectangle=e.h.clone(n),this._granularity=t.u(a.granularity,h.e.RADIANS_PER_DEGREE),this._ellipsoid=e.t.clone(t.u(a.ellipsoid,e.t.WGS84)),this._surfaceHeight=Math.max(o,r),this._rotation=t.u(a.rotation,0),this._stRotation=t.u(a.stRotation,0),this._vertexFormat=y.n.clone(t.u(a.vertexFormat,y.n.DEFAULT)),this._extrudedHeight=Math.min(o,r),this._shadowVolume=t.u(a.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=a.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Q.packedLength=e.h.packedLength+e.t.packedLength+y.n.packedLength+7,Q.pack=function(a,n,o){return i.o.typeOf.object("value",a),i.o.defined("array",n),o=t.u(o,0),e.h.pack(a._rectangle,n,o),o+=e.h.packedLength,e.t.pack(a._ellipsoid,n,o),o+=e.t.packedLength,y.n.pack(a._vertexFormat,n,o),o+=y.n.packedLength,n[o++]=a._granularity,n[o++]=a._surfaceHeight,n[o++]=a._rotation,n[o++]=a._stRotation,n[o++]=a._extrudedHeight,n[o++]=a._shadowVolume?1:0,n[o]=t.u(a._offsetAttribute,-1),n};var Z=new e.h,K=e.t.clone(e.t.UNIT_SPHERE),tt={rectangle:Z,ellipsoid:K,vertexFormat:q,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Q.unpack=function(a,n,o){i.o.defined("array",a),n=t.u(n,0);var r=e.h.unpack(a,n,Z);n+=e.h.packedLength;var s=e.t.unpack(a,n,K);n+=e.t.packedLength;var u=y.n.unpack(a,n,q);n+=y.n.packedLength;var l=a[n++],c=a[n++],p=a[n++],d=a[n++],g=a[n++],h=1===a[n++],f=a[n];return t.e(o)?(o._rectangle=e.h.clone(r,o._rectangle),o._ellipsoid=e.t.clone(s,o._ellipsoid),o._vertexFormat=y.n.clone(u,o._vertexFormat),o._granularity=l,o._surfaceHeight=c,o._rotation=p,o._stRotation=d,o._extrudedHeight=g,o._shadowVolume=h,o._offsetAttribute=-1===f?void 0:f,o):(tt.granularity=l,tt.height=c,tt.rotation=p,tt.stRotation=d,tt.extrudedHeight=g,tt.shadowVolume=h,tt.offsetAttribute=-1===f?void 0:f,new Q(tt))},Q.computeRectangle=function(a,n){var o=(a=t.u(a,t.u.EMPTY_OBJECT)).rectangle;if(i.o.typeOf.object("rectangle",o),e.h.validate(o),o.north<o.south)throw new i.t("options.rectangle.north must be greater than or equal to options.rectangle.south");var r=t.u(a.granularity,h.e.RADIANS_PER_DEGREE),s=t.u(a.ellipsoid,e.t.WGS84);return J(o,r,t.u(a.rotation,0),s,n)};var et=new f.p,at=new u.n,nt=new r.t$1;Q.createGeometry=function(o){if(!h.e.equalsEpsilon(o._rectangle.north,o._rectangle.south,h.e.EPSILON10)&&!h.e.equalsEpsilon(o._rectangle.east,o._rectangle.west,h.e.EPSILON10)){var r=o._rectangle,i=o._ellipsoid,l=o._rotation,c=o._stRotation,d=o._vertexFormat,g=v.j.computeOptions(r,o._granularity,l,c,k,X,$),y=et;if(0!==c||0!==l){var b=e.h.center(r,nt),_=i.geodeticSurfaceNormalCartographic(b,H);u.n.fromAxisAngle(_,-c,at),f.p.fromQuaternion(at,y)}else f.p.clone(f.p.IDENTITY,y);var w,A,x=o._surfaceHeight,E=o._extrudedHeight,D=!h.e.equalsEpsilon(x,E,0,h.e.EPSILON2);if(g.lonScalar=1/o._rectangle.width,g.latScalar=1/o._rectangle.height,g.tangentRotationMatrix=y,r=o._rectangle,D){w=Y(o,g);var P=n.i.fromRectangle3D(r,i,x,G),F=n.i.fromRectangle3D(r,i,E,z);A=n.i.union(P,F)}else{if((w=U(o,g)).attributes.position.values=m.A.scaleToGeodeticHeight(w.attributes.position.values,x,i,!1),t.e(o._offsetAttribute)){var R=w.attributes.position.values.length,L=new Uint8Array(R/3),T=o._offsetAttribute===p.z.NONE?0:1;a.d(L,T),w.attributes.applyOffset=new u.o({componentDatatype:s.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}A=n.i.fromRectangle3D(r,i,x)}return d.position||delete w.attributes.position,new u.I({attributes:w.attributes,indices:w.indices,primitiveType:w.primitiveType,boundingSphere:A,offsetAttribute:o._offsetAttribute})}},Q.createShadowVolume=function(t,e,a){var n=t._granularity,o=t._ellipsoid,r=e(n,o),i=a(n,o);return new Q({rectangle:t._rectangle,rotation:t._rotation,ellipsoid:o,stRotation:t._stRotation,granularity:n,extrudedHeight:i,height:r,vertexFormat:y.n.POSITION_ONLY,shadowVolume:!0})};var ot=new e.h,rt=[new o.o,new o.o,new o.o],it=new u.f,st=new r.t$1;return Object.defineProperties(Q.prototype,{rectangle:{get:function(){return t.e(this._rotatedRectangle)||(this._rotatedRectangle=J(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return t.e(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){if(0===t._stRotation)return[0,0,0,1,1,0];var a=e.h.clone(t._rectangle,ot),n=t._granularity,r=t._ellipsoid,i=J(a,n,t._rotation-t._stRotation,r,ot),s=rt;s[0].x=i.west,s[0].y=i.south,s[1].x=i.west,s[1].y=i.north,s[2].x=i.east,s[2].y=i.south;for(var l=t.rectangle,c=u.f.fromRotation(t._stRotation,it),p=e.h.center(l,st),d=0;d<3;++d){var g=s[d];g.x-=p.longitude,g.y-=p.latitude,u.f.multiplyByVector(c,g,g),g.x+=p.longitude,g.y+=p.latitude,g.x=(g.x-l.west)/l.width,g.y=(g.y-l.south)/l.height}var h=s[0],f=s[1],m=s[2],v=new Array(6);return o.o.pack(h,v),o.o.pack(f,v,2),o.o.pack(m,v,4),v}(this)),this._textureCoordinateRotationPoints}}}),function(a,n){return t.e(n)&&(a=Q.unpack(a,n)),a._ellipsoid=e.t.clone(a._ellipsoid),a._rectangle=e.h.clone(a._rectangle),Q.createGeometry(a)}}));
|