27 lines
11 KiB
JavaScript
27 lines
11 KiB
JavaScript
![]() |
/**
|
||
|
* @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 $}from"./chunk-KGKEYLWF.js";import{a as Z}from"./chunk-ITS5OBIO.js";import{a as Q}from"./chunk-NHJ7LQMB.js";import{a as Y,b as D,c as W,d as X}from"./chunk-C6Y3PRDH.js";import{a as N}from"./chunk-LI57NJAL.js";import"./chunk-P44SUSQU.js";import"./chunk-FUATUYJ3.js";import{d as K,e as f}from"./chunk-ODUTJJQ5.js";var H=K($(),1),q;function tt(r,t,e,n,c,s){let o=e*(1-r)+n*r,u=c*(1-r)+s*r;return o*(1-t)+u*t}function P(r,t,e,n){let c=r+t*e;return n[c]}function et(r,t,e){let n=e.nativeExtent,c=(r-n.west)/(n.east-n.west)*(e.width-1),s=(t-n.south)/(n.north-n.south)*(e.height-1),o=Math.floor(c),u=Math.floor(s);c-=o,s-=u;let y=o<e.width?o+1:o,a=u<e.height?u+1:u;u=e.height-1-u,a=e.height-1-a;let l=P(o,u,e.width,e.buffer),i=P(y,u,e.width,e.buffer),w=P(o,a,e.width,e.buffer),A=P(y,a,e.width,e.buffer),p=tt(c,s,l,i,w,A);return p=p*e.scale+e.offset,p}function J(r,t,e){for(let n=0;n<e.length;n++){let c=e[n].nativeExtent,s=new Y;if(e[n].projectionType==="WebMercator"){let o=e[n].projection._ellipsoid._radii;s=new Q(new W(o.x,o.y,o.z)).project(new D(r,t,0))}else s.x=r,s.y=t;if(s.x>c.west&&s.x<c.east&&s.y>c.south&&s.y<c.north)return et(s.x,s.y,e[n])}return 0}function nt(r,t,e,n,c,s,o){if(o)return;let u=J(c.longitude,c.latitude,s);for(let y=0;y<r;++y){let a=J(c.longitude+N.toRadians(e*t[y*3]),c.latitude+N.toRadians(n*t[y*3+1]),s);t[y*3+2]+=a-u}}function rt(r,t,e,n,c,s,o,u,y){if(r===0||!f(t)||t.length===0)return;let a=new W(Math.sqrt(o.x),Math.sqrt(o.y),Math.sqrt(o.z));for(let l=0;l<r;++l){let i=l*3,w=i+1,A=i+2,p=new D;p.longitude=n.longitude+N.toRadians(u*t[i]),p.latitude=n.latitude+N.toRadians(y*t[w]),p.height=n.height+t[A];let h={};a.cartographicToCartesian(p,h),h.x-=c.x,h.y-=c.y,h.z-=c.z;let m={};if(X.multiplyByVector(s,h,m),t[i]=m.x,t[w]=m.y,t[A]=m.z,f(e)){let C=new Y(e[i],e[w],e[A]),x={};X.multiplyByVector(s,C,x),e[i]=x.x,e[w]=x.y,e[A]=x.z}}}function ot(r,t,e){for(let n=0;n<r;++n){let c=e[n*4]/65535,s=e[n*4+1]/65535,o=(e[n*4+2]-e[n*4])/65535,u=(e[n*4+3]-e[n*4+1])/65535;t[n*2]*=o,t[n*2]+=c,t[n*2+1]*=u,t[n*2+1]+=s}}function st(r,t,e,n,c,s){if(r===0||!f(e)||e.length===0)return{buffers:[],bufferViews:[],accessors:[],meshes:[],nodes:[],nodesInScene:[]};let o=[],u=[],y=[],a=[],l=[],i=[];f(t)&&(r=t.length);let w=new Uint32Array(r);if(f(t))for(let b=0;b<r;++b)w[b]=t[b];else for(let b=0;b<r;++b)w[b]=b;let A=new Blob([w],{type:"application/binary"}),p=URL.createObjectURL(A),h=r,m=e.subarray(0,h*3),C=new Blob([m],{type:"application/binary"}),x=URL.createObjectURL(C),I=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,O=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,U=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let b=0;b<m.length/3;b++)I=Math.min(I,m[b*3+0]),g=Math.max(g,m[b*3+0]),O=Math.min(O,m[b*3+1]),L=Math.max(L,m[b*3+1]),U=Math.min(U,m[b*3+2]),j=Math.max(j,m[b*3+2]);let R=n?n.subarray(0,h*3):void 0,S;if(f(R)){let b=new Blob([R],{type:"application/binary"});S=URL.createObjectURL(b)}let _=c?c.subarray(0,h*2):void 0,k;if(f(_)){let b=new Blob([_],{type:"application/binary"});k=URL.createObjectURL(b)}let T=f(s)?s.subarray(0,h*4):void 0,z;if(f(T)){let b=new Blob([T],{type:"application/binary"});z=URL.createObjectURL(b)}let E=0,G=0,B=0,F=0,M=0,d=E,V={};return V.POSITION=E,o.push({uri:x,byteLength:m.byteLength}),u.push({buffer:E,byteOffset:0,byteLength:m.byteLength,target:34962}),y.push({bufferView:E,byteOffset:0,componentType:5126,count:r,type:"VEC3",max:[I,O,U],min:[g,L,j]}),f(S)&&(++d,G=d,V.NORMAL=G,o.push({uri:S,byteLength:R.byteLength}),u.push({buffer:G,byteOffset:0,byteLength:R.byteLength,target:34962}),y.push({bufferView:G,byteOffset:0,componentType:5126,count:r,type:"VEC3"})),f(k)&&(++d,B=d,V.TEXCOORD_0=B,o.push({uri:k,byteLength:_.byteLength}),u.push({buffer:B,byteOffset:0,byteLength:_.byteLength,target:34962}),y.push({bufferView:B,byteOffset:0,componentType:5126,count:r,type:"VEC2"})),f(z)&&(++d,F=d,V.COLOR_0=F,o.push({uri:z,byteLength:T.byteLength}),u.push({buffer:F,byteOffset:0,byteLength:T.byteLength,target:34962}),y.push({bufferView:F,byteOffset:0,componentType:5121,normalized:!0,count:r,type:"VEC4"})),++d,M=
|