Newer
Older
smartwell_front_dz / XLJCYJ / mars3d-cesium / Workers / chunk-DCMYNAOH.js
wangxitong on 8 Jul 2024 20 KB 达州变更
/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.109.1
 *
 * Copyright 2011-2022 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
 *
 * 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */
import{a as A}from"./chunk-JEAHRXD5.js";import{a as Q}from"./chunk-MPWN7KNI.js";import{a as ae}from"./chunk-BZJ4WRF6.js";import{b as oe,c as re,d as J}from"./chunk-ESC6A27A.js";import{b as V,d as ie,f as N}from"./chunk-FCJU2DRX.js";import{a as b,b as O}from"./chunk-Y3I2OBKV.js";import{a as u}from"./chunk-KUWODMWG.js";import{a as r,d as H}from"./chunk-WADCMYQO.js";import{a as P}from"./chunk-2LQD2HPA.js";import{a as m}from"./chunk-3B6S2GOO.js";import{a as w,b as F}from"./chunk-EYEHMX6X.js";import{e as a}from"./chunk-BWKFPVR5.js";function q(t){this.planes=m(t,[])}var X=[new r,new r,new r];r.clone(r.UNIT_X,X[0]),r.clone(r.UNIT_Y,X[1]),r.clone(r.UNIT_Z,X[2]);var E=new r,de=new r,fe=new Q(new r(1,0,0),0);q.fromBoundingSphere=function(t,e){if(!a(t))throw new w("boundingSphere is required.");a(e)||(e=new q);let i=X.length,o=e.planes;o.length=2*i;let n=t.center,s=t.radius,f=0;for(let h=0;h<i;++h){let t=X[h],e=o[f],i=o[f+1];a(e)||(e=o[f]=new b),a(i)||(i=o[f+1]=new b),r.multiplyByScalar(t,-s,E),r.add(n,E,E),e.x=t.x,e.y=t.y,e.z=t.z,e.w=-r.dot(t,E),r.multiplyByScalar(t,s,E),r.add(n,E,E),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-r.dot(r.negate(t,de),E),f+=2}return e},q.prototype.computeVisibility=function(t){if(!a(t))throw new w("boundingVolume is required.");let e=this.planes,r=!1;for(let i=0,a=e.length;i<a;++i){let a=t.intersectPlane(Q.fromCartesian4(e[i],fe));if(a===V.OUTSIDE)return V.OUTSIDE;a===V.INTERSECTING&&(r=!0)}return r?V.INTERSECTING:V.INSIDE},q.prototype.computeVisibilityWithPlaneMask=function(t,e){if(!a(t))throw new w("boundingVolume is required.");if(!a(e))throw new w("parentPlaneMask is required.");if(e===q.MASK_OUTSIDE||e===q.MASK_INSIDE)return e;let r=q.MASK_INSIDE,i=this.planes;for(let a=0,o=i.length;a<o;++a){let o=a<31?1<<a:0;if(a<31&&!(e&o))continue;let n=t.intersectPlane(Q.fromCartesian4(i[a],fe));if(n===V.OUTSIDE)return q.MASK_OUTSIDE;n===V.INTERSECTING&&(r|=o)}return r},q.MASK_OUTSIDE=4294967295,q.MASK_INSIDE=0,q.MASK_INDETERMINATE=2147483647;var $=q;function k(t){t=m(t,m.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=m(t.near,1),this._near=this.near,this.far=m(t.far,5e8),this._far=this.far,this._cullingVolume=new $,this._orthographicMatrix=new O}function ce(t){if(!a(t.right)||!a(t.left)||!a(t.top)||!a(t.bottom)||!a(t.near)||!a(t.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(t.top!==t._top||t.bottom!==t._bottom||t.left!==t._left||t.right!==t._right||t.near!==t._near||t.far!==t._far){if(t.left>t.right)throw new w("right must be greater than left.");if(t.bottom>t.top)throw new w("top must be greater than bottom.");t.near<=0||(t.near,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=O.computeOrthographicOffCenter(t.left,t.right,t.bottom,t.top,t.near,t.far,t._orthographicMatrix)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return ce(this),this._orthographicMatrix}}});var me=new r,ye=new r,ge=new r,ee=new r;k.prototype.computeCullingVolume=function(t,e,i){if(!a(t))throw new w("position is required.");if(!a(e))throw new w("direction is required.");if(!a(i))throw new w("up is required.");let o=this._cullingVolume.planes,n=this.top,s=this.bottom,f=this.right,h=this.left,u=this.near,p=this.far,l=r.cross(e,i,me);r.normalize(l,l);let c=ye;r.multiplyByScalar(e,u,c),r.add(t,c,c);let m=ge;r.multiplyByScalar(l,h,m),r.add(c,m,m);let d=o[0];return a(d)||(d=o[0]=new b),d.x=l.x,d.y=l.y,d.z=l.z,d.w=-r.dot(l,m),r.multiplyByScalar(l,f,m),r.add(c,m,m),d=o[1],a(d)||(d=o[1]=new b),d.x=-l.x,d.y=-l.y,d.z=-l.z,d.w=-r.dot(r.negate(l,ee),m),r.multiplyByScalar(i,s,m),r.add(c,m,m),d=o[2],a(d)||(d=o[2]=new b),d.x=i.x,d.y=i.y,d.z=i.z,d.w=-r.dot(i,m),r.multiplyByScalar(i,n,m),r.add(c,m,m),d=o[3],a(d)||(d=o[3]=new b),d.x=-i.x,d.y=-i.y,d.z=-i.z,d.w=-r.dot(r.negate(i,ee),m),d=o[4],a(d)||(d=o[4]=new b),d.x=e.x,d.y=e.y,d.z=e.z,d.w=-r.dot(e,c),r.multiplyByScalar(e,p,m),r.add(t,m,m),d=o[5],a(d)||(d=o[5]=new b),d.x=-e.x,d.y=-e.y,d.z=-e.z,d.w=-r.dot(r.negate(e,ee),m),this._cullingVolume},k.prototype.getPixelDimensions=function(t,e,r,i,o){if(ce(this),!a(t)||!a(e))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(t<=0)throw new w("drawingBufferWidth must be greater than zero.");if(e<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(r))throw new w("distance is required.");if(!a(i))throw new w("pixelRatio is required.");if(i<=0)throw new w("pixelRatio must be greater than zero.");if(!a(o))throw new w("A result object is required.");let n=this.right-this.left,s=this.top-this.bottom,f=i*n/t,h=i*s/e;return o.x=f,o.y=h,o},k.prototype.clone=function(t){return a(t)||(t=new k),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},k.prototype.equals=function(t){return a(t)&&t instanceof k&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},k.prototype.equalsEpsilon=function(t,e,r){return t===this||a(t)&&t instanceof k&&P.equalsEpsilon(this.right,t.right,e,r)&&P.equalsEpsilon(this.left,t.left,e,r)&&P.equalsEpsilon(this.top,t.top,e,r)&&P.equalsEpsilon(this.bottom,t.bottom,e,r)&&P.equalsEpsilon(this.near,t.near,e,r)&&P.equalsEpsilon(this.far,t.far,e,r)};var he=k;function z(t){t=m(t,m.EMPTY_OBJECT),this._offCenterFrustum=new he,this.width=t.width,this._width=void 0,this.aspectRatio=t.aspectRatio,this._aspectRatio=void 0,this.near=m(t.near,1),this._near=this.near,this.far=m(t.far,5e8),this._far=this.far}function j(t){if(!a(t.width)||!a(t.aspectRatio)||!a(t.near)||!a(t.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let e=t._offCenterFrustum;if(t.width!==t._width||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far){if(t.aspectRatio<0)throw new w("aspectRatio must be positive.");if(t.near<0||t.near>t.far)throw new w("near must be greater than zero and less than far.");t._aspectRatio=t.aspectRatio,t._width=t.width,t._near=t.near,t._far=t.far;let r=1/t.aspectRatio;e.right=.5*t.width,e.left=-e.right,e.top=r*e.right,e.bottom=-e.top,e.near=t.near,e.far=t.far}}z.packedLength=4,z.pack=function(t,e,r){return F.typeOf.object("value",t),F.defined("array",e),r=m(r,0),e[r++]=t.width,e[r++]=t.aspectRatio,e[r++]=t.near,e[r]=t.far,e},z.unpack=function(t,e,r){return F.defined("array",t),e=m(e,0),a(r)||(r=new z),r.width=t[e++],r.aspectRatio=t[e++],r.near=t[e++],r.far=t[e],r},Object.defineProperties(z.prototype,{projectionMatrix:{get:function(){return j(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return j(this),this._offCenterFrustum}}}),z.prototype.computeCullingVolume=function(t,e,r){return j(this),this._offCenterFrustum.computeCullingVolume(t,e,r)},z.prototype.getPixelDimensions=function(t,e,r,i,a){return j(this),this._offCenterFrustum.getPixelDimensions(t,e,r,i,a)},z.prototype.clone=function(t){return a(t)||(t=new z),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},z.prototype.equals=function(t){return!!(a(t)&&t instanceof z)&&(j(this),j(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},z.prototype.equalsEpsilon=function(t,e,r){return!!(a(t)&&t instanceof z)&&(j(this),j(t),P.equalsEpsilon(this.width,t.width,e,r)&&P.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,r)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,r))};var B=z;function S(t){t=m(t,m.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=m(t.near,1),this._near=this.near,this.far=m(t.far,5e8),this._far=this.far,this._cullingVolume=new $,this._perspectiveMatrix=new O,this._infinitePerspective=new O}function te(t){if(!a(t.right)||!a(t.left)||!a(t.top)||!a(t.bottom)||!a(t.near)||!a(t.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let e=t.top,r=t.bottom,i=t.right,o=t.left,n=t.near,s=t.far;if(e!==t._top||r!==t._bottom||o!==t._left||i!==t._right||n!==t._near||s!==t._far){if(t.near<=0||t.near>t.far)throw new w("near must be greater than zero and less than far.");t._left=o,t._right=i,t._top=e,t._bottom=r,t._near=n,t._far=s,t._perspectiveMatrix=O.computePerspectiveOffCenter(o,i,r,e,n,s,t._perspectiveMatrix),t._infinitePerspective=O.computeInfinitePerspectiveOffCenter(o,i,r,e,n,t._infinitePerspective)}}Object.defineProperties(S.prototype,{projectionMatrix:{get:function(){return te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return te(this),this._infinitePerspective}}});var Ce=new r,be=new r,Pe=new r,Oe=new r;S.prototype.computeCullingVolume=function(t,e,i){if(!a(t))throw new w("position is required.");if(!a(e))throw new w("direction is required.");if(!a(i))throw new w("up is required.");let o=this._cullingVolume.planes,n=this.top,s=this.bottom,f=this.right,h=this.left,u=this.near,p=this.far,l=r.cross(e,i,Ce),c=be;r.multiplyByScalar(e,u,c),r.add(t,c,c);let m=Pe;r.multiplyByScalar(e,p,m),r.add(t,m,m);let d=Oe;r.multiplyByScalar(l,h,d),r.add(c,d,d),r.subtract(d,t,d),r.normalize(d,d),r.cross(d,i,d),r.normalize(d,d);let _=o[0];return a(_)||(_=o[0]=new b),_.x=d.x,_.y=d.y,_.z=d.z,_.w=-r.dot(d,t),r.multiplyByScalar(l,f,d),r.add(c,d,d),r.subtract(d,t,d),r.cross(i,d,d),r.normalize(d,d),_=o[1],a(_)||(_=o[1]=new b),_.x=d.x,_.y=d.y,_.z=d.z,_.w=-r.dot(d,t),r.multiplyByScalar(i,s,d),r.add(c,d,d),r.subtract(d,t,d),r.cross(l,d,d),r.normalize(d,d),_=o[2],a(_)||(_=o[2]=new b),_.x=d.x,_.y=d.y,_.z=d.z,_.w=-r.dot(d,t),r.multiplyByScalar(i,n,d),r.add(c,d,d),r.subtract(d,t,d),r.cross(d,l,d),r.normalize(d,d),_=o[3],a(_)||(_=o[3]=new b),_.x=d.x,_.y=d.y,_.z=d.z,_.w=-r.dot(d,t),_=o[4],a(_)||(_=o[4]=new b),_.x=e.x,_.y=e.y,_.z=e.z,_.w=-r.dot(e,c),r.negate(e,d),_=o[5],a(_)||(_=o[5]=new b),_.x=d.x,_.y=d.y,_.z=d.z,_.w=-r.dot(d,m),this._cullingVolume},S.prototype.getPixelDimensions=function(t,e,r,i,o){if(te(this),!a(t)||!a(e))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(t<=0)throw new w("drawingBufferWidth must be greater than zero.");if(e<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!a(r))throw new w("distance is required.");if(!a(i))throw new w("pixelRatio is required");if(i<=0)throw new w("pixelRatio must be greater than zero.");if(!a(o))throw new w("A result object is required.");let n=1/this.near,s=this.top*n,f=2*i*r*s/e;s=this.right*n;let h=2*i*r*s/t;return o.x=h,o.y=f,o},S.prototype.clone=function(t){return a(t)||(t=new S),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},S.prototype.equals=function(t){return a(t)&&t instanceof S&&this.right===t.right&&this.left===t.left&&this.top===t.top&&this.bottom===t.bottom&&this.near===t.near&&this.far===t.far},S.prototype.equalsEpsilon=function(t,e,r){return t===this||a(t)&&t instanceof S&&P.equalsEpsilon(this.right,t.right,e,r)&&P.equalsEpsilon(this.left,t.left,e,r)&&P.equalsEpsilon(this.top,t.top,e,r)&&P.equalsEpsilon(this.bottom,t.bottom,e,r)&&P.equalsEpsilon(this.near,t.near,e,r)&&P.equalsEpsilon(this.far,t.far,e,r)};var pe=S;function R(t){t=m(t,m.EMPTY_OBJECT),this._offCenterFrustum=new pe,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=m(t.near,1),this._near=this.near,this.far=m(t.far,5e8),this._far=this.far,this.xOffset=m(t.xOffset,0),this._xOffset=this.xOffset,this.yOffset=m(t.yOffset,0),this._yOffset=this.yOffset}function T(t){if(!a(t.fov)||!a(t.aspectRatio)||!a(t.near)||!a(t.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");let e=t._offCenterFrustum;if(t.fov!==t._fov||t.aspectRatio!==t._aspectRatio||t.near!==t._near||t.far!==t._far||t.xOffset!==t._xOffset||t.yOffset!==t._yOffset){if(t.fov<0||t.fov>=Math.PI)throw new w("fov must be in the range [0, PI).");if(t.aspectRatio<0)throw new w("aspectRatio must be positive.");if(t.near<0||t.near>t.far)throw new w("near must be greater than zero and less than far.");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}}R.packedLength=6,R.pack=function(t,e,r){return F.typeOf.object("value",t),F.defined("array",e),r=m(r,0),e[r++]=t.fov,e[r++]=t.aspectRatio,e[r++]=t.near,e[r++]=t.far,e[r++]=t.xOffset,e[r]=t.yOffset,e},R.unpack=function(t,e,r){return F.defined("array",t),e=m(e,0),a(r)||(r=new R),r.fov=t[e++],r.aspectRatio=t[e++],r.near=t[e++],r.far=t[e++],r.xOffset=t[e++],r.yOffset=t[e],r},Object.defineProperties(R.prototype,{projectionMatrix:{get:function(){return T(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return T(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return T(this),this._fovy}},sseDenominator:{get:function(){return T(this),this._sseDenominator}},offCenterFrustum:{get:function(){return T(this),this._offCenterFrustum}}}),R.prototype.computeCullingVolume=function(t,e,r){return T(this),this._offCenterFrustum.computeCullingVolume(t,e,r)},R.prototype.getPixelDimensions=function(t,e,r,i,a){return T(this),this._offCenterFrustum.getPixelDimensions(t,e,r,i,a)},R.prototype.clone=function(t){return a(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!!(a(t)&&t instanceof R)&&(T(this),T(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this._offCenterFrustum.equals(t._offCenterFrustum))},R.prototype.equalsEpsilon=function(t,e,r){return!!(a(t)&&t instanceof R)&&(T(this),T(t),P.equalsEpsilon(this.fov,t.fov,e,r)&&P.equalsEpsilon(this.aspectRatio,t.aspectRatio,e,r)&&this._offCenterFrustum.equalsEpsilon(t._offCenterFrustum,e,r))};var L=R,I=0,Fe=1;function Y(t){F.typeOf.object("options",t),F.typeOf.object("options.frustum",t.frustum),F.typeOf.object("options.origin",t.origin),F.typeOf.object("options.orientation",t.orientation);let e,i,a=t.frustum,o=t.orientation,n=t.origin,s=m(t.vertexFormat,A.DEFAULT),f=m(t._drawNearPlane,!0);a instanceof L?(e=I,i=L.packedLength):a instanceof B&&(e=Fe,i=B.packedLength),this._frustumType=e,this._frustum=a.clone(),this._origin=r.clone(n),this._orientation=N.clone(o),this._drawNearPlane=f,this._vertexFormat=s,this._workerName="createFrustumGeometry",this.packedLength=2+i+r.packedLength+N.packedLength+A.packedLength}Y.pack=function(t,e,i){F.typeOf.object("value",t),F.defined("array",e),i=m(i,0);let a=t._frustumType,o=t._frustum;return e[i++]=a,a===I?(L.pack(o,e,i),i+=L.packedLength):(B.pack(o,e,i),i+=B.packedLength),r.pack(t._origin,e,i),i+=r.packedLength,N.pack(t._orientation,e,i),i+=N.packedLength,A.pack(t._vertexFormat,e,i),i+=A.packedLength,e[i]=t._drawNearPlane?1:0,e};var xe=new L,ve=new B,ze=new N,Re=new r,qe=new A;function W(t,e,r,i,o,n,s,f){let h=t/3*2;for(let u=0;u<4;++u)a(e)&&(e[t]=n.x,e[t+1]=n.y,e[t+2]=n.z),a(r)&&(r[t]=s.x,r[t+1]=s.y,r[t+2]=s.z),a(i)&&(i[t]=f.x,i[t+1]=f.y,i[t+2]=f.z),t+=3;o[h]=0,o[h+1]=0,o[h+2]=1,o[h+3]=0,o[h+4]=1,o[h+5]=1,o[h+6]=0,o[h+7]=1}Y.unpack=function(t,e,i){F.defined("array",t),e=m(e,0);let o,n=t[e++];n===I?(o=L.unpack(t,e,xe),e+=L.packedLength):(o=B.unpack(t,e,ve),e+=B.packedLength);let s=r.unpack(t,e,Re);e+=r.packedLength;let f=N.unpack(t,e,ze);e+=N.packedLength;let h=A.unpack(t,e,qe);e+=A.packedLength;let u=1===t[e];if(!a(i))return new Y({frustum:o,origin:s,orientation:f,vertexFormat:h,_drawNearPlane:u});let p=n===i._frustumType?i._frustum:void 0;return i._frustum=o.clone(p),i._frustumType=n,i._origin=r.clone(s,i._origin),i._orientation=N.clone(f,i._orientation),i._vertexFormat=A.clone(h,i._vertexFormat),i._drawNearPlane=u,i};var Te=new H,Me=new O,ne=new O,se=new r,le=new r,we=new r,ke=new r,Se=new r,De=new r,U=new Array(3),Z=new Array(4);Z[0]=new b(-1,-1,1,1),Z[1]=new b(1,-1,1,1),Z[2]=new b(1,1,1,1),Z[3]=new b(-1,1,1,1);var _e=new Array(4);for(let t=0;t<4;++t)_e[t]=new b;Y._computeNearFarPlanes=function(t,e,i,o,n,s,f,h){let u=H.fromQuaternion(e,Te),p=m(s,se),l=m(f,le),c=m(h,we);p=H.getColumn(u,0,p),l=H.getColumn(u,1,l),c=H.getColumn(u,2,c),r.normalize(p,p),r.normalize(l,l),r.normalize(c,c),r.negate(p,p);let w,d,_=O.computeView(t,c,l,p,Me),g=o.projectionMatrix;if(i===I){let t=O.multiply(g,_,ne);d=O.inverse(t,ne)}else w=O.inverseTransformation(_,ne);a(d)?(U[0]=o.near,U[1]=o.far):(U[0]=0,U[1]=o.near,U[2]=o.far);for(let m=0;m<2;++m)for(let e=0;e<4;++e){let i=b.clone(Z[e],_e[e]);if(a(d)){i=O.multiplyByVector(d,i,i);let e=1/i.w;r.multiplyByScalar(i,e,i),r.subtract(i,t,i),r.normalize(i,i);let a=r.dot(c,i);r.multiplyByScalar(i,U[m]/a,i),r.add(i,t,i)}else{let t=o.offCenterFrustum;a(t)&&(o=t);let e=U[m],r=U[m+1];i.x=.5*(i.x*(o.right-o.left)+o.left+o.right),i.y=.5*(i.y*(o.top-o.bottom)+o.bottom+o.top),i.z=.5*(i.z*(e-r)-e-r),i.w=1,O.multiplyByVector(w,i,i)}n[12*m+3*e]=i.x,n[12*m+3*e+1]=i.y,n[12*m+3*e+2]=i.z}},Y.createGeometry=function(t){let e=t._frustumType,i=t._frustum,o=t._origin,n=t._orientation,s=t._drawNearPlane,f=t._vertexFormat,h=s?6:5,p=new Float64Array(72);Y._computeNearFarPlanes(o,n,e,i,p);let l=24;p[l]=p[12],p[l+1]=p[13],p[l+2]=p[14],p[l+3]=p[0],p[l+4]=p[1],p[l+5]=p[2],p[l+6]=p[9],p[l+7]=p[10],p[l+8]=p[11],p[l+9]=p[21],p[l+10]=p[22],p[l+11]=p[23],l+=12,p[l]=p[15],p[l+1]=p[16],p[l+2]=p[17],p[l+3]=p[3],p[l+4]=p[4],p[l+5]=p[5],p[l+6]=p[0],p[l+7]=p[1],p[l+8]=p[2],p[l+9]=p[12],p[l+10]=p[13],p[l+11]=p[14],l+=12,p[l]=p[3],p[l+1]=p[4],p[l+2]=p[5],p[l+3]=p[15],p[l+4]=p[16],p[l+5]=p[17],p[l+6]=p[18],p[l+7]=p[19],p[l+8]=p[20],p[l+9]=p[6],p[l+10]=p[7],p[l+11]=p[8],l+=12,p[l]=p[6],p[l+1]=p[7],p[l+2]=p[8],p[l+3]=p[18],p[l+4]=p[19],p[l+5]=p[20],p[l+6]=p[21],p[l+7]=p[22],p[l+8]=p[23],p[l+9]=p[9],p[l+10]=p[10],p[l+11]=p[11],s||(p=p.subarray(12));let c=new ae({position:new J({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:p})});if(a(f.normal)||a(f.tangent)||a(f.bitangent)||a(f.st)){let t=a(f.normal)?new Float32Array(12*h):void 0,e=a(f.tangent)?new Float32Array(12*h):void 0,i=a(f.bitangent)?new Float32Array(12*h):void 0,o=a(f.st)?new Float32Array(8*h):void 0,n=se,p=le,m=we,w=r.negate(n,ke),d=r.negate(p,Se),_=r.negate(m,De);l=0,s&&(W(l,t,e,i,o,_,n,p),l+=12),W(l,t,e,i,o,m,w,p),l+=12,W(l,t,e,i,o,w,_,p),l+=12,W(l,t,e,i,o,d,_,w),l+=12,W(l,t,e,i,o,n,m,p),l+=12,W(l,t,e,i,o,p,m,w),a(t)&&(c.normal=new J({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:t})),a(e)&&(c.tangent=new J({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:e})),a(i)&&(c.bitangent=new J({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:i})),a(o)&&(c.st=new J({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:o}))}let m=new Uint16Array(6*h);for(let r=0;r<h;++r){let t=6*r,e=4*r;m[t]=e,m[t+1]=e+1,m[t+2]=e+2,m[t+3]=e,m[t+4]=e+2,m[t+5]=e+3}return new re({attributes:c,indices:m,primitiveType:oe.TRIANGLES,boundingSphere:ie.fromVertices(p)})};var Et=Y;export{B as a,L as b,Et as c};