You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
31 KiB
27 lines
31 KiB
4 weeks ago
|
/**
|
||
|
* @license
|
||
|
* Cesium - https://github.com/CesiumGS/cesium
|
||
|
* Version 1.128
|
||
|
*
|
||
|
* 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 tt}from"./chunk-IO56Q3JU.js";import{a as jt}from"./chunk-ZSUHEXD2.js";import{b as Lt}from"./chunk-YTKWBMG6.js";import{a as Et}from"./chunk-OIUXC5BJ.js";import{a as j}from"./chunk-CFEBEP3P.js";import{a as dt,b as D,c as B,d as U}from"./chunk-D2WGDEJE.js";import{a as _t,b as Ut,d as ot}from"./chunk-LS5UR5C2.js";import{a as pt,b as H}from"./chunk-GSQ5TTBU.js";import{a as F}from"./chunk-MCJA36VG.js";import{a as r,b as Mt,c as V,e as gt,f as Ot}from"./chunk-KLDIEE7M.js";import{a as N}from"./chunk-BF7B4FIR.js";import{a as I,b as ft}from"./chunk-IQDUXDOM.js";import{e as f}from"./chunk-GDY26PU3.js";var Yt=new r,Zt=new r,Xt=new r;function pe(t,e,n,s,i){ft.defined("point",t),ft.defined("p0",e),ft.defined("p1",n),ft.defined("p2",s),f(i)||(i=new r);let c,o,a,p,u,d,m,l;if(f(e.z)){if(r.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(r.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(r.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=r.subtract(n,e,Yt),o=r.subtract(s,e,Zt),a=r.subtract(t,e,Xt),p=r.dot(c,c),u=r.dot(c,o),d=r.dot(c,a),m=r.dot(o,o),l=r.dot(o,a)}else{if(V.equalsEpsilon(t,e,N.EPSILON14))return r.clone(r.UNIT_X,i);if(V.equalsEpsilon(t,n,N.EPSILON14))return r.clone(r.UNIT_Y,i);if(V.equalsEpsilon(t,s,N.EPSILON14))return r.clone(r.UNIT_Z,i);c=V.subtract(n,e,Yt),o=V.subtract(s,e,Zt),a=V.subtract(t,e,Xt),p=V.dot(c,c),u=V.dot(c,o),d=V.dot(c,a),m=V.dot(o,o),l=V.dot(o,a)}i.y=m*d-u*l,i.z=p*l-u*d;let h=p*m-u*u;if(h!==0)return i.y/=h,i.z/=h,i.x=1-i.y-i.z,i}var Ht=pe;var Nt={};Nt.calculateACMR=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24;if(!f(e))throw new I("indices is required.");let i=e.length;if(i<3||i%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");if(!f(n)){n=0;let a=0,p=e[a];for(;a<i;)p>n&&(n=p),++a,p=e[a]}let c=[];for(let a=0;a<n+1;a++)c[a]=0;let o=s+1;for(let a=0;a<i;++a)o-c[e[a]]>s&&(c[e[a]]=o,++o);return(o-s+1)/(i/3)};Nt.tipsify=function(t){t=t??Ot.EMPTY_OBJECT;let e=t.indices,n=t.maximumIndex,s=t.cacheSize??24,i;function c(C,z,q,R){for(;z.length>=1;){let G=z[z.length-1];if(z.splice(z.length-1,1),C[G].numLiveTriangles>0)return G}for(;i<R;){if(C[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(C,z,q,R,G,M,J){let Y=-1,_,St=-1,Pt=0;for(;Pt<q.length;){let lt=q[Pt];R[lt].numLiveTriangles&&(_=0,G-R[lt].timeStamp+2*R[lt].numLiveTriangles<=z&&(_=G-R[lt].timeStamp),(_>St||St===-1)&&(St=_,Y=lt)),++Pt}return Y===-1?c(R,M,C,J):Y}if(!f(e))throw new I("indices is required.");let a=e.length;if(a<3||a%3!==0)throw new I("indices length must be a multiple of three.");if(n<=0)throw new I("maximumIndex must be greater than zero.");if(s<3)throw new I("cacheSize must be greater than two.");let p=0,u=0,d=e[u],m=a;if(f(n))p=n+1;else{for(;u<m;)d>p&&(p=d),++u,d=e[u];if(p===-1)return 0;++p}let l=[],h;for(h=0;h<p;h++)l[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let y=0;for(;u<m;)l[e[u]].vertexTriangles.push(y),++l[e[u]].numLiveTriangles,l[e[u+1]].vertexTriangles.push(y),++l[e[u+1]].numLiveTriangles,l[e[u+2]].vertexTriangles.push(y),++l[e[u+2]].numLiveTriangles,++y,u+=3;let v=0,b=s+1;i=1;let S=[],x=[],w,A,E=0,P=[],O=a/3,L=[];for(h=0;h<O;h++)L[h]=!1;let g,T;for(;v!==-1;){S=[],A=l[v],T=A.vertexTriangles.length;for(let C=0;C<T;++C)if(y=A.vertexTriangles[C],!L[y]){L[y]=!0,u=y+y+y;for(let z=0;z<3;++z)g=e[u],S.push(g),x.push(g),P[E]=g,++E,w=l[g],--w.numLiveTriangles,b-w.timeStamp>s&&(w.timeStamp=b,++b),++u}v=o(e,s,S,l,b,x,p)}return P};var Wt=Nt;var k={};function It(t,e,n,s,i){t[e++]=n,t[e++]=s,t[e++]=s,t[e++]=i,t[e++]=i,t[e]=n}function de(t){let e=t.length,n=e/3*6,s=j.createTypedArray(e,n),i=0;for(let c=0;c<e;c+=3,i+=6)It(s,i,t[c],t[c+1],t[c+2]);return s}function me(t){let e=t.length;if(e>=3){let n=(e-2)*6,s=j.createTypedArray(e,n);It(s,0,t[0],t[1],t[2]);let i=6;for(let c=3;c<e;++c,i+=6)It(s,i,t[c-1],t[c],t[c-2]);return s}return new Uint16Array}function he(t){if(t.length>0){let e=t.length-1,n=(e-1)*6,s=j.createTy
|