qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/FrustumGeometry-5b6f7f2c.js

2 lines
19 KiB
JavaScript
Raw Permalink Normal View History

2023-11-07 10:04:37 +08:00
define(["exports","./BoundingSphere-9a3b5656","./Cartesian3-e0307675","./Matrix4-4c545f70","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./defaultValue-81eec7ed","./GeometryAttribute-2b42a913","./GeometryAttributes-32b29525","./Math-e73894ab","./Plane-bc8b6777","./Transforms-5b829630","./VertexFormat-d50a69ba"],(function(t,e,a,i,n,r,o,s,f,u,l,h,c){"use strict";function p(t){this.planes=o.defaultValue(t,[])}const d=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,d[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,d[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,d[2]);const m=new a.Cartesian3,C=new a.Cartesian3,_=new l.Plane(new a.Cartesian3(1,0,0),0);function y(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 p,this._orthographicMatrix=new i.Matrix4}function g(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=i.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}p.fromBoundingSphere=function(t,e){o.defined(e)||(e=new p);const n=d.length,r=e.planes;r.length=2*n;const s=t.center,f=t.radius;let u=0;for(let t=0;t<n;++t){const e=d[t];let n=r[u],l=r[u+1];o.defined(n)||(n=r[u]=new i.Cartesian4),o.defined(l)||(l=r[u+1]=new i.Cartesian4),a.Cartesian3.multiplyByScalar(e,-f,m),a.Cartesian3.add(s,m,m),n.x=e.x,n.y=e.y,n.z=e.z,n.w=-a.Cartesian3.dot(e,m),a.Cartesian3.multiplyByScalar(e,f,m),a.Cartesian3.add(s,m,m),l.x=-e.x,l.y=-e.y,l.z=-e.z,l.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,C),m),u+=2}return e},p.prototype.computeVisibility=function(t){const a=this.planes;let i=!1;for(let n=0,r=a.length;n<r;++n){const r=t.intersectPlane(l.Plane.fromCartesian4(a[n],_));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(i=!0)}return i?e.Intersect.INTERSECTING:e.Intersect.INSIDE},p.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===p.MASK_OUTSIDE||a===p.MASK_INSIDE)return a;let i=p.MASK_INSIDE;const n=this.planes;for(let r=0,o=n.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(l.Plane.fromCartesian4(n[r],_));if(s===e.Intersect.OUTSIDE)return p.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(i|=o)}return i},p.MASK_OUTSIDE=4294967295,p.MASK_INSIDE=0,p.MASK_INDETERMINATE=2147483647,Object.defineProperties(y.prototype,{projectionMatrix:{get:function(){return g(this),this._orthographicMatrix}}});var w=new a.Cartesian3,x=new a.Cartesian3,v=new a.Cartesian3,b=new a.Cartesian3;function M(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new y,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 V(t){const 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;const 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 F(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 p,this._perspectiveMatrix=new i.Matrix4,this._infinitePerspective=new i.Matrix4}function E(t){const e=t.top,a=t.bottom,n=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&a===t._bottom&&r===t._left&&n===t._right&&o===t._near&