ts/public/js/Cesium2/Workers/chunk-YGBGLFI5.js

27 lines
14 KiB
JavaScript
Raw Normal View History

2025-01-06 01:18:58 +00:00
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
2025-01-13 08:45:08 +00:00
* Version 1.125
2025-01-06 01:18:58 +00:00
*
* 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.
*/
2025-01-13 08:45:08 +00:00
import{a as tt}from"./chunk-FAPED76U.js";import{a as At}from"./chunk-4MYAYFOP.js";import{a as yt}from"./chunk-FG3CL3AH.js";import{a as G}from"./chunk-N5SNKJ43.js";import{a as z}from"./chunk-6VK5R74O.js";import{a as at}from"./chunk-YFQNY2YN.js";import{a as ht}from"./chunk-NT26NNVH.js";import{b as mt,c as st,d as S}from"./chunk-NW2YE576.js";import{a as dt,d as rt}from"./chunk-2NIQ5ECB.js";import{f as it,h as bt}from"./chunk-7YEOLR2L.js";import{a as F}from"./chunk-QHHYYTCM.js";import{a,b as _t,c as W,d as v,e as R}from"./chunk-RH3GFHG2.js";import{a as I}from"./chunk-FRWNWNYJ.js";import{a as T}from"./chunk-TA3RE4KQ.js";import{a as nt,b as H}from"./chunk-RTY3VPG6.js";import{e as K}from"./chunk-LRNH5AEO.js";var et=new a,pt=new a,xt=new a,wt=new a,w=new W,Mt=new R,Vt=new R,gt=new it,Tt=new a,Nt=new a,Et=new a,lt=new _t,Pt=new a,Ft=new W,St=new W;function Ot(o,e,t){let n=e.vertexFormat,s=e.center,i=e.semiMajorAxis,r=e.semiMinorAxis,f=e.ellipsoid,h=e.stRotation,E=t?o.length/3*2:o.length/3,g=e.shadowVolume,c=n.st?new Float32Array(E*2):void 0,l=n.normal?new Float32Array(E*3):void 0,A=n.tangent?new Float32Array(E*3):void 0,x=n.bitangent?new Float32Array(E*3):void 0,O=g?new Float32Array(E*3):void 0,B=0,b=Tt,M=Nt,d=Et,_=new dt(f),L=_.project(f.cartesianToCartographic(s,lt),Pt),J=f.scaleToGeodeticSurface(s,et);f.geodeticSurfaceNormal(J,J);let Z=Mt,q=Vt;if(h!==0){let m=it.fromAxisAngle(J,h,gt);Z=R.fromQuaternion(m,Z),m=it.fromAxisAngle(J,-h,gt),q=R.fromQuaternion(m,q)}else Z=R.clone(R.IDENTITY,Z),q=R.clone(R.IDENTITY,q);let k=W.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ft),Q=W.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,St),j=o.length,y=t?j:0,p=y/3*2;for(let m=0;m<j;m+=3){let u=m+1,N=m+2,D=a.fromArray(o,m,et);if(n.st){let P=R.multiplyByVector(Z,D,pt),C=_.project(f.cartesianToCartographic(P,lt),xt);a.subtract(C,L,C),w.x=(C.x+i)/(2*i),w.y=(C.y+r)/(2*r),k.x=Math.min(w.x,k.x),k.y=Math.min(w.y,k.y),Q.x=Math.max(w.x,Q.x),Q.y=Math.max(w.y,Q.y),t&&(c[B+p]=w.x,c[B+1+p]=w.y),c[B++]=w.x,c[B++]=w.y}(n.normal||n.tangent||n.bitangent||g)&&(b=f.geodeticSurfaceNormal(D,b),g&&(O[m+y]=-b.x,O[u+y]=-b.y,O[N+y]=-b.z),(n.normal||n.tangent||n.bitangent)&&((n.tangent||n.bitangent)&&(M=a.normalize(a.cross(a.UNIT_Z,b,M),M),R.multiplyByVector(q,M,M)),n.normal&&(l[m]=b.x,l[u]=b.y,l[N]=b.z,t&&(l[m+y]=-b.x,l[u+y]=-b.y,l[N+y]=-b.z)),n.tangent&&(A[m]=M.x,A[u]=M.y,A[N]=M.z,t&&(A[m+y]=-M.x,A[u+y]=-M.y,A[N+y]=-M.z)),n.bitangent&&(d=a.normalize(a.cross(b,M,d),d),x[m]=d.x,x[u]=d.y,x[N]=d.z,t&&(x[m+y]=d.x,x[u+y]=d.y,x[N+y]=d.z))))}if(n.st){j=c.length;for(let m=0;m<j;m+=2)c[m]=(c[m]-k.x)/(Q.x-k.x),c[m+1]=(c[m+1]-k.y)/(Q.y-k.y)}let V=new ht;if(n.position){let m=tt.raisePositionsToHeight(o,e,t);V.position=new S({componentDatatype:F.DOUBLE,componentsPerAttribute:3,values:m})}if(n.st&&(V.st=new S({componentDatatype:F.FLOAT,componentsPerAttribute:2,values:c})),n.normal&&(V.normal=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:l})),n.tangent&&(V.tangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:A})),n.bitangent&&(V.bitangent=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:x})),g&&(V.extrudeDirection=new S({componentDatatype:F.FLOAT,componentsPerAttribute:3,values:O})),t&&K(e.offsetAttribute)){let m=new Uint8Array(E);if(e.offsetAttribute===G.TOP)m=m.fill(1,0,E/2);else{let u=e.offsetAttribute===G.NONE?0:1;m=m.fill(u)}V.applyOffset=new S({componentDatatype:F.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return V}function jt(o){let e=new Array(12*(o*(o+1))-6),t=0,n,s,i,r,f;for(n=0,i=1,r=0;r<3;r++)e[t++]=i++,e[t++]=n,e[t++]=i;for(r=2;r<o+1;++r){for(i=r*(r+1)-1,n=(r-1)*r-1,e[t++]=i++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;e[t++]=i++,e[t++]=n,e[t++]=i}for(s=o*2,++i,++n,r=0;r<s-1;++r)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;for(e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n++,e[t++]=n,++n,r=o-1;r>1;--r){for(e[t++]=n++,e[t++]=n,e[t++]=i,s=2*r,f=0;f<s-1;++f)e[t++]=i,e[t++]=n++,e[t++]=n,e[t++]=i++,e[t++]=n,e[t++]=i;