4x/irrigation-monitoring-platf.../public/Cesium/Workers/FrustumGeometry-eb154eb0.js

2 lines
19 KiB
JavaScript
Raw Permalink Normal View History

2024-12-26 19:24:07 +08:00
define(["exports","./Transforms-d13cc04e","./Matrix2-9aa31791","./RuntimeError-346a3079","./ComponentDatatype-93750d1a","./when-4bbc8319","./GeometryAttribute-43536dc0","./GeometryAttributes-7827a6c2","./Plane-318d6937","./VertexFormat-71718faa"],(function(t,e,a,i,r,n,o,s,f,u){"use strict";function l(t){this.planes=n.defaultValue(t,[])}var h=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,h[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,h[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,h[2]);var p=new a.Cartesian3,d=new a.Cartesian3,c=new f.Plane(new a.Cartesian3(1,0,0),0);function m(t){t=n.defaultValue(t,n.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=n.defaultValue(t.near,1),this._near=this.near,this.far=n.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._orthographicMatrix=new a.Matrix4}function C(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=a.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}l.fromBoundingSphere=function(t,e){n.defined(e)||(e=new l);var i=h.length,r=e.planes;r.length=2*i;for(var o=t.center,s=t.radius,f=0,u=0;u<i;++u){var c=h[u],m=r[f],C=r[f+1];n.defined(m)||(m=r[f]=new a.Cartesian4),n.defined(C)||(C=r[f+1]=new a.Cartesian4),a.Cartesian3.multiplyByScalar(c,-s,p),a.Cartesian3.add(o,p,p),m.x=c.x,m.y=c.y,m.z=c.z,m.w=-a.Cartesian3.dot(c,p),a.Cartesian3.multiplyByScalar(c,s,p),a.Cartesian3.add(o,p,p),C.x=-c.x,C.y=-c.y,C.z=-c.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(c,d),p),f+=2}return e},l.prototype.computeVisibility=function(t){for(var a=this.planes,i=!1,r=0,n=a.length;r<n;++r){var o=t.intersectPlane(f.Plane.fromCartesian4(a[r],c));if(o===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;o===e.Intersect.INTERSECTING&&(i=!0)}return i?e.Intersect.INTERSECTING:e.Intersect.INSIDE},l.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===l.MASK_OUTSIDE||a===l.MASK_INSIDE)return a;for(var i=l.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 u=t.intersectPlane(f.Plane.fromCartesian4(r[n],c));if(u===e.Intersect.OUTSIDE)return l.MASK_OUTSIDE;u===e.Intersect.INTERSECTING&&(i|=s)}}return i},l.MASK_OUTSIDE=4294967295,l.MASK_INSIDE=0,l.MASK_INDETERMINATE=2147483647,Object.defineProperties(m.prototype,{projectionMatrix:{get:function(){return C(this),this._orthographicMatrix}}});var _=new a.Cartesian3,y=new a.Cartesian3,v=new a.Cartesian3,g=new a.Cartesian3;function w(t){t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new m,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=n.defaultValue(t.near,1),this._near=this.near,this.far=n.defaultValue(t.far,5e8),this._far=this.far}function x(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 M(t){t=n.defaultValue(t,n.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=n.defaultValue(t.near,1),this._near=this.near,this.far=n.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new l,this._perspectiveMatrix=new a.Matrix4,this._infinitePerspective=new a.Matrix4}function b(t){var e=t.top,i=t.bottom,r=t.right,n=t.left,o=t.near,s=t.far;e===t._top&&i===t._bottom&&n===t._left&&r===t._right&&o===t._near&&s===t._far||(t._left=n,t._right=r,t._top=e,t._bottom=i,t._near=o,t._far=s,t._perspectiveMatrix=a.Matrix4.computePerspectiveOffCenter(n