define(["exports","./GeometryOffsetAttribute-def3b741","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./ComponentDatatype-9204e9f6","./CylinderGeometryLibrary-daf6cec5","./when-208fe5b0","./Check-d18af7c4","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./IndexDatatype-d47ad6f6","./Math-4e53b694","./VertexFormat-e8cbf5b3"],function(t,P,k,M,z,E,N,e,I,U,S,B,m){"use strict";var Y=new M.Cartesian2,Z=new M.Cartesian3,J=new M.Cartesian3,W=new M.Cartesian3,j=new M.Cartesian3;function u(t){var e=(t=N.defaultValue(t,N.defaultValue.EMPTY_OBJECT)).length,a=t.topRadius,r=t.bottomRadius,n=N.defaultValue(t.vertexFormat,m.VertexFormat.DEFAULT),o=N.defaultValue(t.slices,128);this._length=e,this._topRadius=a,this._bottomRadius=r,this._vertexFormat=m.VertexFormat.clone(n),this._slices=o,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}u.packedLength=m.VertexFormat.packedLength+5,u.pack=function(t,e,a){return a=N.defaultValue(a,0),m.VertexFormat.pack(t._vertexFormat,e,a),a+=m.VertexFormat.packedLength,e[a++]=t._length,e[a++]=t._topRadius,e[a++]=t._bottomRadius,e[a++]=t._slices,e[a]=N.defaultValue(t._offsetAttribute,-1),e};var a,d=new m.VertexFormat,f={vertexFormat:d,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};u.unpack=function(t,e,a){e=N.defaultValue(e,0);var r=m.VertexFormat.unpack(t,e,d);e+=m.VertexFormat.packedLength;var n=t[e++],o=t[e++],i=t[e++],s=t[e++],e=t[e];return N.defined(a)?(a._vertexFormat=m.VertexFormat.clone(r,a._vertexFormat),a._length=n,a._topRadius=o,a._bottomRadius=i,a._slices=s,a._offsetAttribute=-1===e?void 0:e,a):(f.length=n,f.topRadius=o,f.bottomRadius=i,f.slices=s,f.offsetAttribute=-1===e?void 0:e,new u(f))},u.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=o+o,s=o+i,m=i+i,u=E.CylinderGeometryLibrary.computePositions(e,a,r,o,!0),d=n.st?new Float32Array(2*m):void 0,f=n.normal?new Float32Array(3*m):void 0,p=n.tangent?new Float32Array(3*m):void 0,y=n.bitangent?new Float32Array(3*m):void 0,l=n.normal||n.tangent||n.bitangent;if(l){var b=n.tangent||n.bitangent,c=0,v=0,A=0,g=Math.atan2(r-a,e),h=Z;h.z=Math.sin(g);for(var x=Math.cos(g),_=W,C=J,F=0;F