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
6.1 KiB
2 lines
6.1 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","./AttributeCompression-bb3dc748","./GeometryPipeline-21a841db","./EncodedCartesian3-4930ae29","./IndexDatatype-354a5ea3","./IntersectionTests-8371bf29","./Plane-929e0674","./VertexFormat-cc24f342","./GeometryInstance-3fa7d9ab","./arrayRemoveDuplicates-4dfa28d2","./BoundingRectangle-98202e82","./EllipsoidTangentPlane-af8ae194","./OrientedBoundingBox-b779e812","./CoplanarPolygonGeometryLibrary-2afa6d7d","./ArcType-2b58731c","./EllipsoidRhumbLine-8c93f67a","./PolygonPipeline-8cd894f7","./PolygonGeometryLibrary-b5f313e5"],function(s,e,V,R,I,t,a,M,H,B,n,w,r,O,o,i,p,A,F,l,y,c,G,m,u,z,L){"use strict";var S=new R.Cartesian3,E=new l.BoundingRectangle,N=new R.Cartesian2,Q=new R.Cartesian2,T=new R.Cartesian3,D=new R.Cartesian3,_=new R.Cartesian3,k=new R.Cartesian3,j=new R.Cartesian3,U=new R.Cartesian3,Y=new I.Quaternion,q=new I.Matrix3,J=new I.Matrix3,W=new R.Cartesian3;function Z(e,t,a,n,r,o,i,l){var s=e.positions,p=z.PolygonPipeline.triangulate(e.positions2D,e.holes);p.length<3&&(p=[0,1,2]);var y=O.IndexDatatype.createTypedArray(s.length,p.length);y.set(p);var c=q;if(0!==n){var m=I.Quaternion.fromAxisAngle(o,n,Y);if(c=I.Matrix3.fromQuaternion(m,c),t.tangent||t.bitangent){m=I.Quaternion.fromAxisAngle(o,-n,Y);var u=I.Matrix3.fromQuaternion(m,J);i=R.Cartesian3.normalize(I.Matrix3.multiplyByVector(u,i,i),i),t.bitangent&&(l=R.Cartesian3.normalize(R.Cartesian3.cross(o,i,l),l))}}else c=I.Matrix3.clone(I.Matrix3.IDENTITY,c);var d=Q;t.st&&(d.x=a.x,d.y=a.y);for(var g=s.length,b=3*g,v=new Float64Array(b),f=t.normal?new Float32Array(b):void 0,h=t.tangent?new Float32Array(b):void 0,C=t.bitangent?new Float32Array(b):void 0,x=t.st?new Float32Array(2*g):void 0,P=0,w=0,A=0,F=0,G=0,L=0;L<g;L++){var E=s[L];if(v[P++]=E.x,v[P++]=E.y,v[P++]=E.z,t.st){var T=r(I.Matrix3.multiplyByVector(c,E,S),N);R.Cartesian2.subtract(T,d,T);var D=V.CesiumMath.clamp(T.x/a.width,0,1),_=V.CesiumMath.clamp(T.y/a.height,0,1);x[G++]=D,x[G++]=_}t.normal&&(f[w++]=o.x,f[w++]=o.y,f[w++]=o.z),t.tangent&&(h[F++]=i.x,h[F++]=i.y,h[F++]=i.z),t.bitangent&&(C[A++]=l.x,C[A++]=l.y,C[A++]=l.z)}var k=new B.GeometryAttributes;return t.position&&(k.position=new H.GeometryAttribute({componentDatatype:M.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:v})),t.normal&&(k.normal=new H.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:f})),t.tangent&&(k.tangent=new H.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:h})),t.bitangent&&(k.bitangent=new H.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C})),t.st&&(k.st=new H.GeometryAttribute({componentDatatype:M.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:x})),new H.Geometry({attributes:k,indices:y,primitiveType:H.PrimitiveType.TRIANGLES})}function d(e){var t=(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).polygonHierarchy,a=s.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT);this._vertexFormat=p.VertexFormat.clone(a),this._polygonHierarchy=t,this._stRotation=s.defaultValue(e.stRotation,0),this._ellipsoid=R.Ellipsoid.clone(s.defaultValue(e.ellipsoid,R.Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=L.PolygonGeometryLibrary.computeHierarchyPackedLength(t)+p.VertexFormat.packedLength+R.Ellipsoid.packedLength+2}d.fromPositions=function(e){return new d({polygonHierarchy:{positions:(e=s.defaultValue(e,s.defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},d.pack=function(e,t,a){return a=s.defaultValue(a,0),a=L.PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,a),R.Ellipsoid.pack(e._ellipsoid,t,a),a+=R.Ellipsoid.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),a+=p.VertexFormat.packedLength,t[a++]=e._stRotation,t[a]=e.pack
|