bmh_cesium/public/lib/cesiumjs/Cesium/Workers/PrimitivePipeline-998ba268.js

2 lines
9.6 KiB
JavaScript
Raw Normal View History

2025-03-09 23:23:50 +00:00
define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Cartesian2-44433f55","./Transforms-d9350502","./ComponentDatatype-7ee14e67","./GeometryAttribute-424f2c6a","./GeometryAttributes-90846c5f","./GeometryPipeline-5896d55c","./IndexDatatype-66caba23","./WebMercatorProjection-c689ba4a"],function(e,v,t,c,P,k,C,w,b,A,f){"use strict";function m(e,t,r){e=v.defaultValue(e,0),t=v.defaultValue(t,0),r=v.defaultValue(r,0),this.value=new Float32Array([e,t,r])}function G(e,t){var r=e.attributes,n=r.position,i=n.values.length/n.componentsPerAttribute;r.batchId=new C.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=r.batchId.values,a=0;a<i;++a)o[a]=t}function x(e){var t,r=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,a=e.vertexCacheOptimize,s=e.compressVertices,d=e.modelMatrix,p=r.length;for(y=0;y<p;++y)if(v.defined(r[y].geometry)){r[y].geometry.primitiveType;break}if(!function(e,t,r){var n=!r,i=e.length;if(!n&&1<i)for(var o=e[0].modelMatrix,a=1;a<i;++a)if(!P.Matrix4.equals(o,e[a].modelMatrix)){n=!0;break}if(n)for(a=0;a<i;++a)v.defined(e[a].geometry)&&b.GeometryPipeline.transformToWorldCoordinates(e[a]);else P.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(r,d,o),!o)for(y=0;y<p;++y)v.defined(r[y].geometry)&&b.GeometryPipeline.splitLongitude(r[y]);if(!function(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];v.defined(n.geometry)?G(n.geometry,r):v.defined(n.westHemisphereGeometry)&&v.defined(n.eastHemisphereGeometry)&&(G(n.westHemisphereGeometry,r),G(n.eastHemisphereGeometry,r))}}(r),a)for(y=0;y<p;++y){var u=r[y];v.defined(u.geometry)?(b.GeometryPipeline.reorderForPostVertexCache(u.geometry),b.GeometryPipeline.reorderForPreVertexCache(u.geometry)):v.defined(u.westHemisphereGeometry)&&v.defined(u.eastHemisphereGeometry)&&(b.GeometryPipeline.reorderForPostVertexCache(u.westHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(u.westHemisphereGeometry),b.GeometryPipeline.reorderForPostVertexCache(u.eastHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(u.eastHemisphereGeometry))}var c=b.GeometryPipeline.combineInstances(r);for(p=c.length,y=0;y<p;++y){var f,m,h,l=(t=c[y]).attributes;if(o)for(f in l)l.hasOwnProperty(f)&&l[f].componentDatatype===k.ComponentDatatype.DOUBLE&&b.GeometryPipeline.encodeAttribute(t,f,f+"3DHigh",f+"3DLow");else for(f in l){l.hasOwnProperty(f)&&l[f].componentDatatype===k.ComponentDatatype.DOUBLE&&(m=f+"3D",h=f+"2D",b.GeometryPipeline.projectTo2D(t,f,m,h,n),v.defined(t.boundingSphere)&&"position"===f&&(t.boundingSphereCV=P.BoundingSphere.fromVertices(t.attributes.position2D.values)),b.GeometryPipeline.encodeAttribute(t,m,m+"High",m+"Low"),b.GeometryPipeline.encodeAttribute(t,h,h+"High",h+"Low"))}s&&b.GeometryPipeline.compressVertices(t)}if(!i){for(var g=[],p=c.length,y=0;y<p;++y)t=c[y],g=g.concat(b.GeometryPipeline.fitToUnsignedShortIndices(t));c=g}return c}function S(e,t,r,n){var i,o,a,s,d=n.length-1;s=0<=d?(o=(i=n[d]).offset+i.count,r[a=i.index].indices.length):r[a=o=0].indices.length;for(var p=e.length,u=0;u<p;++u){var c,f=e[u][t];v.defined(f)&&(s<o+(c=f.indices.length)&&(o=0,s=r[++a].indices.length),n.push({index:a,offset:o,count:c}),o+=c)}}Object.defineProperties(m.prototype,{componentDatatype:{get:function(){return k.ComponentDatatype.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),m.fromCartesian3=function(e){return new m(e.x,e.y,e.z)},m.toValue=function(e,t){return v.defined(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var h={};function i(e,t){for(var r=e.length,n=0;n<r;++n)!function(e,t){var r,n=e.attributes;for(var i in n){n.hasOwnProperty(i)&&(r=n[i],v.defined(r)&&v.defined(r.values)&&t.push(r.values.buffer))}v.defined(e.indices)&&t.push(e.indices.buffer)}(e[n],t)}function o(e){var t=e.length,r=1+(P.BoundingSphere.packedLength+1)*t,n=new Float32Array(r),i=0;n[i++]=t;for(var o=0;o<t;++o){var a=e[o];v.defined(a)?(n[i++]=1,P.BoundingSphere.pack(e[o],n,i)):n[i++]=0,i+=P.BoundingSphere.packedLength}return