bimland/public/Cesium/Workers/FrustumGeometry-9d84ae9b.js

2 lines
20 KiB
JavaScript
Raw Permalink Normal View History

2023-07-26 17:04:38 +08:00
define(["exports","./buildModuleUrl-4e1b81e7","./Cartographic-3309dd0d","./Cartesian4-3ca25aab","./Check-7b2a090c","./ComponentDatatype-c140a87d","./when-b60132fc","./GeometryAttribute-3a88ba31","./GeometryAttributes-252e9929","./PrimitiveType-a54dc62f","./Math-119be1a3","./Plane-7ae8294c","./VertexFormat-6446fca0"],(function(t,e,a,i,r,n,o,s,f,u,l,h,p){"use strict";function c(t){this.planes=o.defaultValue(t,[])}var 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]);var m=new a.Cartesian3,C=new a.Cartesian3,_=new h.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 c,this._orthographicMatrix=new u.Matrix4}function v(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=u.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}c.fromBoundingSphere=function(t,e){o.defined(e)||(e=new c);var r=d.length,n=e.planes;n.length=2*r;for(var s=t.center,f=t.radius,u=0,l=0;l<r;++l){var h=d[l],p=n[u],_=n[u+1];o.defined(p)||(p=n[u]=new i.Cartesian4),o.defined(_)||(_=n[u+1]=new i.Cartesian4),a.Cartesian3.multiplyByScalar(h,-f,m),a.Cartesian3.add(s,m,m),p.x=h.x,p.y=h.y,p.z=h.z,p.w=-a.Cartesian3.dot(h,m),a.Cartesian3.multiplyByScalar(h,f,m),a.Cartesian3.add(s,m,m),_.x=-h.x,_.y=-h.y,_.z=-h.z,_.w=-a.Cartesian3.dot(a.Cartesian3.negate(h,C),m),u+=2}return e},c.prototype.computeVisibility=function(t){for(var a=this.planes,i=!1,r=0,n=a.length;r<n;++r){var o=t.intersectPlane(h.Plane.fromCartesian4(a[r],_));if(o===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;o===e.Intersect.INTERSECTING&&(i=!0)}return i?e.Intersect.INTERSECTING:e.Intersect.INSIDE},c.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===c.MASK_OUTSIDE||a===c.MASK_INSIDE)return a;for(var i=c.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],_));if(f===e.Intersect.OUTSIDE)return c.MASK_OUTSIDE;f===e.Intersect.INTERSECTING&&(i|=s)}}return i},c.MASK_OUTSIDE=4294967295,c.MASK_INSIDE=0,c.MASK_INDETERMINATE=2147483647,Object.defineProperties(y.prototype,{projectionMatrix:{get:function(){return v(this),this._orthographicMatrix}}});var w=new a.Cartesian3,g=new a.Cartesian3,x=new a.Cartesian3,M=new a.Cartesian3;function b(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){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 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 c,this._perspectiveMatrix=new u.Matrix4,this._infinitePerspective=new u.Matrix4}function P(t){var e=t.top,a=t.bottom,i=t.right,r=t.left,n=t.near,o=t.far;e===t._top&&a===t._bottom&&r===t._left&&i===t._right&&n===t._near&&o===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=a,t.