/** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * * 该版本修改了部分代码,主要是汉化、优化功能、添加接口 等 by 火星科技 http://marsgis.cn * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. */ define(["exports","./defined-b9ff0e39","./Check-e6691f86","./defaultValue-199f5aa8","./Math-92bd3539","./Cartesian2-8fa798b8","./Transforms-a140c8a7","./Plane-b9a516bb","./EllipsoidTangentPlane-9b89fc6c"],function(a,E,t,A,e,P,L,O,v){"use strict";function I(a,t){this.center=P.Cartesian3.clone(A.defaultValue(a,P.Cartesian3.ZERO)),this.halfAxes=L.Matrix3.clone(A.defaultValue(t,L.Matrix3.ZERO))}I.packedLength=P.Cartesian3.packedLength+L.Matrix3.packedLength,I.pack=function(a,t,e){return e=A.defaultValue(e,0),P.Cartesian3.pack(a.center,t,e),L.Matrix3.pack(a.halfAxes,t,e+P.Cartesian3.packedLength),t},I.unpack=function(a,t,e){return t=A.defaultValue(t,0),E.defined(e)||(e=new I),P.Cartesian3.unpack(a,t,e.center),L.Matrix3.unpack(a,t+P.Cartesian3.packedLength,e.halfAxes),e};var S=new P.Cartesian3,V=new P.Cartesian3,z=new P.Cartesian3,T=new P.Cartesian3,R=new P.Cartesian3,U=new P.Cartesian3,B=new L.Matrix3,k={unitary:new L.Matrix3,diagonal:new L.Matrix3};I.fromPoints=function(a,t){if(E.defined(t)||(t=new I),!E.defined(a)||0===a.length)return t.halfAxes=L.Matrix3.ZERO,t.center=P.Cartesian3.ZERO,t;var e,n=a.length,r=P.Cartesian3.clone(a[0],S);for(e=1;eu&&(d+=(l=c.x-u)*l),c.y<-C?d+=(l=c.y+C)*l:c.y>C&&(d+=(l=c.y-C)*l),c.z<-o?d+=(l=c.z+o)*l:c.z>o&&(d+=(l=c.z-o)*l),d};var f=new P.Cartesian3,g=new P.Cartesian3;I.computePlaneDistances=function(a,t,e,n){E.defined(n)||(n=new L.Interval);var r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=a.center,u=a.halfAxes,C=L.Matrix3.getColumn(u,0,x),o=L.Matrix3.getColumn(u,1,M),c=L.Matrix3.getColumn(u,2,m),l=P.Cartesian3.add(C,o,f);P.Cartesian3.add(l,c,l),P.Cartesian3.add(l,s,l);var d=P.Cartesian3.subtract(l,t,g),h=P.Cartesian3.dot(e,d);return r=Math.min(h,r),i=Math.max(h,i),P.Cartesian3.add(s,C,l),P.Cartesian3.add(l,o,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.subtract(l,t,d),h=P.Cartesian3.dot(e,d),r=Math.min(h,r),i=Math.max(h,i),P.Cartesian3.add(s,C,l),P.Cartesian3.subtract(l,o,l),P.Cartesian3.add(l,c,l),P.Cartesian3.subtract(l,t,d),h=P.Cartesian3.dot(e,d),r=Math.min(h,r),i=Math.max(h,i),P.Cartesian3.add(s,C,l),P.Cartesian3.subtract(l,o,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.subtract(l,t,d),h=P.Cartesian3.dot(e,d),r=Math.min(h,r),i=Math.max(h,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.add(l,o,l),P.Cartesian3.add(l,c,l),P.Cartesian3.subtract(l,t,d),h=P.Cartesian3.dot(e,d),r=Math.min(h,r),i=Math.max(h,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.add(l,o,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.subtract(l,t,d),h=P.Cartesian3.dot(e,d),r=Math.min(h,r),i=Math.max(h,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.subtract(l,o,l),P.Cartesian3.add(l,c,l),P.Cartesian3.subtract(l,t,d),h=P.Cartesian3.dot(e,d),r=Math.min(h,r),i=Math.max(h,i),P.Cartesian3.subtract(s,C,l),P.Cartesian3.subtract(l,o,l),P.Cartesian3.subtract(l,c,l),P.Cartesian3.subtract(l,t,d),h=P.Cartesian3.dot(e,d),r=Math.min(h,r),i=Math.max(h,i),n.start=r,n.stop=i,n};var n=new L.BoundingSphere;I.isOccluded=function(a,t){var e=L.BoundingSphere.fromOrientedBoundingBox(a,n);return!t.isBoundingSphereVisible(e)},I.prototype.intersectPlane=function(a){return I.intersectPlane(this,a)},I.prototype.distanceSquaredTo=function(a){return I.distanceSquaredTo(this,a)},I.prototype.computePlaneDistances=function(a,t,e){return I.computePlaneDistances(this,a,t,e)},I.prototype.isOccluded=function(a){return I.isOccluded(this,a)},I.equals=function(a,t){return a===t||E.defined(a)&&E.defined(t)&&P.Cartesian3.equals(a.center,t.center)&&L.Matrix3.equals(a.halfAxes,t.halfAxes)},I.prototype.clone=function(a){return I.clone(this,a)},I.prototype.equals=function(a){return I.equals(this,a)},a.OrientedBoundingBox=I});