/* 2020-9-22 15:23:25 | 版权所有 军懋国兴 */ define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Math-69007a69","./Cartesian2-43e3a3be","./Transforms-2d1ac5ec","./ComponentDatatype-607c9a0c","./GeometryAttribute-2303bbfb","./GeometryAttributes-90846c5f","./IndexDatatype-79bb407c","./GeometryOffsetAttribute-9c676324","./VertexFormat-fe64931e","./CylinderGeometryLibrary-ea3f4c29"],function(e,I,m,U,S,q,B,Y,Z,J,W,f,j){"use strict";var H=new S.Cartesian2,K=new S.Cartesian3,Q=new S.Cartesian3,X=new S.Cartesian3,$=new S.Cartesian3;function d(e){var t=(e=I.defaultValue(e,I.defaultValue.EMPTY_OBJECT)).length,r=e.topRadius,a=e.bottomRadius,o=I.defaultValue(e.vertexFormat,f.VertexFormat.DEFAULT),n=I.defaultValue(e.slices,128);if(!I.defined(t))throw new m.DeveloperError("options.length must be defined.");if(!I.defined(r))throw new m.DeveloperError("options.topRadius must be defined.");if(!I.defined(a))throw new m.DeveloperError("options.bottomRadius must be defined.");if(n<3)throw new m.DeveloperError("options.slices must be greater than or equal to 3.");if(I.defined(e.offsetAttribute)&&e.offsetAttribute===W.GeometryOffsetAttribute.TOP)throw new m.DeveloperError("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=r,this._bottomRadius=a,this._vertexFormat=f.VertexFormat.clone(o),this._slices=n,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}d.packedLength=f.VertexFormat.packedLength+5,d.pack=function(e,t,r){if(!I.defined(e))throw new m.DeveloperError("value is required");if(!I.defined(t))throw new m.DeveloperError("array is required");return r=I.defaultValue(r,0),f.VertexFormat.pack(e._vertexFormat,t,r),r+=f.VertexFormat.packedLength,t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r++]=e._slices,t[r]=I.defaultValue(e._offsetAttribute,-1),t};var t,p=new f.VertexFormat,l={vertexFormat:p,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};d.unpack=function(e,t,r){if(!I.defined(e))throw new m.DeveloperError("array is required");t=I.defaultValue(t,0);var a=f.VertexFormat.unpack(e,t,p);t+=f.VertexFormat.packedLength;var o=e[t++],n=e[t++],i=e[t++],s=e[t++],u=e[t];return I.defined(r)?(r._vertexFormat=f.VertexFormat.clone(a,r._vertexFormat),r._length=o,r._topRadius=n,r._bottomRadius=i,r._slices=s,r._offsetAttribute=-1===u?void 0:u,r):(l.length=o,l.topRadius=n,l.bottomRadius=i,l.slices=s,l.offsetAttribute=-1===u?void 0:u,new d(l))},d.createGeometry=function(e){var t=e._length,r=e._topRadius,a=e._bottomRadius,o=e._vertexFormat,n=e._slices;if(!(t<=0||r<0||a<0||0===r&&0===a)){var i=n+n,s=n+i,u=i+i,m=j.CylinderGeometryLibrary.computePositions(t,r,a,n,!0),f=o.st?new Float32Array(2*u):void 0,d=o.normal?new Float32Array(3*u):void 0,p=o.tangent?new Float32Array(3*u):void 0,l=o.bitangent?new Float32Array(3*u):void 0,y=o.normal||o.tangent||o.bitangent;if(y){var b=o.tangent||o.bitangent,c=0,v=0,A=0,h=Math.atan2(a-r,t),w=K;w.z=Math.sin(h);for(var g=Math.cos(h),x=X,_=Q,C=0;C