define(["exports","./GeometryOffsetAttribute-718fa138","./Transforms-b51fdb37","./Rectangle-82621db8","./ComponentDatatype-1a100acd","./CylinderGeometryLibrary-8d99e1fd","./when-54335d57","./Check-24483042","./GeometryAttribute-02fdce7a","./GeometryAttributes-caa08d6c","./IndexDatatype-edb2f4d6","./Math-7a8129d6","./VertexFormat-81ec7207"],function(t,I,U,S,B,Y,Z,e,J,W,j,q,u){"use strict";var H=new S.Cartesian2,K=new S.Cartesian3,Q=new S.Cartesian3,X=new S.Cartesian3,$=new S.Cartesian3;function d(t){var e=(t=Z.defaultValue(t,Z.defaultValue.EMPTY_OBJECT)).length,a=t.topRadius,r=t.bottomRadius,n=Z.defaultValue(t.vertexFormat,u.VertexFormat.DEFAULT),o=Z.defaultValue(t.slices,128);this._length=e,this._topRadius=a,this._bottomRadius=r,this._vertexFormat=u.VertexFormat.clone(n),this._slices=o,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}d.packedLength=u.VertexFormat.packedLength+5,d.pack=function(t,e,a){return a=Z.defaultValue(a,0),u.VertexFormat.pack(t._vertexFormat,e,a),a+=u.VertexFormat.packedLength,e[a++]=t._length,e[a++]=t._topRadius,e[a++]=t._bottomRadius,e[a++]=t._slices,e[a]=Z.defaultValue(t._offsetAttribute,-1),e};var a,p=new u.VertexFormat,f={vertexFormat:p,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};d.unpack=function(t,e,a){e=Z.defaultValue(e,0);var r=u.VertexFormat.unpack(t,e,p);e+=u.VertexFormat.packedLength;var n=t[e++],o=t[e++],i=t[e++],s=t[e++],m=t[e];return Z.defined(a)?(a._vertexFormat=u.VertexFormat.clone(r,a._vertexFormat),a._length=n,a._topRadius=o,a._bottomRadius=i,a._slices=s,a._offsetAttribute=-1===m?void 0:m,a):(f.length=n,f.topRadius=o,f.bottomRadius=i,f.slices=s,f.offsetAttribute=-1===m?void 0:m,new d(f))},d.createGeometry=function(t){var e=t._length,a=t._topRadius,r=t._bottomRadius,n=t._vertexFormat,o=t._slices;if(!(e<=0||a<0||r<0||0===a&&0===r)){var i,s=o+o,m=o+s,u=s+s,d=Y.CylinderGeometryLibrary.computePositions(e,a,r,o,!0),p=n.st?new Float32Array(2*u):void 0,f=n.normal?new Float32Array(3*u):void 0,y=n.tangent?new Float32Array(3*u):void 0,l=n.bitangent?new Float32Array(3*u):void 0,c=n.normal||n.tangent||n.bitangent;if(c){var b=n.tangent||n.bitangent,v=0,A=0,g=0,h=Math.atan2(r-a,e),x=K;x.z=Math.sin(h);var _=Math.cos(h),F=X,C=Q;for(i=0;i