2 lines
241 KiB
JavaScript
2 lines
241 KiB
JavaScript
|
define(["./createTaskProcessorWorker","./Check-7b2a090c","./FeatureDetection-c3b71206","./when-b60132fc","./PrimitiveType-a54dc62f","./Cartesian2-47311507","./Cartographic-3309dd0d","./Cartesian4-3ca25aab","./Color-5008547b","./ComponentDatatype-c140a87d","./getStringFromTypedArray-c37342c0","./buildModuleUrl-4e1b81e7","./S3MCompressType-555475e4","./IndexDatatype-8a5eead4","./RuntimeError-4a5c8994","./BoundingRectangle-3ed8ca6d","./pako_inflate-f73548c4","./arrayFill-4513d7ad","./CompressedTextureBuffer-290a1ff4","./PixelFormat-fd637eac","./Math-119be1a3","./WebGLConstants-4ae0db90","./Event-16a2dfbf"],(function(e,t,r,n,o,a,i,s,c,E,u,l,d,A,f,p,_,g,m,T,y,B,C){"use strict";function D(e,t,n){if("function"==typeof e.slice)return e.slice(t,n);for(var o=Array.prototype.slice.call(e,t,n),a=r.FeatureDetection.typedArrayTypes,i=a.length,s=0;s<i;++s)if(e instanceof a[s]){o=new a[s](o);break}return o}function h(){}var O;function P(e,t){for(var r=e.num_points(),n=e.num_faces(),o=new O.DracoInt32Array,a=3*n,i=A.IndexDatatype.createTypedArray(r,a),s=0,c=0;c<n;++c)t.GetFaceFromMesh(e,c,o),i[s+0]=o.GetValue(0),i[s+1]=o.GetValue(1),i[s+2]=o.GetValue(2),s+=3;var E=A.IndexDatatype.UNSIGNED_SHORT;return i instanceof Uint32Array&&(E=A.IndexDatatype.UNSIGNED_INT),O.destroy(o),{typedArray:i,numberOfIndices:a,indexDataType:E}}function v(e,t,r,n,o){var a,i;n.quantizationBits<=8?(i=new O.DracoUInt8Array,a=new Uint8Array(o),t.GetAttributeUInt8ForAllPoints(e,r,i)):(i=new O.DracoUInt16Array,a=new Uint16Array(o),t.GetAttributeUInt16ForAllPoints(e,r,i));for(var s=0;s<o;++s)a[s]=i.GetValue(s);return O.destroy(i),a}function F(e,t,r,n){var o,a;switch(r.data_type()){case 1:case 11:a=new O.DracoInt8Array,o=new Int8Array(n),t.GetAttributeInt8ForAllPoints(e,r,a);break;case 2:a=new O.DracoUInt8Array,o=new Uint8Array(n),t.GetAttributeUInt8ForAllPoints(e,r,a);break;case 3:a=new O.DracoInt16Array,o=new Int16Array(n),t.GetAttributeInt16ForAllPoints(e,r,a);break;case 4:a=new O.DracoUInt16Array,o=new Uint16Array(n),t.GetAttributeUInt16ForAllPoints(e,r,a);break;case 5:case 7:a=new O.DracoInt32Array,o=new Int32Array(n),t.GetAttributeInt32ForAllPoints(e,r,a);break;case 6:case 8:a=new O.DracoUInt32Array,o=new Uint32Array(n),t.GetAttributeUInt32ForAllPoints(e,r,a);break;case 9:case 10:a=new O.DracoFloat32Array,o=new Float32Array(n),t.GetAttributeFloatForAllPoints(e,r,a)}for(var i=0;i<n;++i)o[i]=a.GetValue(i);return O.destroy(a),o}function M(e,t,r){var o,a=e.num_points(),i=r.num_components(),s=new O.AttributeQuantizationTransform;if(s.InitFromAttribute(r)){for(var c=new Array(i),u=0;u<i;++u)c[u]=s.min_value(u);o={quantizationBits:s.quantization_bits(),minValues:c,range:s.range(),octEncoded:!1}}O.destroy(s),(s=new O.AttributeOctahedronTransform).InitFromAttribute(r)&&(o={quantizationBits:s.quantization_bits(),octEncoded:!0}),O.destroy(s);var l,d=a*i;l=n.defined(o)?v(e,t,r,o,d):F(e,t,r,d);var A=E.ComponentDatatype.fromTypedArray(l);return{array:l,data:{componentsPerAttribute:i,componentDatatype:A,byteOffset:r.byte_offset(),byteStride:E.ComponentDatatype.getSizeInBytes(A)*i,normalized:r.normalized(),quantization:o}}}var S=new i.Cartesian3(40680631590769,40680631590769,40408299984661.445),b=new i.Cartesian3,R=new i.Cartesian3;function w(e,t,r,o){var a=Math.cos(t);b.x=a*Math.cos(e),b.y=a*Math.sin(e),b.z=Math.sin(t),b=i.Cartesian3.normalize(b,b),i.Cartesian3.multiplyComponents(S,b,R);var s=Math.sqrt(i.Cartesian3.dot(b,R));return R=i.Cartesian3.divideByScalar(R,s,R),b=i.Cartesian3.multiplyByScalar(b,r,b),n.defined(o)||(o=new i.Cartesian3),i.Cartesian3.add(R,b,o)}var I=new o.Matrix4,L=new o.Matrix4,x=new i.Cartesian3,N=new i.Cartographic;function U(e,t,r,c,u,l,A,f){var p=void 0,_=void 0,g=r.vertexAttributes,m=r.attrLocation;if(r.nCompressOptions=0,n.defined(c.posUniqueID)&&c.posUniqueID>=0){n.defined(f)||(r.nCompressOptions|=d.VertexCompressOption.SVC_Vertex);var T=t.GetAttribute(e,c.posUniqueID),y=M(e,t,T),B=y.data.componentsPerAttribute;r.verticesCount=y.array.length/B,r.vertCompressConstant=y.data.quantization.range/(1<<y.data.quantization.quantizationBits);var C=y.data.qua
|