2 lines
8.6 KiB
JavaScript
2 lines
8.6 KiB
JavaScript
|
define(["./AttributeCompression-8f752c03","./BoundingSphere-9a3b5656","./Cartesian2-bd414876","./Cartesian3-e0307675","./defaultValue-81eec7ed","./TerrainEncoding-0f7ffc20","./IndexDatatype-3f3c99e8","./Check-741c5f3c","./Math-e73894ab","./OrientedBoundingBox-c5d2adb7","./Rectangle-cf3e0e3e","./createTaskProcessorWorker","./ComponentDatatype-aaeec80f","./WebGLConstants-508b9636","./Matrix4-4c545f70","./RuntimeError-26acdd3b","./Matrix2-dc0c61cc","./GeographicProjection-c931c7fb","./EllipsoidTangentPlane-4d138901","./AxisAlignedBoundingBox-8774439c","./IntersectionTests-80510c7b","./Plane-bc8b6777","./Transforms-5b829630","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda"],(function(e,t,n,i,s,r,h,o,u,d,p,a,c,l,f,g,m,x,C,w,B,y,b,I,A,v){"use strict";const T={clipTriangleAtAxisAlignedThreshold:function(e,t,n,i,r,h){let o,u,d;s.defined(h)?h.length=0:h=[],t?(o=n<e,u=i<e,d=r<e):(o=n>e,u=i>e,d=r>e);const p=o+u+d;let a,c,l,f,g,m;return 1===p?o?(a=(e-n)/(i-n),c=(e-n)/(r-n),h.push(1),h.push(2),1!==c&&(h.push(-1),h.push(0),h.push(2),h.push(c)),1!==a&&(h.push(-1),h.push(0),h.push(1),h.push(a))):u?(l=(e-i)/(r-i),f=(e-i)/(n-i),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))):d&&(g=(e-r)/(n-r),m=(e-r)/(i-r),h.push(0),h.push(1),1!==m&&(h.push(-1),h.push(2),h.push(1),h.push(m)),1!==g&&(h.push(-1),h.push(2),h.push(0),h.push(g))):2===p?o||n===e?u||i===e?d||r===e||(c=(e-n)/(r-n),l=(e-i)/(r-i),h.push(2),h.push(-1),h.push(0),h.push(2),h.push(c),h.push(-1),h.push(1),h.push(2),h.push(l)):(m=(e-r)/(i-r),a=(e-n)/(i-n),h.push(1),h.push(-1),h.push(2),h.push(1),h.push(m),h.push(-1),h.push(0),h.push(1),h.push(a)):(f=(e-i)/(n-i),g=(e-r)/(n-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(g)):3!==p&&(h.push(0),h.push(1),h.push(2)),h},computeBarycentricCoordinates:function(e,t,n,r,h,o,u,d,p){const a=n-u,c=u-h,l=o-d,f=r-d,g=1/(l*a+c*f),m=t-d,x=e-u,C=(l*x+c*m)*g,w=(-f*x+a*m)*g,B=1-C-w;return s.defined(p)?(p.x=C,p.y=w,p.z=B,p):new i.Cartesian3(C,w,B)},computeLineSegmentLineSegmentIntersection:function(e,t,i,r,h,o,u,d,p){const a=(d-o)*(i-e)-(u-h)*(r-t);if(0===a)return;const c=((u-h)*(t-o)-(d-o)*(e-h))/a,l=((i-e)*(t-o)-(r-t)*(e-h))/a;return c>=0&&c<=1&&l>=0&&l<=1?(s.defined(p)||(p=new n.Cartesian2),p.x=e+c*(i-e),p.y=t+c*(r-t),p):void 0}},M=32767,z=16383,V=[],N=[],R=[],E=new n.Cartographic;let H=new i.Cartesian3;const O=[],S=[],P=[],U=[],F=[],k=new i.Cartesian3,D=new t.BoundingSphere,W=new d.OrientedBoundingBox,X=new n.Cartesian2,K=new i.Cartesian3;function L(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}L.prototype.clone=function(e){return s.defined(e)||(e=new L),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},L.prototype.initializeIndexed=function(e,t,n,i,s){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=i,this.index=s,this.first=void 0,this.second=void 0,this.ratio=void 0},L.prototype.initializeFromClipResult=function(e,t,n){let i=t+1;return-1!==e[t]?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[i]],++i,this.second=n[e[i]],++i,this.ratio=e[i],++i),i},L.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},L.prototype.isIndexed=function(){return s.defined(this.index)},L.prototype.getH=function(){return s.defined(this.index)?this.heightBuffer[this.index]:u.CesiumMath.lerp(this.first.getH(),this.second.getH(),this.ratio)},L.prototype.getU=function(){return s.defined(this.index)?this.uBuffer[this.index]:u.CesiumMath.lerp(this.first.getU(),this.second.getU(),this.ratio)},L.prototype.getV=function(){return s.defined(this.index)?this.vBuffer[this.index]:u.CesiumMath.lerp(this.first.getV(),this.second.getV(),this.ratio)};let Y=new n.Cartesian2,G=-1;const _=[new i.Cartesian3,new i.Cartesian3],j=[n
|