NongFaHeZuoSheGuanLi/public/Cesium/Workers/GeometryPipeline-137aa28e.js

2 lines
32 KiB
JavaScript
Raw Normal View History

2025-01-24 11:20:56 +08:00
define(["exports","./AttributeCompression-f9ee669b","./Cartesian2-1b9b0d8a","./Cartographic-1bbcab04","./Check-3aa71481","./when-515d5295","./Math-5e38123d","./buildModuleUrl-dba4ec07","./Cartesian4-034d54d5","./ComponentDatatype-d430c7f7","./EncodedCartesian3-d74c1b81","./Intersect-53434a77","./GeometryAttribute-9bc31a7f","./IndexDatatype-eefd5922","./IntersectionTests-5fa33dbd","./PrimitiveType-b38a4004","./Plane-92c15089"],(function(e,t,r,a,n,i,o,s,u,p,l,v,c,f,y,m,d){"use strict";var h=new a.a,b=new a.a,w=new a.a;function g(e,t,s,u,p){var l,v,c,f,y,m,d,g;if(n.n.defined("point",e),n.n.defined("p0",t),n.n.defined("p1",s),n.n.defined("p2",u),i.t(p)||(p=new a.a),i.t(t.z)){if(a.a.equalsEpsilon(e,t,o.n.EPSILON14))return a.a.clone(a.a.UNIT_X,p);if(a.a.equalsEpsilon(e,s,o.n.EPSILON14))return a.a.clone(a.a.UNIT_Y,p);if(a.a.equalsEpsilon(e,u,o.n.EPSILON14))return a.a.clone(a.a.UNIT_Z,p);l=a.a.subtract(s,t,h),v=a.a.subtract(u,t,b),c=a.a.subtract(e,t,w),f=a.a.dot(l,l),y=a.a.dot(l,v),m=a.a.dot(l,c),d=a.a.dot(v,v),g=a.a.dot(v,c)}else{if(r.r.equalsEpsilon(e,t,o.n.EPSILON14))return a.a.clone(a.a.UNIT_X,p);if(r.r.equalsEpsilon(e,s,o.n.EPSILON14))return a.a.clone(a.a.UNIT_Y,p);if(r.r.equalsEpsilon(e,u,o.n.EPSILON14))return a.a.clone(a.a.UNIT_Z,p);l=r.r.subtract(s,t,h),v=r.r.subtract(u,t,b),c=r.r.subtract(e,t,w),f=r.r.dot(l,l),y=r.r.dot(l,v),m=r.r.dot(l,c),d=r.r.dot(v,v),g=r.r.dot(v,c)}p.y=d*m-y*g,p.z=f*g-y*m;var T=f*d-y*y;return 0!==p.y&&(p.y/=T),0!==p.z&&(p.z/=T),p.x=1-p.y-p.z,p}var T={calculateACMR:function(e){var t=(e=i.e(e,i.e.EMPTY_OBJECT)).indices,r=e.maximumIndex,a=i.e(e.cacheSize,24);if(!i.t(t))throw new n.t("indices is required.");var o=t.length;if(o<3||o%3!=0)throw new n.t("indices length must be a multiple of three.");if(r<=0)throw new n.t("maximumIndex must be greater than zero.");if(a<3)throw new n.t("cacheSize must be greater than two.");if(!i.t(r)){r=0;for(var s=0,u=t[s];s<o;)u>r&&(r=u),u=t[++s]}for(var p=[],l=0;l<r+1;l++)p[l]=0;for(var v=a+1,c=0;c<o;++c)v-p[t[c]]>a&&(p[t[c]]=v,++v);return(v-a+1)/(o/3)}};T.tipsify=function(e){var t,r=(e=i.e(e,i.e.EMPTY_OBJECT)).indices,a=e.maximumIndex,o=i.e(e.cacheSize,24);function s(e,r,a,n,i,o,s){for(var u,p=-1,l=-1,v=0;v<a.length;){var c=a[v];n[c].numLiveTriangles&&(u=0,i-n[c].timeStamp+2*n[c].numLiveTriangles<=r&&(u=i-n[c].timeStamp),(u>l||-1===l)&&(l=u,p=c)),++v}return-1===p?function(e,r,a,n){for(;r.length>=1;){var i=r[r.length-1];if(r.splice(r.length-1,1),e[i].numLiveTriangles>0)return i}for(;t<n;){if(e[t].numLiveTriangles>0)return++t-1;++t}return-1}(n,o,0,s):p}if(!i.t(r))throw new n.t("indices is required.");var u=r.length;if(u<3||u%3!=0)throw new n.t("indices length must be a multiple of three.");if(a<=0)throw new n.t("maximumIndex must be greater than zero.");if(o<3)throw new n.t("cacheSize must be greater than two.");var p=0,l=0,v=r[l],c=u;if(i.t(a))p=a+1;else{for(;l<c;)v>p&&(p=v),v=r[++l];if(-1===p)return 0;++p}var f,y=[];for(f=0;f<p;f++)y[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};l=0;for(var m=0;l<c;)y[r[l]].vertexTriangles.push(m),++y[r[l]].numLiveTriangles,y[r[l+1]].vertexTriangles.push(m),++y[r[l+1]].numLiveTriangles,y[r[l+2]].vertexTriangles.push(m),++y[r[l+2]].numLiveTriangles,++m,l+=3;var d=0,h=o+1;t=1;var b,w,g,T,x=[],A=[],I=0,S=[],P=u/3,N=[];for(f=0;f<P;f++)N[f]=!1;for(;-1!==d;){x=[],T=(w=y[d]).vertexTriangles.length;for(var E=0;E<T;++E)if(!N[m=w.vertexTriangles[E]]){N[m]=!0,l=m+m+m;for(var O=0;O<3;++O)g=r[l],x.push(g),A.push(g),S[I]=g,++I,--(b=y[g]).numLiveTriangles,h-b.timeStamp>o&&(b.timeStamp=h,++h),++l}d=s(0,o,x,y,h,A,p)}return S};var x={};function A(e,t,r,a,n){e[t++]=r,e[t++]=a,e[t++]=a,e[t++]=n,e[t++]=n,e[t]=r}function I(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&i.t(e[r])&&i.t(e[r].values)){var a=e[r];t[r]=new c.r({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return t}function S(e,t,r){for(var a in t)if(t.hasOwnProperty(a)&&i.t(t[a])&&i.t(t[a].values))for(var n=t[a],o=0;o<n.componentsPerAttribute;++o)e[a].values.push(n.values[r*n.componentsPerAttribute+o])}x.toWir