Agriculture-front-end/public/Cesium/Workers/upsampleQuantizedTerrainMesh.js

2 lines
8.4 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["./AttributeCompression-90851096","./BoundingSphere-561b54d0","./Cartesian2-47311507","./Cartographic-3309dd0d","./when-b60132fc","./TerrainEncoding-e04be3ba","./IndexDatatype-8a5eead4","./Check-7b2a090c","./Math-119be1a3","./OrientedBoundingBox-f1d7843f","./createTaskProcessorWorker","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994","./ComponentDatatype-c140a87d","./WebGLConstants-4ae0db90","./EllipsoidTangentPlane-b2b18d75","./IntersectionTests-0c6d0a14","./Plane-097b3a8f","./Transforms-cb0006b0","./buildModuleUrl-3addfe33","./FeatureDetection-c3b71206"],(function(e,t,i,n,s,r,h,u,o,a,d,p,f,l,c,g,m,x,v,C,w){"use strict";var y={clipTriangleAtAxisAlignedThreshold:function(e,t,i,n,r,h){var u,o,a;s.defined(h)?h.length=0:h=[],t?(u=i<e,o=n<e,a=r<e):(u=i>e,o=n>e,a=r>e);var d,p,f,l,c,g,m=u+o+a;return 1===m?u?(d=(e-i)/(n-i),p=(e-i)/(r-i),h.push(1),h.push(2),1!==p&&(h.push(-1),h.push(0),h.push(2),h.push(p)),1!==d&&(h.push(-1),h.push(0),h.push(1),h.push(d))):o?(f=(e-n)/(r-n),l=(e-n)/(i-n),h.push(2),h.push(0),1!==l&&(h.push(-1),h.push(1),h.push(0),h.push(l)),1!==f&&(h.push(-1),h.push(1),h.push(2),h.push(f))):a&&(c=(e-r)/(i-r),g=(e-r)/(n-r),h.push(0),h.push(1),1!==g&&(h.push(-1),h.push(2),h.push(1),h.push(g)),1!==c&&(h.push(-1),h.push(2),h.push(0),h.push(c))):2===m?u||i===e?o||n===e?a||r===e||(p=(e-i)/(r-i),f=(e-n)/(r-n),h.push(2),h.push(-1),h.push(0),h.push(2),h.push(p),h.push(-1),h.push(1),h.push(2),h.push(f)):(g=(e-r)/(n-r),d=(e-i)/(n-i),h.push(1),h.push(-1),h.push(2),h.push(1),h.push(g),h.push(-1),h.push(0),h.push(1),h.push(d)):(l=(e-n)/(i-n),c=(e-r)/(i-r),h.push(0),h.push(-1),h.push(1),h.push(0),h.push(l),h.push(-1),h.push(2),h.push(0),h.push(c)):3!==m&&(h.push(0),h.push(1),h.push(2)),h},computeBarycentricCoordinates:function(e,t,i,r,h,u,o,a,d){var p=i-o,f=o-h,l=u-a,c=r-a,g=1/(l*p+f*c),m=t-a,x=e-o,v=(l*x+f*m)*g,C=(-c*x+p*m)*g,w=1-v-C;return s.defined(d)?(d.x=v,d.y=C,d.z=w,d):new n.Cartesian3(v,C,w)},computeLineSegmentLineSegmentIntersection:function(e,t,n,r,h,u,o,a,d){var p=(a-u)*(n-e)-(o-h)*(r-t);if(0!==p){var f=((o-h)*(t-u)-(a-u)*(e-h))/p,l=((n-e)*(t-u)-(r-t)*(e-h))/p;return f>=0&&f<=1&&l>=0&&l<=1?(s.defined(d)||(d=new i.Cartesian2),d.x=e+f*(n-e),d.y=t+f*(r-t),d):void 0}}},B=32767,b=16383,I=[],A=[],T=[],z=new n.Cartographic,M=new n.Cartesian3,N=[],V=[],E=[],H=[],R=[],O=new n.Cartesian3,S=new t.BoundingSphere,U=new a.OrientedBoundingBox,F=new i.Cartesian2,P=new n.Cartesian3;function D(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}D.prototype.clone=function(e){return s.defined(e)||(e=new D),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},D.prototype.initializeIndexed=function(e,t,i,n,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=i,this.normalBuffer=n,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},D.prototype.initializeFromClipResult=function(e,t,i){var n=t+1;return-1!==e[t]?i[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=i[e[n]],++n,this.second=i[e[n]],++n,this.ratio=e[n],++n),n},D.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},D.prototype.isIndexed=function(){return s.defined(this.index)},D.prototype.getH=function(e,t){if(s.defined(this.index))return this.heightBuffer[this.index];var i=this.first.getH(e,t),n=this.second.getH(e,t);return 0===t+i/B*e||0===t+n/B*e?0:o.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},D.prototype.getU=function(){return s.defined(this.index)?this.uBuffer[this.index]:o.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},D.prototype.getV=function(){return s.defined(this.index)?this.vBuffer[this.index]:o.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};var k=new i.Cartesian2,W=-1,X=[new n.Cartesian3,new n.Cartesian3],K=[new n.Cartesian3,new n.Cartesian3];function L(t,i){++W;var s=X[W],r=K[W];re