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
8.5 KiB
2 lines
8.5 KiB
12 months ago
|
define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Math-6a1814d8","./Cartesian2-c451a606","./Transforms-e4be2a30","./ComponentDatatype-7ee14e67","./AttributeCompression-bb3dc748"],function(t,y,e,f,b,v,s,x){"use strict";function i(t,e){this._ellipsoid=t,this._cameraPosition=new b.Cartesian3,this._cameraPositionInScaledSpace=new b.Cartesian3,this._distanceToLimbInScaledSpaceSquared=0,y.defined(e)&&(this.cameraPosition=e)}Object.defineProperties(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){var e=this._ellipsoid.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),i=b.Cartesian3.magnitudeSquared(e)-1;b.Cartesian3.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=e,this._distanceToLimbInScaledSpaceSquared=i}}});var m=new b.Cartesian3;i.prototype.isPointVisible=function(t){return h(this._ellipsoid.transformPositionToScaledSpace(t,m),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},i.prototype.isScaledSpacePointVisible=function(t){return h(t,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var n=new b.Cartesian3;i.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(t,e){var i,r,a=this._ellipsoid;return i=y.defined(e)&&e<0&&a.minimumRadius>-e?((r=n).x=this._cameraPosition.x/(a.radii.x+e),r.y=this._cameraPosition.y/(a.radii.y+e),r.z=this._cameraPosition.z/(a.radii.z+e),r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared),h(t,r,i)},i.prototype.computeHorizonCullingPoint=function(t,e,i){return d(this._ellipsoid,t,e,i)};var o=b.Ellipsoid.clone(b.Ellipsoid.UNIT_SPHERE);i.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(t,e,i,r){return d(u(this._ellipsoid,i,o),t,e,r)},i.prototype.computeHorizonCullingPointFromVertices=function(t,e,i,r,a){return p(this._ellipsoid,t,e,i,r,a)},i.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(t,e,i,r,a,n){return p(u(this._ellipsoid,a,o),t,e,i,r,n)};var c=[];i.prototype.computeHorizonCullingPointFromRectangle=function(t,e,i){var r=b.Rectangle.subsample(t,e,0,c),a=v.BoundingSphere.fromPoints(r);if(!(b.Cartesian3.magnitude(a.center)<.1*e.minimumRadius))return this.computeHorizonCullingPoint(a.center,r,i)};var a=new b.Cartesian3;function u(t,e,i){if(y.defined(e)&&e<0&&t.minimumRadius>-e){var r=b.Cartesian3.fromElements(t.radii.x+e,t.radii.y+e,t.radii.z+e,a);t=b.Ellipsoid.fromCartesian3(r,i)}return t}function d(t,e,i,r){y.defined(r)||(r=new b.Cartesian3);for(var a=T(t,e),n=0,o=0,s=i.length;o<s;++o){var m=M(t,i[o],a);if(m<0)return;n=Math.max(n,m)}return g(a,n,r)}var l=new b.Cartesian3;function p(t,e,i,r,a,n){y.defined(n)||(n=new b.Cartesian3),r=y.defaultValue(r,3),a=y.defaultValue(a,b.Cartesian3.ZERO);for(var o=T(t,e),s=0,m=0,c=i.length;m<c;m+=r){l.x=i[m]+a.x,l.y=i[m+1]+a.y,l.z=i[m+2]+a.z;var u=M(t,l,o);if(u<0)return;s=Math.max(s,u)}return g(o,s,n)}function h(t,e,i){var r=e,a=i,n=b.Cartesian3.subtract(t,r,m),o=-b.Cartesian3.dot(n,r);return!(a<0?0<o:a<o&&o*o/b.Cartesian3.magnitudeSquared(n)>a)}var C=new b.Cartesian3,S=new b.Cartesian3;function M(t,e,i){var r=t.transformPositionToScaledSpace(e,C),a=b.Cartesian3.magnitudeSquared(r),n=Math.sqrt(a),o=b.Cartesian3.divideByScalar(r,n,S);a=Math.max(1,a);var s=1/(n=Math.max(1,n));return 1/(b.Cartesian3.dot(o,i)*s-b.Cartesian3.magnitude(b.Cartesian3.cross(o,i,o))*(Math.sqrt(a-1)*s))}function g(t,e,i){if(!(e<=0||e===1/0||e!=e))return b.Cartesian3.multiplyByScalar(t,e,i)}var r=new b.Cartesian3;function T(t,e){return b.Cartesian3.equals(e,b.Cartesian3.ZERO)?e:(t.transformPositionToScaledSpace(e,r),b.Cartesian3.normalize(r,r))}var P=Object.freeze({NONE:0,BITS12:1}),z=new b.Cartesian3,E=new b.Cartesian3,N=new b.Cartesian2,I=new v.Matrix4,B=new v.Matrix4,_=Math.pow(2,12);function w(t,e,i,r,a,n){var o,s,m,c=P.NONE;if(y.defined(t)&&y.defined(e)&&y.defined(i)&&y.defined(r)){var u=t.minimum,d=t.maximum,l=b.Cartesian3.subtract(d,u,E),p=i-e;c=Math.max(b.Cartesian3.maximumComponent
|