You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
9.5 KiB
2 lines
9.5 KiB
3 years ago
|
define(["exports","./when-54c2dc71","./Check-6c0211bc","./Cartesian2-bddc1162","./Transforms-d07bb42c","./ComponentDatatype-6d99a1ee","./GeometryAttribute-be1a3386","./GeometryAttributes-4fcfcf40","./GeometryPipeline-c2d75081","./IndexDatatype-53503fee","./WebMercatorProjection-df58d479"],function(e,y,t,c,P,k,C,w,b,A,f){"use strict";function m(e,t,r){e=y.defaultValue(e,0),t=y.defaultValue(t,0),r=y.defaultValue(r,0),this.value=new Float32Array([e,t,r])}function v(e,t){var r=e.attributes,e=r.position,n=e.values.length/e.componentsPerAttribute;r.batchId=new C.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:1,values:new Float32Array(n)});for(var i=r.batchId.values,o=0;o<n;++o)i[o]=t}function l(e){var t,r=e.instances,n=e.projection,i=e.elementIndexUintSupported,a=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,e=e.modelMatrix,d=r.length;for(g=0;g<d;++g)if(y.defined(r[g].geometry)){r[g].geometry.primitiveType;break}if(!function(e,t){var r=!a,n=e.length;if(!r&&1<n)for(var i=e[0].modelMatrix,o=1;o<n;++o)if(!P.Matrix4.equals(i,e[o].modelMatrix)){r=!0;break}if(r)for(o=0;o<n;++o)y.defined(e[o].geometry)&&b.GeometryPipeline.transformToWorldCoordinates(e[o]);else P.Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}(r,e),!a)for(g=0;g<d;++g)y.defined(r[g].geometry)&&b.GeometryPipeline.splitLongitude(r[g]);if(!function(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];y.defined(n.geometry)?v(n.geometry,r):y.defined(n.westHemisphereGeometry)&&y.defined(n.eastHemisphereGeometry)&&(v(n.westHemisphereGeometry,r),v(n.eastHemisphereGeometry,r))}}(r),o)for(g=0;g<d;++g){var p=r[g];y.defined(p.geometry)?(b.GeometryPipeline.reorderForPostVertexCache(p.geometry),b.GeometryPipeline.reorderForPreVertexCache(p.geometry)):y.defined(p.westHemisphereGeometry)&&y.defined(p.eastHemisphereGeometry)&&(b.GeometryPipeline.reorderForPostVertexCache(p.westHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(p.westHemisphereGeometry),b.GeometryPipeline.reorderForPostVertexCache(p.eastHemisphereGeometry),b.GeometryPipeline.reorderForPreVertexCache(p.eastHemisphereGeometry))}var u=b.GeometryPipeline.combineInstances(r);for(d=u.length,g=0;g<d;++g){var c,f,m,h=(t=u[g]).attributes;if(a)for(c in h)h.hasOwnProperty(c)&&h[c].componentDatatype===k.ComponentDatatype.DOUBLE&&b.GeometryPipeline.encodeAttribute(t,c,c+"3DHigh",c+"3DLow");else for(c in h)h.hasOwnProperty(c)&&h[c].componentDatatype===k.ComponentDatatype.DOUBLE&&(f=c+"3D",m=c+"2D",b.GeometryPipeline.projectTo2D(t,c,f,m,n),y.defined(t.boundingSphere)&&"position"===c&&(t.boundingSphereCV=P.BoundingSphere.fromVertices(t.attributes.position2D.values)),b.GeometryPipeline.encodeAttribute(t,f,f+"High",f+"Low"),b.GeometryPipeline.encodeAttribute(t,m,m+"High",m+"Low"));s&&b.GeometryPipeline.compressVertices(t)}if(!i){for(var l=[],d=u.length,g=0;g<d;++g)t=u[g],l=l.concat(b.GeometryPipeline.fitToUnsignedShortIndices(t));u=l}return u}function g(e,t,r,n){var i,o,a,s=n.length-1;a=0<=s?(i=(s=n[s]).offset+s.count,r[o=s.index].indices.length):r[o=i=0].indices.length;for(var d=e.length,p=0;p<d;++p){var u=e[p][t];y.defined(u)&&(a<i+(u=u.indices.length)&&(i=0,a=r[++o].indices.length),n.push({index:o,offset:i,count:u}),i+=u)}}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 y.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,i=e.attributes;for(r in i)i.hasOwnProperty(r)&&(n=i[r],y.defined(n)&&y.defined(n.values)&&t.push(n.values.buffer));y.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];y.defined(a)?(n[i++]=1,P.BoundingSphere.pack(e[o],n,i)):n[i++]=0,i+=P.BoundingSphere.packedLength}return n}function
|