Agriculture-front-end/dist/Cesium/Workers/S3MTilesParser.js

2 lines
10 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["./createTaskProcessorWorker","./ComponentDatatype-c140a87d","./Color-5008547b","./S3MCompressType-4145c64c","./pako_inflate-f73548c4","./when-b60132fc","./Check-7b2a090c","./WebGLConstants-4ae0db90","./FeatureDetection-c3b71206","./Math-119be1a3","./RuntimeError-4a5c8994","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./Cartesian2-47311507","./Cartesian4-3ca25aab","./BoundingRectangle-01b3e970","./PrimitiveType-39acab88","./IndexDatatype-8a5eead4"],(function(t,e,n,r,a,i,E,o,s,y,T,p,A,_,u,v,c,B){"use strict";function f(t,e,n,r,a,i){this.left=t,this.bottom=e,this.right=n,this.top=r,this.minHeight=a,this.maxHeight=i,this.width=n-t,this.length=r-e,this.height=i-a}function m(t,n,r,a,i){var E=r.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var o=0,s={},y=s.vertexAttributes=[],T=s.attrLocation={};s.instanceCount=0,s.instanceMode=0;var p=0;r.getUint32(a,!0),a+=Uint32Array.BYTES_PER_ELEMENT;var A=r.getUint16(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;var _=A;A>4&&(_=A>>8,A&=15);var u=r.getUint32(a,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,u>0){var v=r.getUint16(a,!0);v=A*Float32Array.BYTES_PER_ELEMENT,a+=Uint32Array.BYTES_PER_ELEMENT,o=u*v,T.aPosition=p,y.push({index:T.aPosition,typedArray:n.subarray(a,a+o),componentsPerAttribute:A,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:v,normalize:!1}),p++,a+=o}var c=r.getUint32(a,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,c>0){var B=r.getUint16(a,!0);B=_*Float32Array.BYTES_PER_ELEMENT,a+=Uint32Array.BYTES_PER_ELEMENT,o=c*B,t.ignoreNormal||(T.aNormal=p,y.push({index:T.aNormal,typedArray:n.subarray(a,a+o),componentsPerAttribute:_,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:B,normalize:!1}),p++),a+=o}var f=r.getUint32(a,!0);if(a+=Uint32Array.BYTES_PER_ELEMENT,f>0){var m=new Uint8Array(4*f);i.push(m.buffer);var l=r.getUint32(a,!0);l=4*Float32Array.BYTES_PER_ELEMENT,a+=Uint32Array.BYTES_PER_ELEMENT,o=f*l;for(var U=new Float32Array(n.buffer,a,4*u),P=0;P<u;P++)m[4*P]=255*U[4*P],m[4*P+1]=255*U[4*P+1],m[4*P+2]=255*U[4*P+2],m[4*P+3]=255*U[4*P+3];a+=o,T.aColor=p,y.push({index:T.aColor,typedArray:m,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),p++}var d=r.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT,d>0&&(a+=o=16*d);var g=r.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;for(var L,N,M=-1,S=0;S<g;S++){L=r.getUint32(a,!0),a+=Uint32Array.BYTES_PER_ELEMENT,N=r.getUint16(a,!0),a+=Uint16Array.BYTES_PER_ELEMENT,r.getUint16(a,!0),a+=Uint16Array.BYTES_PER_ELEMENT,o=L*N*Float32Array.BYTES_PER_ELEMENT;var h,R=n.subarray(a,a+o);if(-1!=M||20!=N&&35!=N)if(-1!==M)s.instanceBounds=new Float32Array(n.buffer,a,L*N);else{var Y="aTexCoord"+S;T[Y]=p++,y.push({index:T[Y],typedArray:R,componentsPerAttribute:N,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:N*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}else M=S,s.instanceCount=L,s.instanceMode=N,s.instanceBuffer=R,20===N?(h=20*Float32Array.BYTES_PER_ELEMENT,T.uv2=p++,y.push({index:T.uv2,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:h,instanceDivisor:1}),T.uv3=p++,y.push({index:T.uv3,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),T.uv4=p++,y.push({index:T.uv4,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),T.secondary_colour=p++,y.push({index:T.secondary_colour,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),T.uv6=p++,y.push({index:T.uv6,componentsPerAttribute:4,componentDatatype:e.ComponentDatatype.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1})):35===N&&(h=35*Float32Array.BYTES_PER_ELEMENT,T.uv1=p++,y.push({index:T.uv1,components