/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.137.0 * * 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-DAX2P4DI.js";import{c as W}from"./chunk-BNHFHP3L.js";import{j as k}from"./chunk-4NDD6KRQ.js";import{b as h}from"./chunk-5ELDAYCN.js";import{a as A}from"./chunk-N6BI774S.js";import{a as F,b as T,c as w}from"./chunk-ICY67TC6.js";import{a as s}from"./chunk-G2EMNOST.js";import{a as _}from"./chunk-4VFKVGYI.js";import{a as I,b as r}from"./chunk-3WJNS2B6.js";import{e as l}from"./chunk-XCN226AA.js";function b(e,t){r.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new s,this._cameraPositionInScaledSpace=new s,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(b.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let o=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=s.magnitudeSquared(o)-1;s.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=o,this._distanceToLimbInScaledSpaceSquared=n}}});var L=new s;b.prototype.isPointVisible=function(e){let o=this._ellipsoid.transformPositionToScaledSpace(e,L);return D(o,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};b.prototype.isScaledSpacePointVisible=function(e){return D(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var tt=new s;b.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let o=this._ellipsoid,n,i;return l(t)&&t<0&&o.minimumRadius>-t?(i=tt,i.x=this._cameraPosition.x/(o.radii.x+t),i.y=this._cameraPosition.y/(o.radii.y+t),i.z=this._cameraPosition.z/(o.radii.z+t),n=i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,n=this._distanceToLimbInScaledSpaceSquared),D(e,i,n)};b.prototype.computeHorizonCullingPoint=function(e,t,o){return Q(this._ellipsoid,e,t,o)};var U=w.clone(w.UNIT_SPHERE);b.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,o,n){let i=v(this._ellipsoid,o,U);return Q(i,e,t,n)};b.prototype.computeHorizonCullingPointFromVertices=function(e,t,o,n,i){return Z(this._ellipsoid,e,t,o,n,i)};b.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,o,n,i,c){let a=v(this._ellipsoid,i,U);return Z(a,e,t,o,n,c)};var et=[];b.prototype.computeHorizonCullingPointFromRectangle=function(e,t,o){r.typeOf.object("rectangle",e);let n=k.subsample(e,t,0,et),i=W.fromPoints(n);if(!(s.magnitude(i.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(i.center,n,o)};var ot=new s;function v(e,t,o){if(l(t)&&t<0&&e.minimumRadius>-t){let n=s.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,ot);e=w.fromCartesian3(n,o)}return e}function Q(e,t,o,n){r.typeOf.object("directionToPoint",t),r.defined("positions",o),l(n)||(n=new s);let i=K(e,t),c=0;for(let a=0,m=o.length;a0:a>i&&a*a/s.magnitudeSquared(c)>i)}var it=new s,nt=new s;function B(e,t,o){let n=e.transformPositionToScaledSpace(t,it),i=s.magnitudeSquared(n),c=Math.sqrt(i),a=s.divideByScalar(n,c,nt);i=Math.max(1,i),c=Math.max(1,c);let m=s.dot(a,o),d=s.magnitude(s.cross(a,o,a)),u=1/c,f=Math.sqrt(i-1)*u;return 1/(m*u-d*f)}function J(e,t,o){if(!(t<=0||t===1/0||t!==t))return s.multiplyByScalar(e,t,o)}var R=new s;function K(e,t){return s.equals(t,s.ZERO)?t:(e.transformPositionToScaledSpace(t,R),s.normalize(R,R))}var Nt=b;var j={};j.getHeight=function(e,t,o){if(!Number.isFinite(t))throw new I("scale must be a finite number.");if(!Number.isFinite(o))throw new I("relativeHeight must be a finite number.");return(e-o)*t+o};var at=new F;j.getPosition=function(e,t,o,n,i){let c=t.cartesianToCartographic(e,at);if(!l(c))return s.clone(e,i);let a=j.getHeight(c.height,o,n);return s.fromRadians(c.longitude,c.latitude,a,t,i)};var X=j;var st={NONE:0,BITS12:1},g=Object.freeze(st);var C=new s,ct=new s,N=new T,rt=new h,mt=new h,dt=Math.pow(2,12);function p(e,t,o,n,i,c,a,m,d,u){let f=g.NONE,O,S;if(l(t)&&l(o)&&l(n)&&l(i)){let z=t.minimum,G=t.maximum,x=s.subtract(G,z,ct),$=n-o;Math.max(s.maximumComponent(x),$)