1 |
- define(["exports","./Transforms-98ffa11d","./Cartesian3-7e9cc2ff","./Matrix4-d34187af","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./defaultValue-81eec7ed","./GeometryAttribute-b025f9a8","./GeometryAttributes-32b29525","./Math-5f585871","./Plane-4f75b3df","./VertexFormat-d50a69ba"],(function(t,e,a,n,i,r,o,s,f,u,l,c){"use strict";function h(t){this.planes=o.defaultValue(t,[])}const p=[new a.Cartesian3,new a.Cartesian3,new a.Cartesian3];a.Cartesian3.clone(a.Cartesian3.UNIT_X,p[0]),a.Cartesian3.clone(a.Cartesian3.UNIT_Y,p[1]),a.Cartesian3.clone(a.Cartesian3.UNIT_Z,p[2]);const d=new a.Cartesian3,m=new a.Cartesian3,C=new l.Plane(new a.Cartesian3(1,0,0),0);function _(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=o.defaultValue(t.near,1),this._near=this.near,this.far=o.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._orthographicMatrix=new n.Matrix4}function y(t){t.top===t._top&&t.bottom===t._bottom&&t.left===t._left&&t.right===t._right&&t.near===t._near&&t.far===t._far||(t._left=t.left,t._right=t.right,t._top=t.top,t._bottom=t.bottom,t._near=t.near,t._far=t.far,t._orthographicMatrix=n.Matrix4.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix))}h.fromBoundingSphere=function(t,e){o.defined(e)||(e=new h);const i=p.length,r=e.planes;r.length=2*i;const s=t.center,f=t.radius;let u=0;for(let t=0;t<i;++t){const e=p[t];let i=r[u],l=r[u+1];o.defined(i)||(i=r[u]=new n.Cartesian4),o.defined(l)||(l=r[u+1]=new n.Cartesian4),a.Cartesian3.multiplyByScalar(e,-f,d),a.Cartesian3.add(s,d,d),i.x=e.x,i.y=e.y,i.z=e.z,i.w=-a.Cartesian3.dot(e,d),a.Cartesian3.multiplyByScalar(e,f,d),a.Cartesian3.add(s,d,d),l.x=-e.x,l.y=-e.y,l.z=-e.z,l.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,m),d),u+=2}return e},h.prototype.computeVisibility=function(t){const a=this.planes;let n=!1;for(let i=0,r=a.length;i<r;++i){const r=t.intersectPlane(l.Plane.fromCartesian4(a[i],C));if(r===e.Intersect.OUTSIDE)return e.Intersect.OUTSIDE;r===e.Intersect.INTERSECTING&&(n=!0)}return n?e.Intersect.INTERSECTING:e.Intersect.INSIDE},h.prototype.computeVisibilityWithPlaneMask=function(t,a){if(a===h.MASK_OUTSIDE||a===h.MASK_INSIDE)return a;let n=h.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(a&o))continue;const s=t.intersectPlane(l.Plane.fromCartesian4(i[r],C));if(s===e.Intersect.OUTSIDE)return h.MASK_OUTSIDE;s===e.Intersect.INTERSECTING&&(n|=o)}return n},h.MASK_OUTSIDE=4294967295,h.MASK_INSIDE=0,h.MASK_INDETERMINATE=2147483647,Object.defineProperties(_.prototype,{projectionMatrix:{get:function(){return y(this),this._orthographicMatrix}}});const g=new a.Cartesian3,w=new a.Cartesian3,x=new a.Cartesian3,v=new a.Cartesian3;function M(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new _,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=o.defaultValue(t.near,1),this._near=this.near,this.far=o.defaultValue(t.far,5e8),this._far=this.far}function b(t){const e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;const a=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=a*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}function V(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this.left=t.left,this._left=void 0,this.right=t.right,this._right=void 0,this.top=t.top,this._top=void 0,this.bottom=t.bottom,this._bottom=void 0,this.near=o.defaultValue(t.near,1),this._near=this.near,this.far=o.defaultValue(t.far,5e8),this._far=this.far,this._cullingVolume=new h,this._perspectiveMatrix=new n.Matrix4,this._infinitePerspective=new n.Matrix4}function F(t){const e=t.top,a=t.bottom,i=t.right,r=t.left,o=t.near,s=t.far;e===t._top&&a===t._bottom&&r===t._left&&i===t._right&&o===t._near&&s===t._far||(t._left=r,t._right=i,t._top=e,t._bottom=a,t._near=o,t._far=s,t._perspectiveMatrix=n.Matrix4.computePerspectiveOffCenter(r,i,a,e,o,s,t._perspectiveMatrix),t._infinitePerspective=n.Matrix4.computeInfinitePerspectiveOffCenter(r,i,a,e,o,t._infinitePerspective))}_.prototype.computeCullingVolume=function(t,e,i){const r=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,l=this.left,c=this.near,h=this.far,p=a.Cartesian3.cross(e,i,g);a.Cartesian3.normalize(p,p);const d=w;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=x;a.Cartesian3.multiplyByScalar(p,l,m),a.Cartesian3.add(d,m,m);let C=r[0];return o.defined(C)||(C=r[0]=new n.Cartesian4),C.x=p.x,C.y=p.y,C.z=p.z,C.w=-a.Cartesian3.dot(p,m),a.Cartesian3.multiplyByScalar(p,u,m),a.Cartesian3.add(d,m,m),C=r[1],o.defined(C)||(C=r[1]=new n.Cartesian4),C.x=-p.x,C.y=-p.y,C.z=-p.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(p,v),m),a.Cartesian3.multiplyByScalar(i,f,m),a.Cartesian3.add(d,m,m),C=r[2],o.defined(C)||(C=r[2]=new n.Cartesian4),C.x=i.x,C.y=i.y,C.z=i.z,C.w=-a.Cartesian3.dot(i,m),a.Cartesian3.multiplyByScalar(i,s,m),a.Cartesian3.add(d,m,m),C=r[3],o.defined(C)||(C=r[3]=new n.Cartesian4),C.x=-i.x,C.y=-i.y,C.z=-i.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(i,v),m),C=r[4],o.defined(C)||(C=r[4]=new n.Cartesian4),C.x=e.x,C.y=e.y,C.z=e.z,C.w=-a.Cartesian3.dot(e,d),a.Cartesian3.multiplyByScalar(e,h,m),a.Cartesian3.add(t,m,m),C=r[5],o.defined(C)||(C=r[5]=new n.Cartesian4),C.x=-e.x,C.y=-e.y,C.z=-e.z,C.w=-a.Cartesian3.dot(a.Cartesian3.negate(e,v),m),this._cullingVolume},_.prototype.getPixelDimensions=function(t,e,a,n,i){y(this);const r=n*(this.right-this.left)/t,o=n*(this.top-this.bottom)/e;return i.x=r,i.y=o,i},_.prototype.clone=function(t){return o.defined(t)||(t=new _),t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},_.prototype.equals=function(t){return o.defined(t)&&t instanceof _&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},_.prototype.equalsEpsilon=function(t,e,a){return t===this||o.defined(t)&&t instanceof _&&u.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&u.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&u.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&u.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&u.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&u.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},M.packedLength=4,M.pack=function(t,e,a){return a=o.defaultValue(a,0),e[a++]=t.width,e[a++]=t.aspectRatio,e[a++]=t.near,e[a]=t.far,e},M.unpack=function(t,e,a){return e=o.defaultValue(e,0),o.defined(a)||(a=new M),a.width=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e],a},Object.defineProperties(M.prototype,{projectionMatrix:{get:function(){return b(this),this._offCenterFrustum.projectionMatrix}}}),M.prototype.computeCullingVolume=function(t,e,a){return b(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},M.prototype.getPixelDimensions=function(t,e,a,n,i){return b(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},M.prototype.clone=function(t){return o.defined(t)||(t=new M),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},M.prototype.equals=function(t){return!!(o.defined(t)&&t instanceof M)&&(b(this),b(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},M.prototype.equalsEpsilon=function(t,e,a){return!!(o.defined(t)&&t instanceof M)&&(b(this),b(t),u.CesiumMath.equalsEpsilon(this.width,t.width,e,a)&&u.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))},Object.defineProperties(V.prototype,{projectionMatrix:{get:function(){return F(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return F(this),this._infinitePerspective}}});const E=new a.Cartesian3,O=new a.Cartesian3,P=new a.Cartesian3,z=new a.Cartesian3;function R(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new V,this.fov=t.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=o.defaultValue(t.near,1),this._near=this.near,this.far=o.defaultValue(t.far,5e8),this._far=this.far,this.xOffset=o.defaultValue(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=o.defaultValue(t.yOffset,0),this._yOffset=this.yOffset}function S(t){const e=t._offCenterFrustum;t.fov===t._fov&&t.aspectRatio===t._aspectRatio&&t.near===t._near&&t.far===t._far&&t.xOffset===t._xOffset&&t.yOffset===t._yOffset||(t._aspectRatio=t.aspectRatio,t._fov=t.fov,t._fovy=t.aspectRatio<=1?t.fov:2*Math.atan(Math.tan(.5*t.fov)/t.aspectRatio),t._near=t.near,t._far=t.far,t._sseDenominator=2*Math.tan(.5*t._fovy),t._xOffset=t.xOffset,t._yOffset=t.yOffset,e.top=t.near*Math.tan(.5*t._fovy),e.bottom=-e.top,e.right=t.aspectRatio*e.top,e.left=-e.right,e.near=t.near,e.far=t.far,e.right+=t.xOffset,e.left+=t.xOffset,e.top+=t.yOffset,e.bottom+=t.yOffset)}V.prototype.computeCullingVolume=function(t,e,i){const r=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,l=this.left,c=this.near,h=this.far,p=a.Cartesian3.cross(e,i,E),d=O;a.Cartesian3.multiplyByScalar(e,c,d),a.Cartesian3.add(t,d,d);const m=P;a.Cartesian3.multiplyByScalar(e,h,m),a.Cartesian3.add(t,m,m);const C=z;a.Cartesian3.multiplyByScalar(p,l,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.normalize(C,C),a.Cartesian3.cross(C,i,C),a.Cartesian3.normalize(C,C);let _=r[0];return o.defined(_)||(_=r[0]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(p,u,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(i,C,C),a.Cartesian3.normalize(C,C),_=r[1],o.defined(_)||(_=r[1]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(i,f,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(p,C,C),a.Cartesian3.normalize(C,C),_=r[2],o.defined(_)||(_=r[2]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),a.Cartesian3.multiplyByScalar(i,s,C),a.Cartesian3.add(d,C,C),a.Cartesian3.subtract(C,t,C),a.Cartesian3.cross(C,p,C),a.Cartesian3.normalize(C,C),_=r[3],o.defined(_)||(_=r[3]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,t),_=r[4],o.defined(_)||(_=r[4]=new n.Cartesian4),_.x=e.x,_.y=e.y,_.z=e.z,_.w=-a.Cartesian3.dot(e,d),a.Cartesian3.negate(e,C),_=r[5],o.defined(_)||(_=r[5]=new n.Cartesian4),_.x=C.x,_.y=C.y,_.z=C.z,_.w=-a.Cartesian3.dot(C,m),this._cullingVolume},V.prototype.getPixelDimensions=function(t,e,a,n,i){F(this);const r=1/this.near;let o=this.top*r;const s=2*n*a*o/e;o=this.right*r;const f=2*n*a*o/t;return i.x=f,i.y=s,i},V.prototype.clone=function(t){return o.defined(t)||(t=new V),t.right=this.right,t.left=this.left,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t._left=void 0,t._right=void 0,t._top=void 0,t._bottom=void 0,t._near=void 0,t._far=void 0,t},V.prototype.equals=function(t){return o.defined(t)&&t instanceof V&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},V.prototype.equalsEpsilon=function(t,e,a){return t===this||o.defined(t)&&t instanceof V&&u.CesiumMath.equalsEpsilon(this.right,t.right,e,a)&&u.CesiumMath.equalsEpsilon(this.left,t.left,e,a)&&u.CesiumMath.equalsEpsilon(this.top,t.top,e,a)&&u.CesiumMath.equalsEpsilon(this.bottom,t.bottom,e,a)&&u.CesiumMath.equalsEpsilon(this.near,t.near,e,a)&&u.CesiumMath.equalsEpsilon(this.far,t.far,e,a)},R.packedLength=6,R.pack=function(t,e,a){return a=o.defaultValue(a,0),e[a++]=t.fov,e[a++]=t.aspectRatio,e[a++]=t.near,e[a++]=t.far,e[a++]=t.xOffset,e[a]=t.yOffset,e},R.unpack=function(t,e,a){return e=o.defaultValue(e,0),o.defined(a)||(a=new R),a.fov=t[e++],a.aspectRatio=t[e++],a.near=t[e++],a.far=t[e++],a.xOffset=t[e++],a.yOffset=t[e],a},Object.defineProperties(R.prototype,{projectionMatrix:{get:function(){return S(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return S(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return S(this),this._fovy}},sseDenominator:{get:function(){return S(this),this._sseDenominator}}}),R.prototype.computeCullingVolume=function(t,e,a){return S(this),this._offCenterFrustum.computeCullingVolume(t,e,a)},R.prototype.getPixelDimensions=function(t,e,a,n,i){return S(this),this._offCenterFrustum.getPixelDimensions(t,e,a,n,i)},R.prototype.clone=function(t){return o.defined(t)||(t=new R),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},R.prototype.equals=function(t){return!!(o.defined(t)&&t instanceof R)&&(S(this),S(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},R.prototype.equalsEpsilon=function(t,e,a){return!!(o.defined(t)&&t instanceof R)&&(S(this),S(t),u.CesiumMath.equalsEpsilon(this.fov,t.fov,e,a)&&u.CesiumMath.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,a)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,a))};function T(t){const n=t.frustum,i=t.orientation,r=t.origin,s=o.defaultValue(t.vertexFormat,c.VertexFormat.DEFAULT),f=o.defaultValue(t._drawNearPlane,!0);let u,l;n instanceof R?(u=0,l=R.packedLength):n instanceof M&&(u=1,l=M.packedLength),this._frustumType=u,this._frustum=n.clone(),this._origin=a.Cartesian3.clone(r),this._orientation=e.Quaternion.clone(i),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+l+a.Cartesian3.packedLength+e.Quaternion.packedLength+c.VertexFormat.packedLength}T.pack=function(t,n,i){i=o.defaultValue(i,0);const r=t._frustumType,s=t._frustum;return n[i++]=r,0===r?(R.pack(s,n,i),i+=R.packedLength):(M.pack(s,n,i),i+=M.packedLength),a.Cartesian3.pack(t._origin,n,i),i+=a.Cartesian3.packedLength,e.Quaternion.pack(t._orientation,n,i),i+=e.Quaternion.packedLength,c.VertexFormat.pack(t._vertexFormat,n,i),n[i+=c.VertexFormat.packedLength]=t._drawNearPlane?1:0,n};const k=new R,A=new M,D=new e.Quaternion,I=new a.Cartesian3,q=new c.VertexFormat;function B(t,e,a,n,i,r,s,f){const u=t/3*2;for(let i=0;i<4;++i)o.defined(e)&&(e[t]=r.x,e[t+1]=r.y,e[t+2]=r.z),o.defined(a)&&(a[t]=s.x,a[t+1]=s.y,a[t+2]=s.z),o.defined(n)&&(n[t]=f.x,n[t+1]=f.y,n[t+2]=f.z),t+=3;i[u]=0,i[u+1]=0,i[u+2]=1,i[u+3]=0,i[u+4]=1,i[u+5]=1,i[u+6]=0,i[u+7]=1}T.unpack=function(t,n,i){n=o.defaultValue(n,0);const r=t[n++];let s;0===r?(s=R.unpack(t,n,k),n+=R.packedLength):(s=M.unpack(t,n,A),n+=M.packedLength);const f=a.Cartesian3.unpack(t,n,I);n+=a.Cartesian3.packedLength;const u=e.Quaternion.unpack(t,n,D);n+=e.Quaternion.packedLength;const l=c.VertexFormat.unpack(t,n,q),h=1===t[n+=c.VertexFormat.packedLength];if(!o.defined(i))return new T({frustum:s,origin:f,orientation:u,vertexFormat:l,_drawNearPlane:h});const p=r===i._frustumType?i._frustum:void 0;return i._frustum=s.clone(p),i._frustumType=r,i._origin=a.Cartesian3.clone(f,i._origin),i._orientation=e.Quaternion.clone(u,i._orientation),i._vertexFormat=c.VertexFormat.clone(l,i._vertexFormat),i._drawNearPlane=h,i};const L=new n.Matrix3,N=new n.Matrix4,G=new n.Matrix4,j=new a.Cartesian3,U=new a.Cartesian3,Q=new a.Cartesian3,K=new a.Cartesian3,Y=new a.Cartesian3,J=new a.Cartesian3,W=new Array(3),X=new Array(4);X[0]=new n.Cartesian4(-1,-1,1,1),X[1]=new n.Cartesian4(1,-1,1,1),X[2]=new n.Cartesian4(1,1,1,1),X[3]=new n.Cartesian4(-1,1,1,1);const Z=new Array(4);for(let t=0;t<4;++t)Z[t]=new n.Cartesian4;T._computeNearFarPlanes=function(t,e,i,r,s,f,u,l){const c=n.Matrix3.fromQuaternion(e,L);let h=o.defaultValue(f,j),p=o.defaultValue(u,U),d=o.defaultValue(l,Q);h=n.Matrix3.getColumn(c,0,h),p=n.Matrix3.getColumn(c,1,p),d=n.Matrix3.getColumn(c,2,d),a.Cartesian3.normalize(h,h),a.Cartesian3.normalize(p,p),a.Cartesian3.normalize(d,d),a.Cartesian3.negate(h,h);const m=n.Matrix4.computeView(t,d,p,h,N);let C,_;if(0===i){const t=r.projectionMatrix,e=n.Matrix4.multiply(t,m,G);_=n.Matrix4.inverse(e,G)}else C=n.Matrix4.inverseTransformation(m,G);o.defined(_)?(W[0]=r.near,W[1]=r.far):(W[0]=0,W[1]=r.near,W[2]=r.far);for(let e=0;e<2;++e)for(let i=0;i<4;++i){let f=n.Cartesian4.clone(X[i],Z[i]);if(o.defined(_)){f=n.Matrix4.multiplyByVector(_,f,f);const i=1/f.w;a.Cartesian3.multiplyByScalar(f,i,f),a.Cartesian3.subtract(f,t,f),a.Cartesian3.normalize(f,f);const r=a.Cartesian3.dot(d,f);a.Cartesian3.multiplyByScalar(f,W[e]/r,f),a.Cartesian3.add(f,t,f)}else{o.defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);const t=W[e],a=W[e+1];f.x=.5*(f.x*(r.right-r.left)+r.left+r.right),f.y=.5*(f.y*(r.top-r.bottom)+r.bottom+r.top),f.z=.5*(f.z*(t-a)-t-a),f.w=1,n.Matrix4.multiplyByVector(C,f,f)}s[12*e+3*i]=f.x,s[12*e+3*i+1]=f.y,s[12*e+3*i+2]=f.z}},T.createGeometry=function(t){const n=t._frustumType,i=t._frustum,u=t._origin,l=t._orientation,c=t._drawNearPlane,h=t._vertexFormat,p=c?6:5;let d=new Float64Array(72);T._computeNearFarPlanes(u,l,n,i,d);let m=24;d[m]=d[12],d[m+1]=d[13],d[m+2]=d[14],d[m+3]=d[0],d[m+4]=d[1],d[m+5]=d[2],d[m+6]=d[9],d[m+7]=d[10],d[m+8]=d[11],d[m+9]=d[21],d[m+10]=d[22],d[m+11]=d[23],m+=12,d[m]=d[15],d[m+1]=d[16],d[m+2]=d[17],d[m+3]=d[3],d[m+4]=d[4],d[m+5]=d[5],d[m+6]=d[0],d[m+7]=d[1],d[m+8]=d[2],d[m+9]=d[12],d[m+10]=d[13],d[m+11]=d[14],m+=12,d[m]=d[3],d[m+1]=d[4],d[m+2]=d[5],d[m+3]=d[15],d[m+4]=d[16],d[m+5]=d[17],d[m+6]=d[18],d[m+7]=d[19],d[m+8]=d[20],d[m+9]=d[6],d[m+10]=d[7],d[m+11]=d[8],m+=12,d[m]=d[6],d[m+1]=d[7],d[m+2]=d[8],d[m+3]=d[18],d[m+4]=d[19],d[m+5]=d[20],d[m+6]=d[21],d[m+7]=d[22],d[m+8]=d[23],d[m+9]=d[9],d[m+10]=d[10],d[m+11]=d[11],c||(d=d.subarray(12));const C=new f.GeometryAttributes({position:new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:d})});if(o.defined(h.normal)||o.defined(h.tangent)||o.defined(h.bitangent)||o.defined(h.st)){const t=o.defined(h.normal)?new Float32Array(12*p):void 0,e=o.defined(h.tangent)?new Float32Array(12*p):void 0,n=o.defined(h.bitangent)?new Float32Array(12*p):void 0,i=o.defined(h.st)?new Float32Array(8*p):void 0,f=j,u=U,l=Q,d=a.Cartesian3.negate(f,K),_=a.Cartesian3.negate(u,Y),y=a.Cartesian3.negate(l,J);m=0,c&&(B(m,t,e,n,i,y,f,u),m+=12),B(m,t,e,n,i,l,d,u),m+=12,B(m,t,e,n,i,d,y,u),m+=12,B(m,t,e,n,i,_,y,d),m+=12,B(m,t,e,n,i,f,l,u),m+=12,B(m,t,e,n,i,u,l,d),o.defined(t)&&(C.normal=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),o.defined(e)&&(C.tangent=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),o.defined(n)&&(C.bitangent=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:n})),o.defined(i)&&(C.st=new s.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i}))}const _=new Uint16Array(6*p);for(let t=0;t<p;++t){const e=6*t,a=4*t;_[e]=a,_[e+1]=a+1,_[e+2]=a+2,_[e+3]=a,_[e+4]=a+2,_[e+5]=a+3}return new s.Geometry({attributes:C,indices:_,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromVertices(d)})},t.FrustumGeometry=T,t.OrthographicFrustum=M,t.PerspectiveFrustum=R}));
|