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
8.1 KiB

define(["./when-54c2dc71","./Check-6c0211bc","./Math-fc8cecf5","./Cartesian2-bddc1162","./Transforms-d07bb42c","./RuntimeError-2109023a","./WebGLConstants-76bb35d1","./ComponentDatatype-6d99a1ee","./AttributeCompression-9fc99391","./IndexDatatype-53503fee","./IntersectionTests-8abf6dba","./Plane-c8971487","./createTaskProcessorWorker","./EllipsoidTangentPlane-0a0e472c","./OrientedBoundingBox-2c275398","./TerrainEncoding-d6aef4ae"],function(g,e,oe,ae,pe,t,i,n,s,de,r,h,u,o,fe,le){"use strict";var ce={clipTriangleAtAxisAlignedThreshold:function(e,t,i,n,s,r){var h,u,o;g.defined(r)?r.length=0:r=[],o=t?(h=i<e,u=n<e,s<e):(h=e<i,u=e<n,e<s);var a,p,d,f,l,c,t=h+u+o;return 1===t?h?(a=(e-i)/(n-i),p=(e-i)/(s-i),r.push(1),r.push(2),1!==p&&(r.push(-1),r.push(0),r.push(2),r.push(p)),1!==a&&(r.push(-1),r.push(0),r.push(1),r.push(a))):u?(d=(e-n)/(s-n),f=(e-n)/(i-n),r.push(2),r.push(0),1!==f&&(r.push(-1),r.push(1),r.push(0),r.push(f)),1!==d&&(r.push(-1),r.push(1),r.push(2),r.push(d))):o&&(l=(e-s)/(i-s),c=(e-s)/(n-s),r.push(0),r.push(1),1!==c&&(r.push(-1),r.push(2),r.push(1),r.push(c)),1!==l&&(r.push(-1),r.push(2),r.push(0),r.push(l))):2===t?h||i===e?u||n===e?o||s===e||(p=(e-i)/(s-i),d=(e-n)/(s-n),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(p),r.push(-1),r.push(1),r.push(2),r.push(d)):(c=(e-s)/(n-s),a=(e-i)/(n-i),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(c),r.push(-1),r.push(0),r.push(1),r.push(a)):(f=(e-n)/(i-n),l=(e-s)/(i-s),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(f),r.push(-1),r.push(2),r.push(0),r.push(l)):3!==t&&(r.push(0),r.push(1),r.push(2)),r},computeBarycentricCoordinates:function(e,t,i,n,s,r,h,u,o){var a=i-h,i=h-s,s=r-u,r=n-u,n=1/(s*a+i*r),u=t-u,h=e-h,i=(s*h+i*u)*n,u=(-r*h+a*u)*n,n=1-i-u;return g.defined(o)?(o.x=i,o.y=u,o.z=n,o):new ae.Cartesian3(i,u,n)},computeLineSegmentLineSegmentIntersection:function(e,t,i,n,s,r,h,u,o){var a=(h-s)*(t-r)-(u-r)*(e-s),p=(i-e)*(t-r)-(n-t)*(e-s),s=(u-r)*(i-e)-(h-s)*(n-t);if(0!=s){a=a/s,s=p/s;return 0<=a&&a<=1&&0<=s&&s<=1?(g.defined(o)||(o=new ae.Cartesian2),o.x=e+a*(i-e),o.y=t+a*(n-t),o):void 0}}},ge=32767,me=16383,xe=[],we=[],Ce=[],ve=new ae.Cartographic,ye=new ae.Cartesian3,Be=[],Ie=[],be=[],Ae=[],Te=[],ze=new ae.Cartesian3,Me=new pe.BoundingSphere,Ne=new fe.OrientedBoundingBox,Ve=new ae.Cartesian2,Ee=new ae.Cartesian3;function Re(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}Re.prototype.clone=function(e){return g.defined(e)||(e=new Re),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},Re.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},Re.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},Re.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},Re.prototype.isIndexed=function(){return g.defined(this.index)},Re.prototype.getH=function(){return g.defined(this.index)?this.heightBuffer[this.index]:oe.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},Re.prototype.getU=function(){return g.defined(this.index)?this.uBuffer[this.index]:oe.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},Re.prototype.getV=function(){return g.defined(this.index)?this.vBuffer[this.index]:oe.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};var a=new ae.Cartesian2,p=-1,d=[new ae.Cartesian3,new ae.Cartesian3],f=[new ae.Cartesian3,new ae.Cartesian3];function l(e,t){var i=d[++p],n=f[p],i=s.AttributeCompression.octDecode(e.first.getNormalX(),e.first.getNormalY(),i),n=s.AttributeCompression.octDecode(e.second.getNormalX(),e.second.getNormalY(),n);return ye=ae.Cartesian3.lerp(i,n