/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.120.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 k,b as _,c as j}from"./chunk-MSGLY7UN.js";import"./chunk-7QS2ZEBL.js";import"./chunk-A2J5OJ74.js";import{a as A}from"./chunk-WGB3L4DG.js";import{b as N,c as g,d as F}from"./chunk-VT3S74KG.js";import{d as T}from"./chunk-JYT7LKWQ.js";import{f as s}from"./chunk-DPXXHKCX.js";import{a as b}from"./chunk-UTQP35IH.js";import{a}from"./chunk-S74IVKSO.js";import"./chunk-XQPFZTAL.js";import"./chunk-CYX2VK56.js";import"./chunk-A5LGJSYE.js";import{a as d}from"./chunk-CDFKIAC5.js";import{b as h}from"./chunk-DRUYFASX.js";import{e as w}from"./chunk-A4U73JJE.js";var L=0,C=1;function l(e){h.typeOf.object("options",e),h.typeOf.object("options.frustum",e.frustum),h.typeOf.object("options.origin",e.origin),h.typeOf.object("options.orientation",e.orientation);let t,n,r=e.frustum,o=e.orientation,i=e.origin,u=d(e._drawNearPlane,!0);r instanceof _?(t=L,n=_.packedLength):r instanceof k&&(t=C,n=k.packedLength),this._frustumType=t,this._frustum=r.clone(),this._origin=a.clone(i),this._orientation=s.clone(o),this._drawNearPlane=u,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+n+a.packedLength+s.packedLength}l.pack=function(e,t,n){h.typeOf.object("value",e),h.defined("array",t),n=d(n,0);let r=e._frustumType,o=e._frustum;return t[n++]=r,r===L?(_.pack(o,t,n),n+=_.packedLength):(k.pack(o,t,n),n+=k.packedLength),a.pack(e._origin,t,n),n+=a.packedLength,s.pack(e._orientation,t,n),n+=s.packedLength,t[n]=e._drawNearPlane?1:0,t};var E=new _,G=new k,R=new s,S=new a;l.unpack=function(e,t,n){h.defined("array",e),t=d(t,0);let r,o=e[t++];o===L?(r=_.unpack(e,t,E),t+=_.packedLength):(r=k.unpack(e,t,G),t+=k.packedLength);let i=a.unpack(e,t,S);t+=a.packedLength;let u=s.unpack(e,t,R);t+=s.packedLength;let c=1===e[t];if(!w(n))return new l({frustum:r,origin:i,orientation:u,_drawNearPlane:c});let p=o===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(p),n._frustumType=o,n._origin=a.clone(i,n._origin),n._orientation=s.clone(u,n._orientation),n._drawNearPlane=c,n},l.createGeometry=function(e){let t=e._frustumType,n=e._frustum,r=e._origin,a=e._orientation,o=e._drawNearPlane,i=new Float64Array(24);j._computeNearFarPlanes(r,a,t,n,i);let s,u,c=new A({position:new F({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:i})}),p=o?2:1,m=new Uint16Array(8*(p+1)),k=o?0:1;for(;k<2;++k)s=o?8*k:0,u=4*k,m[s]=u,m[s+1]=u+1,m[s+2]=u+1,m[s+3]=u+2,m[s+4]=u+2,m[s+5]=u+3,m[s+6]=u+3,m[s+7]=u;for(k=0;k<2;++k)s=8*(p+k),u=4*k,m[s]=u,m[s+1]=u+4,m[s+2]=u+1,m[s+3]=u+5,m[s+4]=u+2,m[s+5]=u+6,m[s+6]=u+3,m[s+7]=u+7;return new g({attributes:c,indices:m,primitiveType:N.LINES,boundingSphere:T.fromVertices(i)})};var O=l;function D(e,t){return w(t)&&(e=O.unpack(e,t)),O.createGeometry(e)}var I=D;export{I as default};