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
5.8 KiB
2 lines
5.8 KiB
12 months ago
|
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-7ee14e67","./GeometryAttribute-6f280ece","./GeometryAttributes-90846c5f","./IndexDatatype-354a5ea3","./IntersectionTests-8371bf29","./Plane-929e0674","./VertexFormat-cc24f342","./arrayRemoveDuplicates-4dfa28d2","./EllipsoidRhumbLine-8c93f67a","./EllipsoidGeodesic-19b1a191","./PolylinePipeline-d0f0e8fc","./WallGeometryLibrary-04578c7e"],function(Y,e,Z,j,K,t,a,Q,X,$,ee,i,r,p,n,o,s,m,te){"use strict";var ae=new j.Cartesian3,ie=new j.Cartesian3,re=new j.Cartesian3,ne=new j.Cartesian3,oe=new j.Cartesian3,se=new j.Cartesian3,me=new j.Cartesian3;function d(e){var t=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,a=e.maximumHeights,i=e.minimumHeights,r=Y.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT),n=Y.defaultValue(e.granularity,Z.CesiumMath.RADIANS_PER_DEGREE),o=Y.defaultValue(e.ellipsoid,j.Ellipsoid.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=a,this._vertexFormat=p.VertexFormat.clone(r),this._granularity=n,this._ellipsoid=j.Ellipsoid.clone(o),this._workerName="createWallGeometry";var s=1+t.length*j.Cartesian3.packedLength+2;Y.defined(i)&&(s+=i.length),Y.defined(a)&&(s+=a.length),this.packedLength=s+j.Ellipsoid.packedLength+p.VertexFormat.packedLength+1}d.pack=function(e,t,a){var i;a=Y.defaultValue(a,0);var r=e._positions,n=r.length;for(t[a++]=n,i=0;i<n;++i,a+=j.Cartesian3.packedLength)j.Cartesian3.pack(r[i],t,a);var o=e._minimumHeights;if(n=Y.defined(o)?o.length:0,t[a++]=n,Y.defined(o))for(i=0;i<n;++i)t[a++]=o[i];var s=e._maximumHeights;if(n=Y.defined(s)?s.length:0,t[a++]=n,Y.defined(s))for(i=0;i<n;++i)t[a++]=s[i];return j.Ellipsoid.pack(e._ellipsoid,t,a),a+=j.Ellipsoid.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),t[a+=p.VertexFormat.packedLength]=e._granularity,t};var c=j.Ellipsoid.clone(j.Ellipsoid.UNIT_SPHERE),f=new p.VertexFormat,y={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:c,vertexFormat:f,granularity:void 0};return d.unpack=function(e,t,a){var i;t=Y.defaultValue(t,0);var r,n,o=e[t++],s=new Array(o);for(i=0;i<o;++i,t+=j.Cartesian3.packedLength)s[i]=j.Cartesian3.unpack(e,t);if(0<(o=e[t++]))for(r=new Array(o),i=0;i<o;++i)r[i]=e[t++];if(0<(o=e[t++]))for(n=new Array(o),i=0;i<o;++i)n[i]=e[t++];var m=j.Ellipsoid.unpack(e,t,c);t+=j.Ellipsoid.packedLength;var l=p.VertexFormat.unpack(e,t,f),u=e[t+=p.VertexFormat.packedLength];return Y.defined(a)?(a._positions=s,a._minimumHeights=r,a._maximumHeights=n,a._ellipsoid=j.Ellipsoid.clone(m,a._ellipsoid),a._vertexFormat=p.VertexFormat.clone(l,a._vertexFormat),a._granularity=u,a):(y.positions=s,y.minimumHeights=r,y.maximumHeights=n,y.granularity=u,new d(y))},d.fromConstantHeights=function(e){var t,a,i=(e=Y.defaultValue(e,Y.defaultValue.EMPTY_OBJECT)).positions,r=e.minimumHeight,n=e.maximumHeight,o=Y.defined(r),s=Y.defined(n);if(o||s){var m=i.length;t=o?new Array(m):void 0,a=s?new Array(m):void 0;for(var l=0;l<m;++l)o&&(t[l]=r),s&&(a[l]=n)}return new d({positions:i,maximumHeights:a,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},d.createGeometry=function(e){var t=e._positions,a=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,n=e._granularity,o=e._ellipsoid,s=te.WallGeometryLibrary.computePositions(o,t,i,a,n,!0);if(Y.defined(s)){var m,l=s.bottomPositions,u=s.topPositions,p=s.numCorners,d=u.length,c=2*d,f=r.position?new Float64Array(c):void 0,y=r.normal?new Float32Array(c):void 0,g=r.tangent?new Float32Array(c):void 0,h=r.bitangent?new Float32Array(c):void 0,v=r.st?new Float32Array(c/3*2):void 0,C=0,x=0,A=0,b=0,_=0,E=me,w=se,F=oe,L=!0,k=0,H=1/((d/=3)-p-1);for(m=0;m<d;++m){var V=3*m,G=j.Cartesian3.fromArray(u,V,ae),D=j.Cartesian3.fromArray(l,V,ie);if(r.position&&(f[C++]=D.x,f[C++]=D.y,f[C++]=D.z,f[C++]=G.x,f[C++]=G.y,f[C++]=G.z),r.st&&(v[_++]=k,v[_++]=0,v[_++]=k,v[_++]=1),r.normal||r.tangent||r.bitangent){var P=j.Cartesian3.clone(j.Cartesian3.ZERO,ne),T=j.Cartesian3.subtract(G,o.geodeticSurfaceNormal
|