You cannot 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
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
define(["./when-208fe5b0","./Transforms-a73b3b3b","./Cartesian2-8417ca3d","./Check-d18af7c4","./ComponentDatatype-9204e9f6","./FrustumGeometry-00e2e34e","./GeometryAttribute-04a19cfe","./GeometryAttributes-b0b294d8","./Math-4e53b694","./RuntimeError-7f634f5d","./WebGLConstants-76bb35d1","./Plane-4aa8974d","./VertexFormat-e8cbf5b3"],function(o,m,s,e,h,f,d,g,t,r,n,a,u){"use strict";var c=0,i=1;function p(e){var t,r,n=e.frustum,a=e.orientation,u=e.origin,e=o.defaultValue(e._drawNearPlane,!0);n instanceof f.PerspectiveFrustum?(t=c,r=f.PerspectiveFrustum.packedLength):n instanceof f.OrthographicFrustum&&(t=i,r=f.OrthographicFrustum.packedLength),this._frustumType=t,this._frustum=n.clone(),this._origin=s.Cartesian3.clone(u),this._orientation=m.Quaternion.clone(a),this._drawNearPlane=e,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+r+s.Cartesian3.packedLength+m.Quaternion.packedLength}p.pack=function(e,t,r){r=o.defaultValue(r,0);var n=e._frustumType,a=e._frustum;return(t[r++]=n)===c?(f.PerspectiveFrustum.pack(a,t,r),r+=f.PerspectiveFrustum.packedLength):(f.OrthographicFrustum.pack(a,t,r),r+=f.OrthographicFrustum.packedLength),s.Cartesian3.pack(e._origin,t,r),r+=s.Cartesian3.packedLength,m.Quaternion.pack(e._orientation,t,r),t[r+=m.Quaternion.packedLength]=e._drawNearPlane?1:0,t};var _=new f.PerspectiveFrustum,k=new f.OrthographicFrustum,l=new m.Quaternion,y=new s.Cartesian3;return p.unpack=function(e,t,r){t=o.defaultValue(t,0);var n,a=e[t++];a===c?(n=f.PerspectiveFrustum.unpack(e,t,_),t+=f.PerspectiveFrustum.packedLength):(n=f.OrthographicFrustum.unpack(e,t,k),t+=f.OrthographicFrustum.packedLength);var u=s.Cartesian3.unpack(e,t,y);t+=s.Cartesian3.packedLength;var i=m.Quaternion.unpack(e,t,l),e=1===e[t+=m.Quaternion.packedLength];if(!o.defined(r))return new p({frustum:n,origin:u,orientation:i,_drawNearPlane:e});t=a===r._frustumType?r._frustum:void 0;return r._frustum=n.clone(t),r._frustumType=a,r._origin=s.Cartesian3.clone(u,r._origin),r._orientation=m.Quaternion.clone(i,r._orientation),r._drawNearPlane=e,r},p.createGeometry=function(e){var t=e._frustumType,r=e._frustum,n=e._origin,a=e._orientation,u=e._drawNearPlane,e=new Float64Array(24);f.FrustumGeometry._computeNearFarPlanes(n,a,t,r,e);for(var i,o,r=new g.GeometryAttributes({position:new d.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}),s=u?2:1,c=new Uint16Array(8*(1+s)),p=u?0:1;p<2;++p)c[i=u?8*p:0]=o=4*p,c[i+1]=o+1,c[i+2]=o+1,c[i+3]=o+2,c[i+4]=o+2,c[i+5]=o+3,c[i+6]=o+3,c[i+7]=o;for(p=0;p<2;++p)c[i=8*(s+p)]=o=4*p,c[i+1]=o+4,c[i+2]=o+1,c[i+3]=o+5,c[i+4]=o+2,c[i+5]=o+6,c[i+6]=o+3,c[i+7]=o+7;return new d.Geometry({attributes:r,indices:c,primitiveType:d.PrimitiveType.LINES,boundingSphere:m.BoundingSphere.fromVertices(e)})},function(e,t){return o.defined(t)&&(e=p.unpack(e,t)),p.createGeometry(e)}});
|