/** * @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 y}from"./chunk-CAKU43HZ.js";import{d as F}from"./chunk-O5E7EBKP.js";import{b as d,c as W,d as x}from"./chunk-GMFQULD7.js";import{a as A}from"./chunk-IS523WNE.js";import{a as s,c as M}from"./chunk-4ZQSV4FU.js";import{a as q}from"./chunk-CLQ5X6HS.js";import{a as P}from"./chunk-FOJGNIAW.js";import{b as z}from"./chunk-UGI536VH.js";import{e as u}from"./chunk-BQUQ5TPM.js";function T(o,t){z.typeOf.object("ellipsoid",o),this._ellipsoid=o,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,u(t)&&(this.cameraPosition=t)}Object.defineProperties(T.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,this._cameraPositionInScaledSpace),a=s.magnitudeSquared(e)-1;s.clone(o,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=a}}});var L=new s;T.prototype.isPointVisible=function(o){let e=this._ellipsoid.transformPositionToScaledSpace(o,L);return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};T.prototype.isScaledSpacePointVisible=function(o){return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var et=new s;T.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(o,t){let e=this._ellipsoid,a,i;return u(t)&&t<0&&e.minimumRadius>-t?(i=et,i.x=this._cameraPosition.x/(e.radii.x+t),i.y=this._cameraPosition.y/(e.radii.y+t),i.z=this._cameraPosition.z/(e.radii.z+t),a=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,a=this._distanceToLimbInScaledSpaceSquared),D(o,i,a)};T.prototype.computeHorizonCullingPoint=function(o,t,e){return Z(this._ellipsoid,o,t,e)};var j=M.clone(M.UNIT_SPHERE);T.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,t,e,a){let i=U(this._ellipsoid,e,j);return Z(i,o,t,a)};T.prototype.computeHorizonCullingPointFromVertices=function(o,t,e,a,i){return v(this._ellipsoid,o,t,e,a,i)};T.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,t,e,a,i,c){let n=U(this._ellipsoid,i,j);return v(n,o,t,e,a,c)};var it=[];T.prototype.computeHorizonCullingPointFromRectangle=function(o,t,e){z.typeOf.object("rectangle",o);let a=W.subsample(o,t,0,it),i=F.fromPoints(a);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,a,e)};var at=new s;function U(o,t,e){if(u(t)&&t<0&&o.minimumRadius>-t){let a=s.fromElements(o.radii.x+t,o.radii.y+t,o.radii.z+t,at);o=M.fromCartesian3(a,e)}return o}function Z(o,t,e,a){z.typeOf.object("directionToPoint",t),z.defined("positions",e),u(a)||(a=new s);let i=K(o,t),c=0;for(let n=0,r=e.length;n0:n>i&&n*n/s.magnitudeSquared(c)>i)}var nt=new s,st=new s;function Q(o,t,e){let a=o.transformPositionToScaledSpace(t,nt),i=s.magnitudeSquared(a),c=Math.sqrt(i),n=s.divideByScalar(a,c,st);i=Math.max(1,i),c=Math.max(1,c);let r=s.dot(n,e),m=s.magnitude(s.cross(n,e,n)),l=1/c,p=Math.sqrt(i-1)*l;return 1/(r*l-m*p)}function J(o,t,e){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(o,t,e)}var R=new s;function K(o,t){return s.equals(t,s.ZERO)?t:(o.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var xt=T;var b={};b.getHeight=function(o,t,e){return(o-e)*t+e};var ct=new s;b.getPosition=function(o,t,e,a,i){let c=t.cartesianToCartographic(o,ct),n=b.getHeight(c.height,e,a);return s.fromRadians(c.longitude,c.latitude,n,t,i)};var X=b;var rt={NONE:0,BITS12:1},S=Object.freeze(rt);var C=new s,mt=new s,f=new x,G=new d,dt=new d,lt=Math.pow(2,12);function h(o,t,e,a,i,c,n,r,m,l){let p=S.NONE,g,N;if(u(t)&&u(e)&&u(a)&&u(i)){let E=t.minimum,I=t.maximum,_=s.subtract(I,E,mt),$=a-e;Math.max(s.maximumComponent(_),$)