You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
19 KiB

define(["exports","./when-54c2dc71","./Check-6c0211bc","./Math-fc8cecf5","./Cartesian2-bddc1162","./Transforms-d07bb42c","./ComponentDatatype-6d99a1ee","./GeometryAttribute-be1a3386","./GeometryAttributes-4fcfcf40","./Plane-c8971487","./VertexFormat-7572c785"],function(t,v,e,i,g,w,x,b,M,f,u){"use strict";function h(t){this.planes=v.defaultValue(t,[])}var p=[new g.Cartesian3,new g.Cartesian3,new g.Cartesian3];g.Cartesian3.clone(g.Cartesian3.UNIT_X,p[0]),g.Cartesian3.clone(g.Cartesian3.UNIT_Y,p[1]),g.Cartesian3.clone(g.Cartesian3.UNIT_Z,p[2]);var c=new g.Cartesian3,d=new g.Cartesian3,l=new f.Plane(new g.Cartesian3(1,0,0),0);function r(t){t=v.defaultValue(t,v.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=v.defaultValue(t.near,1),this._near=this.near,this.far=v.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._orthographicMatrix=new w.Matrix4}function n(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=w.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}h.fromBoundingSphere=function(t,e){v.defined(e)||(e=new h);var a=p.length,i=e.planes;i.length=2*a;for(var r=t.center,n=t.radius,o=0,s=0;s<a;++s){var f=p[s],u=i[o],l=i[o+1];v.defined(u)||(u=i[o]=new w.Cartesian4),v.defined(l)||(l=i[o+1]=new w.Cartesian4),g.Cartesian3.multiplyByScalar(f,-n,c),g.Cartesian3.add(r,c,c),u.x=f.x,u.y=f.y,u.z=f.z,u.w=-g.Cartesian3.dot(f,c),g.Cartesian3.multiplyByScalar(f,n,c),g.Cartesian3.add(r,c,c),l.x=-f.x,l.y=-f.y,l.z=-f.z,l.w=-g.Cartesian3.dot(g.Cartesian3.negate(f,d),c),o+=2}return e},h.prototype.computeVisibility=function(t){for(var e=this.planes,a=!1,i=0,r=e.length;i<r;++i){var n=t.intersectPlane(f.Plane.fromCartesian4(e[i],l));if(n===w.Intersect.OUTSIDE)return w.Intersect.OUTSIDE;n===w.Intersect.INTERSECTING&&(a=!0)}return a?w.Intersect.INTERSECTING:w.Intersect.INSIDE},h.prototype.computeVisibilityWithPlaneMask=function(t,e){if(e===h.MASK_OUTSIDE||e===h.MASK_INSIDE)return e;for(var a=h.MASK_INSIDE,i=this.planes,r=0,n=i.length;r<n;++r){var o=r<31?1<<r:0;if(!(r<31&&0==(e&o))){var s=t.intersectPlane(f.Plane.fromCartesian4(i[r],l));if(s===w.Intersect.OUTSIDE)return h.MASK_OUTSIDE;s===w.Intersect.INTERSECTING&&(a|=o)}}return a},h.MASK_OUTSIDE=4294967295,h.MASK_INSIDE=0,h.MASK_INDETERMINATE=2147483647,Object.defineProperties(r.prototype,{projectionMatrix:{get:function(){return n(this),this._orthographicMatrix}}});var m=new g.Cartesian3,C=new g.Cartesian3,_=new g.Cartesian3,y=new g.Cartesian3;function F(t){t=v.defaultValue(t,v.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new r,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=v.defaultValue(t.near,1),this._near=this.near,this.far=v.defaultValue(t.far,5e8),this._far=this.far}function o(t){var e,a=t._offCenterFrustum;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,e=1/t.aspectRatio,a.right=.5*t.width,a.left=-a.right,a.top=e*a.right,a.bottom=-a.top,a.near=t.near,a.far=t.far)}function s(t){t=v.defaultValue(t,v.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=v.defaultValue(t.near,1),this._near=this.near,this.far=v.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._perspectiveMatrix=new w.Matrix4,this._infinitePerspective=new w.Matrix4}function V(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._near=n,t._far=o,t._perspectiveMatrix=w.Matrix4.computePerspective