Agriculture-front-end/dist/Cesium/Workers/FrustumGeometry-96291783.js

2 lines
20 KiB
JavaScript
Raw Normal View History

2023-09-11 21:56:39 +08:00
define(["exports","./BoundingSphere-561b54d0","./Cartographic-3309dd0d","./Cartesian4-3ca25aab","./Check-7b2a090c","./ComponentDatatype-c140a87d","./when-b60132fc","./GeometryAttribute-3a42bbdc","./GeometryAttributes-252e9929","./Math-119be1a3","./Plane-097b3a8f","./PrimitiveType-39acab88","./Transforms-cb0006b0","./VertexFormat-6446fca0"],(function(t,e,a,i,r,n,o,s,f,u,h,l,p,c){"use strict";function d(t){this.planes=o.defaultValue(t,[]),this.enableFusion=!1}var m=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,m[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,m[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,m[2]);var C=new a.Cartesian3,_=new a.Cartesian3,y=new h.Plane(new a.Cartesian3(1,0,0),0);function v(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=o.defaultValue(t.near,1),this._near=this.near,this.far=o.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new d,this._orthographicMatrix=new e.Matrix4}function w(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=e.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}d.fromBoundingSphere=function(t,e){o.defined(e)||(e=new d);var r=m.length,n=e.planes;n.length=2*r;for(var s=t.center,f=t.radius,u=0,h=0;h<r;++h){var l=m[h],p=n[u],c=n[u+1];o.defined(p)||(p=n[u]=new i.Cartesian4),o.defined(c)||(c=n[u+1]=new i.Cartesian4),a.Cartesian3.multiplyByScalar(l,-f,C),a.Cartesian3.add(s,C,C),p.x=l.x,p.y=l.y,p.z=l.z,p.w=-a.Cartesian3.dot(l,C),a.Cartesian3.multiplyByScalar(l,f,C),a.Cartesian3.add(s,C,C),c.x=-l.x,c.y=-l.y,c.z=-l.z,c.w=-a.Cartesian3.dot(a.Cartesian3.negate(l,_),C),u+=2}return e},d.prototype.computeVisibility=function(t){if(this.enableFusion)return e.Intersect.INSIDE;for(var a=this.planes,i=!1,r=0,n=a.length;r<n;++r){var o=t.intersectPlane(h.Plane.fromCartesian4(a[r],y));if(o===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;o===e.Intersect.INTERSECTING&&(i=!0)}return i?e.Intersect.INTERSECTING:e.Intersect.INSIDE},d.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===d.MASK_OUTSIDE||a===d.MASK_INSIDE)return a;for(var i=d.MASK_INSIDE,r=this.planes,n=0,o=r.length;n<o;++n){var s=n<31?1<<n:0;if(!(n<31&&0==(a&s))){var f=t.intersectPlane(h.Plane.fromCartesian4(r[n],y));if(f===e.Intersect.OUTSIDE)return d.MASK_OUTSIDE;f===e.Intersect.INTERSECTING&&(i|=s)}}return i},d.MASK_OUTSIDE=4294967295,d.MASK_INSIDE=0,d.MASK_INDETERMINATE=2147483647,Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){return w(this),this._orthographicMatrix}}});var g=new a.Cartesian3,x=new a.Cartesian3,M=new a.Cartesian3,b=new a.Cartesian3;function V(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new v,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=o.defaultValue(t.near,1),this._near=this.near,this.far=o.defaultValue(t.far,5e8),this._far=this.far}function F(t){var e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;var a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function P(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=o.defaultValue(t.near,1),this._near=this.near,this.far=o.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new d,this._perspectiveMatrix=new e.Matrix4,this._infinitePerspective=new e.Matrix4}function E(t){var a=t.top,i=t.bottom,r=t.right,n=t.left,o=t.near,s=t.far;a===t._top&&i===t._bottom&&n==