/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.110.1 * * Copyright 2011-2022 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/main/LICENSE.md for full licensing details. */ import{a as Q}from"./chunk-KKOXNCV2.js";import{a as z}from"./chunk-HL2OONDA.js";import{a as _}from"./chunk-FEU4H2YL.js";import{a as K}from"./chunk-EUSUDYW7.js";import{a as H}from"./chunk-XYZU5ZKW.js";import{b as J,c as W,d as P}from"./chunk-ADEEKX5Q.js";import{d as j}from"./chunk-O5E7EBKP.js";import{d as k}from"./chunk-GMFQULD7.js";import{a as L}from"./chunk-IS523WNE.js";import{a as b}from"./chunk-4ZQSV4FU.js";import{a as Z}from"./chunk-CLQ5X6HS.js";import{a as x}from"./chunk-FOJGNIAW.js";import{a as F}from"./chunk-UGI536VH.js";import{e as g}from"./chunk-BQUQ5TPM.js";var M=new k,ot=new b,nt=new b,it=new b,st=new b;function O(t){t=x(t,x.EMPTY_OBJECT);let n=t.length,e=t.topRadius,h=t.bottomRadius,o=x(t.vertexFormat,_.DEFAULT),r=x(t.slices,128);if(!g(n))throw new F("options.length must be defined.");if(!g(e))throw new F("options.topRadius must be defined.");if(!g(h))throw new F("options.bottomRadius must be defined.");if(r<3)throw new F("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===z.TOP)throw new F("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))throw new F("value is required");if(!g(n))throw new F("array is required");return e=x(e,0),_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=x(t._offsetAttribute,-1),n};var X=new _,C={vertexFormat:X,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};O.unpack=function(t,n,e){if(!g(t))throw new F("array is required");n=x(n,0);let h=_.unpack(t,n,X);n+=_.packedLength;let o=t[n++],r=t[n++],p=t[n++],D=t[n++],w=t[n];return g(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=r,e._bottomRadius=p,e._slices=D,e._offsetAttribute=w===-1?void 0:w,e):(C.length=o,C.topRadius=r,C.bottomRadius=p,C.slices=D,C.offsetAttribute=w===-1?void 0:w,new O(C))};O.createGeometry=function(t){let n=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,r=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;let p=r+r,D=r+p,w=p+p,E=Q.computePositions(n,e,h,r,!0),N=o.st?new Float32Array(w*2):void 0,c=o.normal?new Float32Array(w*3):void 0,m=o.tangent?new Float32Array(w*3):void 0,u=o.bitangent?new Float32Array(w*3):void 0,i,U=o.normal||o.tangent||o.bitangent;if(U){let T=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);let B=Math.cos(q),R=it,y=nt;for(i=0;i