4x/irrigation-monitoring-platf.../public/Cesium/Workers/upsampleQuantizedTerrainMes...

2 lines
8.2 KiB
JavaScript
Raw Normal View History

2024-12-26 19:24:07 +08:00
define(["./AttributeCompression-af389d04","./Transforms-d13cc04e","./Matrix2-9aa31791","./when-4bbc8319","./TerrainEncoding-ba779f11","./IndexDatatype-b7d979a6","./RuntimeError-346a3079","./ComponentDatatype-93750d1a","./OrientedBoundingBox-4b932f63","./createTaskProcessorWorker","./combine-83860057","./WebGLConstants-1c8239cc","./EllipsoidTangentPlane-eecce7e8","./AxisAlignedBoundingBox-07c6b7f2","./IntersectionTests-96a04219","./Plane-318d6937"],(function(e,i,t,n,s,r,h,u,o,a,p,d,l,f,c,g){"use strict";var m={clipTriangleAtAxisAlignedThreshold:function(e,i,t,s,r,h){var u,o,a;n.defined(h)?h.length=0:h=[],i?(u=t<e,o=s<e,a=r<e):(u=t>e,o=s>e,a=r>e);var p,d,l,f,c,g,m=u+o+a;return 1===m?u?(p=(e-t)/(s-t),d=(e-t)/(r-t),h.push(1),h.push(2),1!==d&&(h.push(-1),h.push(0),h.push(2),h.push(d)),1!==p&&(h.push(-1),h.push(0),h.push(1),h.push(p))):o?(l=(e-s)/(r-s),f=(e-s)/(t-s),h.push(2),h.push(0),1!==f&&(h.push(-1),h.push(1),h.push(0),h.push(f)),1!==l&&(h.push(-1),h.push(1),h.push(2),h.push(l))):a&&(c=(e-r)/(t-r),g=(e-r)/(s-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||t===e?o||s===e?a||r===e||(d=(e-t)/(r-t),l=(e-s)/(r-s),h.push(2),h.push(-1),h.push(0),h.push(2),h.push(d),h.push(-1),h.push(1),h.push(2),h.push(l)):(g=(e-r)/(s-r),p=(e-t)/(s-t),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(p)):(f=(e-s)/(t-s),c=(e-r)/(t-r),h.push(0),h.push(-1),h.push(1),h.push(0),h.push(f),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,i,s,r,h,u,o,a,p){var d=s-o,l=o-h,f=u-a,c=r-a,g=1/(f*d+l*c),m=i-a,x=e-o,v=(f*x+l*m)*g,w=(-c*x+d*m)*g,C=1-v-w;return n.defined(p)?(p.x=v,p.y=w,p.z=C,p):new t.Cartesian3(v,w,C)},computeLineSegmentLineSegmentIntersection:function(e,i,s,r,h,u,o,a,p){var d=(a-u)*(s-e)-(o-h)*(r-i);if(0!==d){var l=((o-h)*(i-u)-(a-u)*(e-h))/d,f=((s-e)*(i-u)-(r-i)*(e-h))/d;return l>=0&&l<=1&&f>=0&&f<=1?(n.defined(p)||(p=new t.Cartesian2),p.x=e+l*(s-e),p.y=i+l*(r-i),p):void 0}}},x=32767,v=16383,w=[],C=[],B=[],y=new t.Cartographic,I=new t.Cartesian3,A=[],b=[],T=[],z=[],M=[],N=new t.Cartesian3,V=new i.BoundingSphere,E=new o.OrientedBoundingBox,R=new t.Cartesian2,H=new t.Cartesian3;function O(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}O.prototype.clone=function(e){return n.defined(e)||(e=new O),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},O.prototype.initializeIndexed=function(e,i,t,n,s){this.uBuffer=e,this.vBuffer=i,this.heightBuffer=t,this.normalBuffer=n,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},O.prototype.initializeFromClipResult=function(e,i,t){var n=i+1;return-1!==e[i]?t[e[i]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=t[e[n]],++n,this.second=t[e[n]],++n,this.ratio=e[n],++n),n},O.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},O.prototype.isIndexed=function(){return n.defined(this.index)},O.prototype.getH=function(){return n.defined(this.index)?this.heightBuffer[this.index]:u.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},O.prototype.getU=function(){return n.defined(this.index)?this.uBuffer[this.index]:u.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},O.prototype.getV=function(){return n.defined(this.index)?this.vBuffer[this.index]:u.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};var S=new t.Cartesian2,U=-1,F=[new t.Cartesian3,new t.Cartesian3],P=[new t.Cartesian3,new t.Cartesian3];function D(i,n){++U;var s=F[U],r=P[U];return s=e.AttributeCompression.octDecode(i.first.getNormalX(),i.first.getNormalY(),s),r=e.AttributeCompression.octDecode(i.second.getNormalX(),i.second.getNormalY(),r),I=t.Cartesian3.lerp(s,r,i.ratio,I),t.Cartesian3.norma