define(["./when-e3a49219","./Transforms-a6362ad2","./Matrix2-ae0e0b05","./RuntimeError-ffc802eb","./ComponentDatatype-64cf6611","./FrustumGeometry-1963a2f5","./GeometryAttribute-50aef525","./GeometryAttributes-3db3f2c9","./combine-c7a1ec8a","./PixelFormat-83d70a69","./WebGLConstants-1c8239cc","./Plane-2bf1bb80","./VertexFormat-9bafa8ef"],(function(e,t,r,n,a,i,u,o,c,s,p,m,f){"use strict";function h(n){var a,u,o=n.frustum,c=n.orientation,s=n.origin,p=e.defaultValue(n._drawNearPlane,!0);o instanceof i.PerspectiveFrustum?(a=0,u=i.PerspectiveFrustum.packedLength):o instanceof i.OrthographicFrustum&&(a=1,u=i.OrthographicFrustum.packedLength),this._frustumType=a,this._frustum=o.clone(),this._origin=r.Cartesian3.clone(s),this._orientation=t.Quaternion.clone(c),this._drawNearPlane=p,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+u+r.Cartesian3.packedLength+t.Quaternion.packedLength}h.pack=function(n,a,u){u=e.defaultValue(u,0);var o=n._frustumType,c=n._frustum;return a[u++]=o,0===o?(i.PerspectiveFrustum.pack(c,a,u),u+=i.PerspectiveFrustum.packedLength):(i.OrthographicFrustum.pack(c,a,u),u+=i.OrthographicFrustum.packedLength),r.Cartesian3.pack(n._origin,a,u),u+=r.Cartesian3.packedLength,t.Quaternion.pack(n._orientation,a,u),a[u+=t.Quaternion.packedLength]=n._drawNearPlane?1:0,a};var d=new i.PerspectiveFrustum,g=new i.OrthographicFrustum,_=new t.Quaternion,k=new r.Cartesian3;return h.unpack=function(n,a,u){a=e.defaultValue(a,0);var o,c=n[a++];0===c?(o=i.PerspectiveFrustum.unpack(n,a,d),a+=i.PerspectiveFrustum.packedLength):(o=i.OrthographicFrustum.unpack(n,a,g),a+=i.OrthographicFrustum.packedLength);var s=r.Cartesian3.unpack(n,a,k);a+=r.Cartesian3.packedLength;var p=t.Quaternion.unpack(n,a,_),m=1===n[a+=t.Quaternion.packedLength];if(!e.defined(u))return new h({frustum:o,origin:s,orientation:p,_drawNearPlane:m});var f=c===u._frustumType?u._frustum:void 0;return u._frustum=o.clone(f),u._frustumType=c,u._origin=r.Cartesian3.clone(s,u._origin),u._orientation=t.Quaternion.clone(p,u._orientation),u._drawNearPlane=m,u},h.createGeometry=function(e){var r=e._frustumType,n=e._frustum,c=e._origin,s=e._orientation,p=e._drawNearPlane,m=new Float64Array(24);i.FrustumGeometry._computeNearFarPlanes(c,s,r,n,m);for(var f,h,d=new o.GeometryAttributes({position:new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})}),g=p?2:1,_=new Uint16Array(8*(g+1)),k=p?0:1;k<2;++k)h=4*k,_[f=p?8*k:0]=h,_[f+1]=h+1,_[f+2]=h+1,_[f+3]=h+2,_[f+4]=h+2,_[f+5]=h+3,_[f+6]=h+3,_[f+7]=h;for(k=0;k<2;++k)h=4*k,_[f=8*(g+k)]=h,_[f+1]=h+4,_[f+2]=h+1,_[f+3]=h+5,_[f+4]=h+2,_[f+5]=h+6,_[f+6]=h+3,_[f+7]=h+7;return new u.Geometry({attributes:d,indices:_,primitiveType:u.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromVertices(m)})},function(t,r){return e.defined(r)&&(t=h.unpack(t,r)),h.createGeometry(t)}}));
|