27 lines
9.4 KiB
Java
27 lines
9.4 KiB
Java
![]() |
/**
|
||
|
* @license
|
||
|
* Cesium - https://github.com/CesiumGS/cesium
|
||
|
* Version 1.109
|
||
|
*
|
||
|
* 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 be,b as Ne}from"./chunk-DMHOSKRF.js";import{a as Ae}from"./chunk-ITS5OBIO.js";import{a as ue}from"./chunk-6Z3TD6OI.js";import{a as ee}from"./chunk-YZMLQP2E.js";import"./chunk-YTG33ZHK.js";import"./chunk-LLBHZLGF.js";import"./chunk-YYMHH3T4.js";import"./chunk-ATQXFTWF.js";import{a as Ve}from"./chunk-67OQHZOZ.js";import{d as de}from"./chunk-NNIY7VTE.js";import"./chunk-NX64RCXJ.js";import{c as Se,d as Z}from"./chunk-5EDTRNG5.js";import"./chunk-IO6LETQ6.js";import{a as A,b as Ie,c as Ce}from"./chunk-C6Y3PRDH.js";import{a as N}from"./chunk-LI57NJAL.js";import"./chunk-IBAO62UG.js";import"./chunk-3NARV6MR.js";import"./chunk-P44SUSQU.js";import{a as V,b as q}from"./chunk-FUATUYJ3.js";import{e as f}from"./chunk-ODUTJJQ5.js";var ne={};ne.clipTriangleAtAxisAlignedThreshold=function(n,h,o,i,s,e){if(!f(n))throw new V("threshold is required.");if(!f(h))throw new V("keepAbove is required.");if(!f(o))throw new V("u0 is required.");if(!f(i))throw new V("u1 is required.");if(!f(s))throw new V("u2 is required.");f(e)?e.length=0:e=[];let g,w,c;h?(g=o<n,w=i<n,c=s<n):(g=o>n,w=i>n,c=s>n);let p=g+w+c,d,u,r,l,I,C;return p===1?g?(d=(n-o)/(i-o),u=(n-o)/(s-o),e.push(1),e.push(2),u!==1&&(e.push(-1),e.push(0),e.push(2),e.push(u)),d!==1&&(e.push(-1),e.push(0),e.push(1),e.push(d))):w?(r=(n-i)/(s-i),l=(n-i)/(o-i),e.push(2),e.push(0),l!==1&&(e.push(-1),e.push(1),e.push(0),e.push(l)),r!==1&&(e.push(-1),e.push(1),e.push(2),e.push(r))):c&&(I=(n-s)/(o-s),C=(n-s)/(i-s),e.push(0),e.push(1),C!==1&&(e.push(-1),e.push(2),e.push(1),e.push(C)),I!==1&&(e.push(-1),e.push(2),e.push(0),e.push(I))):p===2?!g&&o!==n?(l=(n-i)/(o-i),I=(n-s)/(o-s),e.push(0),e.push(-1),e.push(1),e.push(0),e.push(l),e.push(-1),e.push(2),e.push(0),e.push(I)):!w&&i!==n?(C=(n-s)/(i-s),d=(n-o)/(i-o),e.push(1),e.push(-1),e.push(2),e.push(1),e.push(C),e.push(-1),e.push(0),e.push(1),e.push(d)):!c&&s!==n&&(u=(n-o)/(s-o),r=(n-i)/(s-i),e.push(2),e.push(-1),e.push(0),e.push(2),e.push(u),e.push(-1),e.push(1),e.push(2),e.push(r)):p!==3&&(e.push(0),e.push(1),e.push(2)),e};ne.computeBarycentricCoordinates=function(n,h,o,i,s,e,g,w,c){if(!f(n))throw new V("x is required.");if(!f(h))throw new V("y is required.");if(!f(o))throw new V("x1 is required.");if(!f(i))throw new V("y1 is required.");if(!f(s))throw new V("x2 is required.");if(!f(e))throw new V("y2 is required.");if(!f(g))throw new V("x3 is required.");if(!f(w))throw new V("y3 is required.");let p=o-g,d=g-s,u=e-w,r=i-w,l=1/(u*p+d*r),I=h-w,C=n-g,R=(u*C+d*I)*l,O=(-r*C+p*I)*l,W=1-R-O;return f(c)?(c.x=R,c.y=O,c.z=W,c):new A(R,O,W)};ne.computeLineSegmentLineSegmentIntersection=function(n,h,o,i,s,e,g,w,c){q.typeOf.number("x00",n),q.typeOf.number("y00",h),q.typeOf.number("x01",o),q.typeOf.number("y01",i),q.typeOf.number("x10",s),q.typeOf.number("y10",e),q.typeOf.number("x11",g),q.typeOf.number("y11",w);let p=(g-s)*(h-e)-(w-e)*(n-s),d=(o-n)*(h-e)-(i-h)*(n-s),u=(w-e)*(o-n)-(g-s)*(i-h);if(u===0)return;let r=p/u,l=d/u;if(r>=0&&r<=1&&l>=0&&l<=1)return f(c)||(c=new Z),c.x=n+r*(o-n),c.y=h+r*(i-h),c};var ie=ne;var a=32767,z=a/2|0,Me=[],ze=[],Xe=[],te=new Ie,E=new A,Ke=[],We=[],Ye=[],Le=[],_e=[],Je=new A,Qe=new de,Ze=new ue,Ge=new Z,$e=new A;function je(n,h){let o=n.isEastChild,i=n.isNorthChild,s=o?z:0,e=o?a:z,g=i?z:0,w=i?a:z,c=Ke,p=We,d=Ye,u=_e;c.length=0,p.length=0,d.length=0,u.length=0;let r=Le;r.length=0;let l={},I=n.vertices,C=n.indices;C=C.subarray(0,n.indexCountWithoutSkirts);let R=Ne.clone(n.encoding),O=R.hasVertexNormals,W=0,Y=n.vertexCountWithoutSkirts,se=n.minimumHeight,ae=n.maximumHeight,D=new Array(Y),G=new Array(Y),L=new Array(Y),F=O?new Array(Y*2):void 0,$=20,H,t,k,x,y;for(t=0,k=0;t<Y;++t,k+=2){let v=R.decodeTextureCoordinates(I,t,Ge);if(H=R.decodeHeight(I,t),x=N.clamp(v.x*a|0,0,a),y=N.clamp(v.y*a|0,0,a),L[t]=N.clamp((H-se)/(ae-se)*a|0,0,a),x<$&&(x=0),y<$&&(y=0),a-x<$&&(x=a),a-y<$&&(y=a),D[t]=x,G[t]=y,O){let Q=R.getOctEncodedNormal(I,t,$e);F[k]=Q.x,F[k+1]=Q.y}(o&&x>=z||!o&&x<=z)&&(i&&y>=z||!i&&y<=z)&&(l[t]=W,c.push(x),p.push(y),d.push(L[t]),O&&(u.push(F[k]),u.push(F[k+1])),++W)}let T=[];T.push(new m),T.push(new m),T.push(new m);let B=[];B.push
|