/** * Cesium - https://github.com/CesiumGS/cesium * * Copyright 2011-2020 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details. */ define(["exports","./when-8d13db60","./Check-70bec281","./Math-61ede240","./Cartographic-f27b0939","./Cartesian2-09435a6c","./BoundingSphere-c409f092","./ComponentDatatype-5862616f","./GeometryAttribute-2243653a","./PrimitiveType-97893bc7","./GeometryAttributes-aacecde6","./IndexDatatype-9435b55f","./arrayFill-9766fb2e","./GeometryOffsetAttribute-999fc023","./VertexFormat-fe4db402"],function(e,ue,d,le,fe,ce,de,pe,Ce,ye,he,ve,_e,Ae,p){var be=new fe.Cartesian3,xe=new fe.Cartesian3,we=new fe.Cartesian3,ke=new fe.Cartesian3,Pe=new fe.Cartesian3,l=new fe.Cartesian3(1,1,1),Fe=Math.cos,ge=Math.sin;function C(e){e=ue.defaultValue(e,ue.defaultValue.EMPTY_OBJECT);var t=ue.defaultValue(e.radii,l),a=ue.defaultValue(e.innerRadii,t),r=ue.defaultValue(e.minimumClock,0),i=ue.defaultValue(e.maximumClock,le.CesiumMath.TWO_PI),n=ue.defaultValue(e.minimumCone,0),o=ue.defaultValue(e.maximumCone,le.CesiumMath.PI),m=Math.round(ue.defaultValue(e.stackPartitions,64)),s=Math.round(ue.defaultValue(e.slicePartitions,64)),u=ue.defaultValue(e.vertexFormat,p.VertexFormat.DEFAULT);if(s<3)throw new d.DeveloperError("options.slicePartitions cannot be less than three.");if(m<3)throw new d.DeveloperError("options.stackPartitions cannot be less than three.");this._radii=fe.Cartesian3.clone(t),this._innerRadii=fe.Cartesian3.clone(a),this._minimumClock=r,this._maximumClock=i,this._minimumCone=n,this._maximumCone=o,this._stackPartitions=m,this._slicePartitions=s,this._vertexFormat=p.VertexFormat.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}C.packedLength=2*fe.Cartesian3.packedLength+p.VertexFormat.packedLength+7,C.pack=function(e,t,a){if(!ue.defined(e))throw new d.DeveloperError("value is required");if(!ue.defined(t))throw new d.DeveloperError("array is required");return a=ue.defaultValue(a,0),fe.Cartesian3.pack(e._radii,t,a),a+=fe.Cartesian3.packedLength,fe.Cartesian3.pack(e._innerRadii,t,a),a+=fe.Cartesian3.packedLength,p.VertexFormat.pack(e._vertexFormat,t,a),a+=p.VertexFormat.packedLength,t[a++]=e._minimumClock,t[a++]=e._maximumClock,t[a++]=e._minimumCone,t[a++]=e._maximumCone,t[a++]=e._stackPartitions,t[a++]=e._slicePartitions,t[a]=ue.defaultValue(e._offsetAttribute,-1),t};var t,y=new fe.Cartesian3,h=new fe.Cartesian3,v=new p.VertexFormat,_={radii:y,innerRadii:h,vertexFormat:v,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};C.unpack=function(e,t,a){if(!ue.defined(e))throw new d.DeveloperError("array is required");t=ue.defaultValue(t,0);var r=fe.Cartesian3.unpack(e,t,y);t+=fe.Cartesian3.packedLength;var i=fe.Cartesian3.unpack(e,t,h);t+=fe.Cartesian3.packedLength;var n=p.VertexFormat.unpack(e,t,v);t+=p.VertexFormat.packedLength;var o=e[t++],m=e[t++],s=e[t++],u=e[t++],l=e[t++],f=e[t++],c=e[t];return ue.defined(a)?(a._radii=fe.Cartesian3.clone(r,a._radii),a._innerRadii=fe.Cartesian3.clone(i,a._innerRadii),a._vertexFormat=p.VertexFormat.clone(n,a._vertexFormat),a._minimumClock=o,a._maximumClock=m,a._minimumCone=s,a._maximumCone=u,a._stackPartitions=l,a._slicePartitions=f,a._offsetAttribute=-1===c?void 0:c,a):(_.minimumClock=o,_.maximumClock=m,_.minimumCone=s,_.maximumCone=u,_.stackPartitions=l,_.slicePartitions=f,_.offsetAttribute=-1===c?void 0:c,new C(_))},C.createGeometry=function(e){var t=e._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var a=e._innerRadii;if(!(a.x<=0||a.y<=0||a.z<=0)){var r,i,n=e._minimumClock,o=e._maximumClock,m=e._minimumCone,s=e._maximumCone,u=e._vertexFormat,l=e._slicePartitions+1,f=e._stackPartitions+1;(l=Math.round(l*Math.abs(o-n)/le.CesiumMath.TWO_PI))<2&&(l=2),(f=Math.round(f*Math.abs(s-m)/le.CesiumMath.PI))<2&&(f=2);var c=0,d=[m],p=[n];for(r=0;r