锦水三维代码
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

2 years ago
define(["./AttributeCompression-f02ec82f","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./when-208fe5b0","./TerrainEncoding-73cbc4e6","./IndexDatatype-d47ad6f6","./Check-d18af7c4","./Math-4e53b694","./OrientedBoundingBox-18b4901f","./createTaskProcessorWorker","./RuntimeError-7f634f5d","./ComponentDatatype-9204e9f6","./WebGLConstants-76bb35d1","./EllipsoidTangentPlane-9123a53b","./IntersectionTests-7d224a2f","./Plane-4aa8974d"],function(s,oe,ae,c,pe,de,e,fe,le,t,i,n,r,h,u,o){"use strict";var ge={clipTriangleAtAxisAlignedThreshold:function(e,t,i,n,s,r){var h,u;c.defined(r)?r.length=0:r=[];var o,a,p,d,f,l,g=t?(h=i<e,u=n<e,s<e):(h=e<i,u=e<n,e<s),t=h+u+g;return 1===t?h?(o=(e-i)/(n-i),a=(e-i)/(s-i),r.push(1),r.push(2),1!==a&&(r.push(-1),r.push(0),r.push(2),r.push(a)),1!==o&&(r.push(-1),r.push(0),r.push(1),r.push(o))):u?(p=(e-n)/(s-n),d=(e-n)/(i-n),r.push(2),r.push(0),1!==d&&(r.push(-1),r.push(1),r.push(0),r.push(d)),1!==p&&(r.push(-1),r.push(1),r.push(2),r.push(p))):g&&(f=(e-s)/(i-s),l=(e-s)/(n-s),r.push(0),r.push(1),1!==l&&(r.push(-1),r.push(2),r.push(1),r.push(l)),1!==f&&(r.push(-1),r.push(2),r.push(0),r.push(f))):2===t?h||i===e?u||n===e?g||s===e||(a=(e-i)/(s-i),p=(e-n)/(s-n),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(a),r.push(-1),r.push(1),r.push(2),r.push(p)):(l=(e-s)/(n-s),o=(e-i)/(n-i),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(l),r.push(-1),r.push(0),r.push(1),r.push(o)):(d=(e-n)/(i-n),f=(e-s)/(i-s),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(d),r.push(-1),r.push(2),r.push(0),r.push(f)):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 c.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?((o=!c.defined(o)?new ae.Cartesian2:o).x=e+a*(i-e),o.y=t+a*(n-t),o):void 0}}},ce=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 oe.BoundingSphere,Ne=new le.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(e=!c.defined(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]],this.second=i[e[++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 c.defined(this.index)},Re.prototype.getH=function(){return c.defined(this.index)?this.heightBuffer[this.index]:fe.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},Re.prototype.getU=function(){return c.defined(this.index)?this.uBuffer[this.index]:fe.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},Re.prototype.getV=function(){return c.defined(this.index)?this.vBuffer[this.index]:fe.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,e.rati