2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
|
/* 2020-9-22 15:23:25 | 版权所有 军懋国兴 */
|
||
|
define(["./when-cbf8cd21","./Check-35e1a91d","./Math-69007a69","./Cartesian2-43e3a3be","./Transforms-2d1ac5ec","./RuntimeError-f4c64df1","./WebGLConstants-95ceb4e9","./ComponentDatatype-607c9a0c","./AttributeCompression-ea810287","./IndexDatatype-79bb407c","./IntersectionTests-459f6f08","./Plane-46b5436f","./createTaskProcessorWorker","./EllipsoidTangentPlane-b5927ee3","./OrientedBoundingBox-5e0b7a7c","./TerrainEncoding-848fa40b"],function(v,C,ce,ge,me,e,i,r,n,we,t,s,h,u,xe,ve){"use strict";var Ce={clipTriangleAtAxisAlignedThreshold:function(e,i,r,t,n,s){if(!v.defined(e))throw new C.DeveloperError("threshold is required.");if(!v.defined(i))throw new C.DeveloperError("keepAbove is required.");if(!v.defined(r))throw new C.DeveloperError("u0 is required.");if(!v.defined(t))throw new C.DeveloperError("u1 is required.");if(!v.defined(n))throw new C.DeveloperError("u2 is required.");var h,u,o;v.defined(s)?s.length=0:s=[],o=i?(h=r<e,u=t<e,n<e):(h=e<r,u=e<t,e<n);var d,p,a,f,l,c,g=h+u+o;return 1===g?h?(d=(e-r)/(t-r),p=(e-r)/(n-r),s.push(1),s.push(2),1!==p&&(s.push(-1),s.push(0),s.push(2),s.push(p)),1!==d&&(s.push(-1),s.push(0),s.push(1),s.push(d))):u?(a=(e-t)/(n-t),f=(e-t)/(r-t),s.push(2),s.push(0),1!==f&&(s.push(-1),s.push(1),s.push(0),s.push(f)),1!==a&&(s.push(-1),s.push(1),s.push(2),s.push(a))):o&&(l=(e-n)/(r-n),c=(e-n)/(t-n),s.push(0),s.push(1),1!==c&&(s.push(-1),s.push(2),s.push(1),s.push(c)),1!==l&&(s.push(-1),s.push(2),s.push(0),s.push(l))):2===g?h||r===e?u||t===e?o||n===e||(p=(e-r)/(n-r),a=(e-t)/(n-t),s.push(2),s.push(-1),s.push(0),s.push(2),s.push(p),s.push(-1),s.push(1),s.push(2),s.push(a)):(c=(e-n)/(t-n),d=(e-r)/(t-r),s.push(1),s.push(-1),s.push(2),s.push(1),s.push(c),s.push(-1),s.push(0),s.push(1),s.push(d)):(f=(e-t)/(r-t),l=(e-n)/(r-n),s.push(0),s.push(-1),s.push(1),s.push(0),s.push(f),s.push(-1),s.push(2),s.push(0),s.push(l)):3!==g&&(s.push(0),s.push(1),s.push(2)),s},computeBarycentricCoordinates:function(e,i,r,t,n,s,h,u,o){if(!v.defined(e))throw new C.DeveloperError("x is required.");if(!v.defined(i))throw new C.DeveloperError("y is required.");if(!v.defined(r))throw new C.DeveloperError("x1 is required.");if(!v.defined(t))throw new C.DeveloperError("y1 is required.");if(!v.defined(n))throw new C.DeveloperError("x2 is required.");if(!v.defined(s))throw new C.DeveloperError("y2 is required.");if(!v.defined(h))throw new C.DeveloperError("x3 is required.");if(!v.defined(u))throw new C.DeveloperError("y3 is required.");var d=r-h,p=h-n,a=s-u,f=t-u,l=1/(a*d+p*f),c=i-u,g=e-h,m=(a*g+p*c)*l,w=(-f*g+d*c)*l,x=1-m-w;return v.defined(o)?(o.x=m,o.y=w,o.z=x,o):new ge.Cartesian3(m,w,x)},computeLineSegmentLineSegmentIntersection:function(e,i,r,t,n,s,h,u,o){C.Check.typeOf.number("x00",e),C.Check.typeOf.number("y00",i),C.Check.typeOf.number("x01",r),C.Check.typeOf.number("y01",t),C.Check.typeOf.number("x10",n),C.Check.typeOf.number("y10",s),C.Check.typeOf.number("x11",h),C.Check.typeOf.number("y11",u);var d=(u-s)*(r-e)-(h-n)*(t-i);if(0!=d){var p=((h-n)*(i-s)-(u-s)*(e-n))/d,a=((r-e)*(i-s)-(t-i)*(e-n))/d;return 0<=p&&p<=1&&0<=a&&a<=1?(v.defined(o)||(o=new ge.Cartesian2),o.x=e+p*(r-e),o.y=i+p*(t-i),o):void 0}}},ye=32767,be=16383,Be=[],Ie=[],Ae=[],Ee=new ge.Cartographic,De=new ge.Cartesian3,Te=[],Oe=[],ze=[],ke=[],Me=[],Ne=new ge.Cartesian3,Ve=new me.BoundingSphere,qe=new xe.OrientedBoundingBox,Re=new ge.Cartesian2,He=new ge.Cartesian3;function Se(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}Se.prototype.clone=function(e){return v.defined(e)||(e=new Se),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},Se.prototype.initializeIndexed=function(e,i,r,t,n){this.uBuffer=e,this.vBuffer=i,this.heightBuffer=r,this.normalBuffer=t,this.index=n,this.first=void 0,this.second=void 0,this.ratio=void 0},Se.prototype.initializeFromClipResult=function(e,i,r){var t=i+1;return-1!==e[i]?r[e[i]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=r
|