1 |
- define(["./defaultValue-81eec7ed","./Transforms-98ffa11d","./Cartesian3-7e9cc2ff","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./FrustumGeometry-9ddc69b6","./GeometryAttribute-b025f9a8","./GeometryAttributes-32b29525","./Matrix2-e3fb4559","./Math-5f585871","./Matrix4-d34187af","./RuntimeError-26acdd3b","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda","./WebGLConstants-508b9636","./Plane-4f75b3df","./VertexFormat-d50a69ba"],(function(e,t,r,n,a,i,u,o,c,s,p,m,f,d,h,l,g){"use strict";function _(n){const a=n.frustum,u=n.orientation,o=n.origin,c=e.defaultValue(n._drawNearPlane,!0);let s,p;a instanceof i.PerspectiveFrustum?(s=0,p=i.PerspectiveFrustum.packedLength):a instanceof i.OrthographicFrustum&&(s=1,p=i.OrthographicFrustum.packedLength),this._frustumType=s,this._frustum=a.clone(),this._origin=r.Cartesian3.clone(o),this._orientation=t.Quaternion.clone(u),this._drawNearPlane=c,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+p+r.Cartesian3.packedLength+t.Quaternion.packedLength}_.pack=function(n,a,u){u=e.defaultValue(u,0);const 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};const k=new i.PerspectiveFrustum,y=new i.OrthographicFrustum,F=new t.Quaternion,b=new r.Cartesian3;return _.unpack=function(n,a,u){a=e.defaultValue(a,0);const o=n[a++];let c;0===o?(c=i.PerspectiveFrustum.unpack(n,a,k),a+=i.PerspectiveFrustum.packedLength):(c=i.OrthographicFrustum.unpack(n,a,y),a+=i.OrthographicFrustum.packedLength);const s=r.Cartesian3.unpack(n,a,b);a+=r.Cartesian3.packedLength;const p=t.Quaternion.unpack(n,a,F),m=1===n[a+=t.Quaternion.packedLength];if(!e.defined(u))return new _({frustum:c,origin:s,orientation:p,_drawNearPlane:m});const f=o===u._frustumType?u._frustum:void 0;return u._frustum=c.clone(f),u._frustumType=o,u._origin=r.Cartesian3.clone(s,u._origin),u._orientation=t.Quaternion.clone(p,u._orientation),u._drawNearPlane=m,u},_.createGeometry=function(e){const 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);const f=new o.GeometryAttributes({position:new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:m})});let d,h;const l=p?2:1,g=new Uint16Array(8*(l+1));let _=p?0:1;for(;_<2;++_)d=p?8*_:0,h=4*_,g[d]=h,g[d+1]=h+1,g[d+2]=h+1,g[d+3]=h+2,g[d+4]=h+2,g[d+5]=h+3,g[d+6]=h+3,g[d+7]=h;for(_=0;_<2;++_)d=8*(l+_),h=4*_,g[d]=h,g[d+1]=h+4,g[d+2]=h+1,g[d+3]=h+5,g[d+4]=h+2,g[d+5]=h+6,g[d+6]=h+3,g[d+7]=h+7;return new u.Geometry({attributes:f,indices:g,primitiveType:u.PrimitiveType.LINES,boundingSphere:t.BoundingSphere.fromVertices(m)})},function(t,r){return e.defined(r)&&(t=_.unpack(t,r)),_.createGeometry(t)}}));
|