2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
|
|
define(["./AttributeCompression-ab5c33b7","./Transforms-251ff661","./Cartesian2-697a9954","./when-54335d57","./TerrainEncoding-24b5ef86","./IndexDatatype-c134ea39","./Check-f3fec9b0","./Math-737a2579","./OrientedBoundingBox-d1fd9cf8","./createTaskProcessorWorker","./RuntimeError-88a32665","./ComponentDatatype-417761a2","./WebGLConstants-4739ce15","./EllipsoidTangentPlane-ae33ec6a","./AxisAlignedBoundingBox-dcfdb7a9","./IntersectionTests-3e34a0aa","./Plane-d4cb7bb3"],function(s,ue,oe,g,ae,pe,e,de,fe,t,i,n,r,h,u,o,a){"use strict";var le={clipTriangleAtAxisAlignedThreshold:function(e,t,i,n,s,r){var h,u;g.defined(r)?r.length=0:r=[];var o,a,p,d,f,l,c=t?(h=i<e,u=n<e,s<e):(h=e<i,u=e<n,e<s),t=h+u+c;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))):c&&(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?c||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 g.defined(o)?(o.x=i,o.y=u,o.z=n,o):new oe.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=!g.defined(o)?new oe.Cartesian2:o).x=e+a*(i-e),o.y=t+a*(n-t),o):void 0}}},ce=32767,ge=16383,me=[],xe=[],we=[],Ce=new oe.Cartographic,ve=new oe.Cartesian3,Be=[],ye=[],Ie=[],Ae=[],be=[],Te=new oe.Cartesian3,ze=new ue.BoundingSphere,Me=new fe.OrientedBoundingBox,Ne=new oe.Cartesian2,Ve=new oe.Cartesian3;function Ee(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}Ee.prototype.clone=function(e){return(e=!g.defined(e)?new Ee: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},Ee.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},Ee.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},Ee.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},Ee.prototype.isIndexed=function(){return g.defined(this.index)},Ee.prototype.getH=function(){return g.defined(this.index)?this.heightBuffer[this.index]:de.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},Ee.prototype.getU=function(){return g.defined(this.index)?this.uBuffer[this.index]:de.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},Ee.prototype.getV=function(){return g.defined(this.index)?this.vBuffer[this.index]:de.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};var p=new oe.Cartesian2,d=-1,f=[new oe.Cartesian3,new oe.Cartesian3],l=[new oe.Cartesian3,new oe.Cartesian3];function c(e,t){var i=f[++d],n=l[d],i=s.AttributeCompression.octDecode(e.first.getNormalX(),e.first.getNormalY(),i),n=s.AttributeCompression.octDecode(e.second.getNormalX(),e.second.getNormalY(),n);r
|