NuclearDispersionSystem/ant-design-vue-jeecg/public/Cesium/Workers/createPolygonGeometry.js

27 lines
15 KiB
JavaScript
Raw Normal View History

2023-09-18 11:40:16 +08:00
/**
* @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 _t}from"./chunk-EHYESN44.js";import{a as D}from"./chunk-AJGH25BB.js";import{a as K}from"./chunk-6A32WNKQ.js";import{a as nt}from"./chunk-GSCCE6TP.js";import{a as yt}from"./chunk-GH2M3QEY.js";import"./chunk-YZMLQP2E.js";import"./chunk-BSOA334C.js";import{a as mt}from"./chunk-LQRZQ5E6.js";import{a as at}from"./chunk-YYCOBWZH.js";import{a as z}from"./chunk-M3OLDEEW.js";import{a as ct}from"./chunk-YTG33ZHK.js";import"./chunk-LLBHZLGF.js";import{a as ft,b as tt}from"./chunk-MUMMGJJL.js";import"./chunk-RUSF25XT.js";import"./chunk-Y5NK5HSS.js";import"./chunk-YYMHH3T4.js";import"./chunk-ATQXFTWF.js";import{a as st}from"./chunk-67OQHZOZ.js";import"./chunk-FUN3J34G.js";import{c as ut,d as q}from"./chunk-A4RD4IQP.js";import{d as dt,f as rt}from"./chunk-NNIY7VTE.js";import"./chunk-NX64RCXJ.js";import{c as ht,d as X}from"./chunk-5EDTRNG5.js";import{a as Q}from"./chunk-IO6LETQ6.js";import{a as u,b as $,c as V,d as k}from"./chunk-C6Y3PRDH.js";import{a as B}from"./chunk-LI57NJAL.js";import"./chunk-IBAO62UG.js";import"./chunk-3NARV6MR.js";import{a as w}from"./chunk-P44SUSQU.js";import{a as it,b as Y}from"./chunk-FUATUYJ3.js";import{e as A}from"./chunk-ODUTJJQ5.js";var Ht=new $,Pt=new $;function Et(t,e,o,r){let d=r.cartesianToCartographic(t,Ht).height,a=r.cartesianToCartographic(e,Pt);a.height=d,r.cartographicToCartesian(a,e);let l=r.cartesianToCartographic(o,Pt);l.height=d-100,r.cartographicToCartesian(l,o)}var Ot=new _t,xt=new u,Ct=new u,Rt=new u,Nt=new u,vt=new u,Dt=new u,lt=new u,j=new u,et=new u,Ft=new X,It=new X,Lt=new u,bt=new rt,St=new k,Bt=new k;function pt(t){let e=t.vertexFormat,o=t.geometry,r=t.shadowVolume,n=o.attributes.position.values,d=A(o.attributes.st)?o.attributes.st.values:void 0,a=n.length,l=t.wall,m=t.top||l,g=t.bottom||l;if(e.st||e.normal||e.tangent||e.bitangent||r){let p=t.boundingRectangle,i=t.tangentPlane,P=t.ellipsoid,C=t.stRotation,F=t.perPositionHeight,L=Ft;L.x=p.x,L.y=p.y;let R=e.st?new Float32Array(2*(a/3)):void 0,b;e.normal&&(F&&m&&!l?b=o.attributes.normal.values:b=new Float32Array(a));let c=e.tangent?new Float32Array(a):void 0,N=e.bitangent?new Float32Array(a):void 0,E=r?new Float32Array(a):void 0,O=0,h=0,y=Ct,s=Rt,_=Nt,H=!0,M=St,U=Bt;if(C!==0){let I=rt.fromAxisAngle(i._plane.normal,C,bt);M=k.fromQuaternion(I,M),I=rt.fromAxisAngle(i._plane.normal,-C,bt),U=k.fromQuaternion(I,U)}else M=k.clone(k.IDENTITY,M),U=k.clone(k.IDENTITY,U);let f=0,x=0;m&&g&&(f=a/2,x=a/3,a/=2);for(let I=0;I<a;I+=3){let S=u.fromArray(n,I,Lt);if(e.st&&!A(d)){let T=k.multiplyByVector(M,S,xt);T=P.scaleToGeodeticSurface(T,T);let v=i.projectPointOntoPlane(T,It);X.subtract(v,L,v);let W=B.clamp(v.x/p.width,0,1),J=B.clamp(v.y/p.height,0,1);g&&(R[O+x]=W,R[O+1+x]=J),m&&(R[O]=W,R[O+1]=J),O+=2}if(e.normal||e.tangent||e.bitangent||r){let T=h+1,v=h+2;if(l){if(I+3<a){let W=u.fromArray(n,I+3,vt);if(H){let J=u.fromArray(n,I+a,Dt);F&&Et(S,W,J,P),u.subtract(W,S,W),u.subtract(J,S,J),y=u.normalize(u.cross(J,W,y),y),H=!1}u.equalsEpsilon(W,S,B.EPSILON10)&&(H=!0)}(e.tangent||e.bitangent)&&(_=P.geodeticSurfaceNormal(S,_),e.tangent&&(s=u.normalize(u.cross(_,y,s),s)))}else y=P.geodeticSurfaceNormal(S,y),(e.tangent||e.bitangent)&&(F&&(lt=u.fromArray(b,h,lt),j=u.cross(u.UNIT_Z,lt,j),j=u.normalize(k.multiplyByVector(U,j,j),j),e.bitangent&&(et=u.normalize(u.cross(lt,j,et),et))),s=u.cross(u.UNIT_Z,y,s),s=u.normalize(k.multiplyByVector(U,s,s),s),e.bitangent&&(_=u.normalize(u.cross(y,s,_),_)));e.normal&&(t.wall?(b[h+f]=y.x,b[T+f]=y.y,b[v+f]=y.z):g&&(b[h+f]=-y.x,b[T+f]=-y.y,b[v+f]=-y.z),(m&&!F||l)&&(b[h]=y.x,b[T]=y.y,b[v]=y.z)),r&&(l&&(y=P.geodeticSurfaceNormal(S,y)),E[h+f]=-y.x,E[T+f]=-y.y,E[v+f]=-y.z),e.tangent&&(t.wall?(c[h+f]=s.x,c[T+f]=s.y,c[v+f]=s.z):g&&(c[h+f]=-s.x,c[T+f]=-s.y,c[v+f]=-s.z),m&&(F?(c[h]=j.x,c[T]=j.y,c[v]=j.z):(c[h]=s.x,c[T]=s.y,c[v]=s.z))),e.bitangent&&(g&&(N[h+f]=_.x,N[T+f]=_.y,N[v+f]=_.z),m&&(F?(N[h]=et.x,N[T]=et.y,N[v]=et.z):(N[h]=_.x,N[T]=_.y,N[v]=_.z))),h+=3}}e.st&&!A(d)&&(o.attributes.st=new q({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:R})),e.normal&&(o.attributes.normal=new q({componentDatatype:Q.FLOAT,components