From f373e0c0797e1800bf066fdfbb748bb9242230f6 Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期二, 08 七月 2025 17:46:02 +0800 Subject: [PATCH] 泥位计 --- public/CimSDK/Workers/chunk-3JD5BHUW.js | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/public/CimSDK/Workers/chunk-3JD5BHUW.js b/public/CimSDK/Workers/chunk-3JD5BHUW.js new file mode 100644 index 0000000..ca0a5ed --- /dev/null +++ b/public/CimSDK/Workers/chunk-3JD5BHUW.js @@ -0,0 +1,6 @@ +/** + * SmartEarth WebSDK - https://websdk.terra-it.cn + * Version 5.4.1 + */ + +import{a as E}from"./chunk-VPVZKJ47.js";import{a as ee}from"./chunk-SY6XZLBE.js";import{a as fe}from"./chunk-MZR3JOBY.js";import{b as ae,c as ce,d as W}from"./chunk-6SNQZF7I.js";import{b as A,d as re}from"./chunk-CLGTNV2A.js";import{a as g,b as P,f as N}from"./chunk-RQCJJCAO.js";import{a as J}from"./chunk-7J4RJR4J.js";import{b as o,f as H,g as B}from"./chunk-UMC5CP2H.js";import{a as F}from"./chunk-72V3KRTJ.js";import{a as w,b}from"./chunk-VJ26MOOM.js";import{e as c}from"./chunk-E3YQ3WWZ.js";function v(e){this.planes=e??[]}var Z=[new o,new o,new o];o.clone(o.UNIT_X,Z[0]);o.clone(o.UNIT_Y,Z[1]);o.clone(o.UNIT_Z,Z[2]);var V=new o,Pe=new o,se=new ee(new o(1,0,0),0);v.fromBoundingSphere=function(e,n){if(!c(e))throw new w("boundingSphere is required.");c(n)||(n=new v);let i=Z.length,f=n.planes;f.length=2*i;let h=e.center,m=e.radius,l=0;for(let y=0;y<i;++y){let r=Z[y],s=f[l],_=f[l+1];c(s)||(s=f[l]=new g),c(_)||(_=f[l+1]=new g),o.multiplyByScalar(r,-m,V),o.add(h,V,V),s.x=r.x,s.y=r.y,s.z=r.z,s.w=-o.dot(r,V),o.multiplyByScalar(r,m,V),o.add(h,V,V),_.x=-r.x,_.y=-r.y,_.z=-r.z,_.w=-o.dot(o.negate(r,Pe),V),l+=2}return n};v.prototype.computeVisibility=function(e){if(!c(e))throw new w("boundingVolume is required.");let n=this.planes,i=!1;for(let f=0,h=n.length;f<h;++f){let m=e.intersectPlane(ee.fromCartesian4(n[f],se));if(m===A.OUTSIDE)return A.OUTSIDE;m===A.INTERSECTING&&(i=!0)}return i?A.INTERSECTING:A.INSIDE};v.prototype.computeVisibilityWithPlaneMask=function(e,n){if(!c(e))throw new w("boundingVolume is required.");if(!c(n))throw new w("parentPlaneMask is required.");if(n===v.MASK_OUTSIDE||n===v.MASK_INSIDE)return n;let i=v.MASK_INSIDE,f=this.planes;for(let h=0,m=f.length;h<m;++h){let l=h<31?1<<h:0;if(h<31&&(n&l)===0)continue;let y=e.intersectPlane(ee.fromCartesian4(f[h],se));if(y===A.OUTSIDE)return v.MASK_OUTSIDE;y===A.INTERSECTING&&(i|=l)}return i};v.MASK_OUTSIDE=4294967295;v.MASK_INSIDE=0;v.MASK_INDETERMINATE=2147483647;var Q=v;function k(e){e=e??B.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new Q,this._orthographicMatrix=new P}function he(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new w("right must be greater than left.");if(e.bottom>e.top)throw new w("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=P.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(k.prototype,{projectionMatrix:{get:function(){return he(this),this._orthographicMatrix}}});var ze=new o,Oe=new o,Te=new o,ne=new o;k.prototype.computeCullingVolume=function(e,n,i){if(!c(e))throw new w("position is required.");if(!c(n))throw new w("direction is required.");if(!c(i))throw new w("up is required.");let f=this._cullingVolume.planes,h=this.top,m=this.bottom,l=this.right,y=this.left,r=this.near,s=this.far,_=o.cross(n,i,ze);o.normalize(_,_);let d=Oe;o.multiplyByScalar(n,r,d),o.add(e,d,d);let p=Te;o.multiplyByScalar(_,y,p),o.add(d,p,p);let t=f[0];return c(t)||(t=f[0]=new g),t.x=_.x,t.y=_.y,t.z=_.z,t.w=-o.dot(_,p),o.multiplyByScalar(_,l,p),o.add(d,p,p),t=f[1],c(t)||(t=f[1]=new g),t.x=-_.x,t.y=-_.y,t.z=-_.z,t.w=-o.dot(o.negate(_,ne),p),o.multiplyByScalar(i,m,p),o.add(d,p,p),t=f[2],c(t)||(t=f[2]=new g),t.x=i.x,t.y=i.y,t.z=i.z,t.w=-o.dot(i,p),o.multiplyByScalar(i,h,p),o.add(d,p,p),t=f[3],c(t)||(t=f[3]=new g),t.x=-i.x,t.y=-i.y,t.z=-i.z,t.w=-o.dot(o.negate(i,ne),p),t=f[4],c(t)||(t=f[4]=new g),t.x=n.x,t.y=n.y,t.z=n.z,t.w=-o.dot(n,d),o.multiplyByScalar(n,s,p),o.add(e,p,p),t=f[5],c(t)||(t=f[5]=new g),t.x=-n.x,t.y=-n.y,t.z=-n.z,t.w=-o.dot(o.negate(n,ne),p),this._cullingVolume};k.prototype.getPixelDimensions=function(e,n,i,f,h){if(he(this),!c(e)||!c(n))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(n<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!c(i))throw new w("distance is required.");if(!c(f))throw new w("pixelRatio is required.");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!c(h))throw new w("A result object is required.");let m=this.right-this.left,l=this.top-this.bottom,y=f*m/e,r=f*l/n;return h.x=y,h.y=r,h};k.prototype.clone=function(e){return c(e)||(e=new k),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};k.prototype.equals=function(e){return c(e)&&e instanceof k&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};k.prototype.equalsEpsilon=function(e,n,i){return e===this||c(e)&&e instanceof k&&F.equalsEpsilon(this.right,e.right,n,i)&&F.equalsEpsilon(this.left,e.left,n,i)&&F.equalsEpsilon(this.top,e.top,n,i)&&F.equalsEpsilon(this.bottom,e.bottom,n,i)&&F.equalsEpsilon(this.near,e.near,n,i)&&F.equalsEpsilon(this.far,e.far,n,i)};var pe=k;function x(e){e=e??B.EMPTY_OBJECT,this._offCenterFrustum=new pe,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}x.packedLength=4;x.pack=function(e,n,i){return b.typeOf.object("value",e),b.defined("array",n),i=i??0,n[i++]=e.width,n[i++]=e.aspectRatio,n[i++]=e.near,n[i]=e.far,n};x.unpack=function(e,n,i){return b.defined("array",e),n=n??0,c(i)||(i=new x),i.width=e[n++],i.aspectRatio=e[n++],i.near=e[n++],i.far=e[n],i};function L(e){if(!c(e.width)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new w("width, aspectRatio, near, or far parameters are not set.");let n=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new w("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new w("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let i=1/e.aspectRatio;n.right=e.width*.5,n.left=-n.right,n.top=i*n.right,n.bottom=-n.top,n.near=e.near,n.far=e.far}}Object.defineProperties(x.prototype,{projectionMatrix:{get:function(){return L(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return L(this),this._offCenterFrustum}}});x.prototype.computeCullingVolume=function(e,n,i){return L(this),this._offCenterFrustum.computeCullingVolume(e,n,i)};x.prototype.getPixelDimensions=function(e,n,i,f,h){return L(this),this._offCenterFrustum.getPixelDimensions(e,n,i,f,h)};x.prototype.clone=function(e){return c(e)||(e=new x),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};x.prototype.equals=function(e){return!c(e)||!(e instanceof x)?!1:(L(this),L(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};x.prototype.equalsEpsilon=function(e,n,i){return!c(e)||!(e instanceof x)?!1:(L(this),L(e),F.equalsEpsilon(this.width,e.width,n,i)&&F.equalsEpsilon(this.aspectRatio,e.aspectRatio,n,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,n,i))};var u=x;function q(e){e=e??B.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.farForTileset=e.farForTileset??5e8,this._farForTileset=this.farForTileset,this._cullingVolumeForTileset=new Q,this._cullingVolume=new Q,this._perspectiveMatrix=new P,this._infinitePerspective=new P}function ie(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new w("right, left, top, bottom, near, or far parameters are not set.");let{top:n,bottom:i,right:f,left:h,near:m,far:l}=e;if(n!==e._top||i!==e._bottom||h!==e._left||f!==e._right||m!==e._near||l!==e._far){if(e.near<=0||e.near>e.far)throw new w("near must be greater than zero and less than far.");if(e._left=h,e._right=f,e._top=n,e._bottom=i,e._near=m,e._far=l,e._perspectiveMatrix=P.computePerspectiveOffCenter(h,f,i,n,m,l,e._perspectiveMatrix),e._infinitePerspective=P.computeInfinitePerspectiveOffCenter(h,f,i,n,m,e._infinitePerspective),e._clipPlane){let r=e._clipPlane;e._perspectiveMatrix=le(e._perspectiveMatrix,r),e._infinitePerspective=le(e._infinitePerspective,r)}}}var $=new g,D=new g;function le(e,n){g.clone(n,D),$.x=F.sign(D.x)+e[8]/e[0],$.y=F.sign(D.y)+e[9]/e[5],$.z=-1,$.w=(1+e[10])/e[14];let i=2/g.dot(D,$);return g.multiplyByScalar(D,i,D),e[2]=D.x,e[6]=D.y,e[10]=D.z+1,e[14]=D.w,e}Object.defineProperties(q.prototype,{projectionMatrix:{get:function(){return ie(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return ie(this),this._infinitePerspective}},clipPlane:{get:function(){return this._clipPlane},set:function(e){this._clipPlane=e}}});var we=new o,_e=new o,de=new o,me=new o;q.prototype.computeCullingVolume=function(e,n,i){if(!c(e))throw new w("position is required.");if(!c(n))throw new w("direction is required.");if(!c(i))throw new w("up is required.");let f=this._cullingVolume.planes,h=this.top,m=this.bottom,l=this.right,y=this.left,r=this.near,s=this.far,_=o.cross(n,i,we),d=_e;o.multiplyByScalar(n,r,d),o.add(e,d,d);let p=de;o.multiplyByScalar(n,s,p),o.add(e,p,p);let t=me;o.multiplyByScalar(_,y,t),o.add(d,t,t),o.subtract(t,e,t),o.normalize(t,t),o.cross(t,i,t),o.normalize(t,t);let a=f[0];return c(a)||(a=f[0]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),o.multiplyByScalar(_,l,t),o.add(d,t,t),o.subtract(t,e,t),o.cross(i,t,t),o.normalize(t,t),a=f[1],c(a)||(a=f[1]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),o.multiplyByScalar(i,m,t),o.add(d,t,t),o.subtract(t,e,t),o.cross(_,t,t),o.normalize(t,t),a=f[2],c(a)||(a=f[2]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),o.multiplyByScalar(i,h,t),o.add(d,t,t),o.subtract(t,e,t),o.cross(t,_,t),o.normalize(t,t),a=f[3],c(a)||(a=f[3]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),a=f[4],c(a)||(a=f[4]=new g),a.x=n.x,a.y=n.y,a.z=n.z,a.w=-o.dot(n,d),o.negate(n,t),a=f[5],c(a)||(a=f[5]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,p),this._cullingVolume};q.prototype.computeCullingVolumeForTileset=function(e,n,i){if(!c(e))throw new w("position is required.");if(!c(n))throw new w("direction is required.");if(!c(i))throw new w("up is required.");let f=this._cullingVolumeForTileset.planes,h=this.top,m=this.bottom,l=this.right,y=this.left,r=this.near,s=this.farForTileset,_=o.cross(n,i,we),d=_e;o.multiplyByScalar(n,r,d),o.add(e,d,d);let p=de;o.multiplyByScalar(n,s,p),o.add(e,p,p);let t=me;o.multiplyByScalar(_,y,t),o.add(d,t,t),o.subtract(t,e,t),o.normalize(t,t),o.cross(t,i,t),o.normalize(t,t);let a=f[0];return c(a)||(a=f[0]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),o.multiplyByScalar(_,l,t),o.add(d,t,t),o.subtract(t,e,t),o.cross(i,t,t),o.normalize(t,t),a=f[1],c(a)||(a=f[1]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),o.multiplyByScalar(i,m,t),o.add(d,t,t),o.subtract(t,e,t),o.cross(_,t,t),o.normalize(t,t),a=f[2],c(a)||(a=f[2]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),o.multiplyByScalar(i,h,t),o.add(d,t,t),o.subtract(t,e,t),o.cross(t,_,t),o.normalize(t,t),a=f[3],c(a)||(a=f[3]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,e),a=f[4],c(a)||(a=f[4]=new g),a.x=n.x,a.y=n.y,a.z=n.z,a.w=-o.dot(n,d),o.negate(n,t),a=f[5],c(a)||(a=f[5]=new g),a.x=t.x,a.y=t.y,a.z=t.z,a.w=-o.dot(t,p),this._cullingVolumeForTileset};q.prototype.getPixelDimensions=function(e,n,i,f,h){if(ie(this),!c(e)||!c(n))throw new w("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new w("drawingBufferWidth must be greater than zero.");if(n<=0)throw new w("drawingBufferHeight must be greater than zero.");if(!c(i))throw new w("distance is required.");if(!c(f))throw new w("pixelRatio is required");if(f<=0)throw new w("pixelRatio must be greater than zero.");if(!c(h))throw new w("A result object is required.");let m=1/this.near,l=this.top*m,y=2*f*i*l/n;l=this.right*m;let r=2*f*i*l/e;return h.x=r,h.y=y,h};q.prototype.clone=function(e){return c(e)||(e=new q),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e.clipPlane=this.clipPlane,e};q.prototype.equals=function(e){return c(e)&&e instanceof q&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};q.prototype.equalsEpsilon=function(e,n,i){return e===this||c(e)&&e instanceof q&&F.equalsEpsilon(this.right,e.right,n,i)&&F.equalsEpsilon(this.left,e.left,n,i)&&F.equalsEpsilon(this.top,e.top,n,i)&&F.equalsEpsilon(this.bottom,e.bottom,n,i)&&F.equalsEpsilon(this.near,e.near,n,i)&&F.equalsEpsilon(this.far,e.far,n,i)};var ye=q;function z(e){e=e??B.EMPTY_OBJECT,this._offCenterFrustum=new ye,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.farForTileset=e.farForTileset??5e8,this._farForTileset=this.farForTileset,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}z.packedLength=6;z.pack=function(e,n,i){return b.typeOf.object("value",e),b.defined("array",n),i=i??0,n[i++]=e.fov,n[i++]=e.aspectRatio,n[i++]=e.near,n[i++]=e.far,n[i++]=e.xOffset,n[i]=e.yOffset,n};z.unpack=function(e,n,i){return b.defined("array",e),n=n??0,c(i)||(i=new z),i.fov=e[n++],i.aspectRatio=e[n++],i.near=e[n++],i.far=e[n++],i.xOffset=e[n++],i.yOffset=e[n],i};function R(e){if(!c(e.fov)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new w("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.farForTileset!==e._farForTileset||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(b.typeOf.number.greaterThanOrEquals("fov",e.fov,0),b.typeOf.number.lessThan("fov",e.fov,Math.PI),b.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),b.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new w("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._farForTileset=e.farForTileset,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let i=e._offCenterFrustum;i.top=e.near*Math.tan(.5*e._fovy),i.bottom=-i.top,i.right=e.aspectRatio*i.top,i.left=-i.right,i.near=e.near,i.far=e.far,i.farForTileset=e.farForTileset,i.right+=e.xOffset,i.left+=e.xOffset,i.top+=e.yOffset,i.bottom+=e.yOffset}Object.defineProperties(z.prototype,{projectionMatrix:{get:function(){return R(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return R(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return R(this),this._fovy}},sseDenominator:{get:function(){return R(this),this._sseDenominator}},offCenterFrustum:{get:function(){return R(this),this._offCenterFrustum}}});z.prototype.computeCullingVolume=function(e,n,i){return R(this),this._offCenterFrustum.computeCullingVolume(e,n,i)};z.prototype.computeCullingVolumeForTileset=function(e,n,i){return R(this),this._offCenterFrustum.computeCullingVolumeForTileset(e,n,i)};z.prototype.getPixelDimensions=function(e,n,i,f,h){return R(this),this._offCenterFrustum.getPixelDimensions(e,n,i,f,h)};z.prototype.clone=function(e){return c(e)||(e=new z),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};z.prototype.equals=function(e){return!c(e)||!(e instanceof z)?!1:(R(this),R(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};z.prototype.equalsEpsilon=function(e,n,i){return!c(e)||!(e instanceof z)?!1:(R(this),R(e),F.equalsEpsilon(this.fov,e.fov,n,i)&&F.equalsEpsilon(this.aspectRatio,e.aspectRatio,n,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,n,i))};var j=z;var te=0,xe=1;function Y(e){b.typeOf.object("options",e),b.typeOf.object("options.frustum",e.frustum),b.typeOf.object("options.origin",e.origin),b.typeOf.object("options.orientation",e.orientation);let n=e.frustum,i=e.orientation,f=e.origin,h=e.vertexFormat??E.DEFAULT,m=e._drawNearPlane??!0,l,y;n instanceof j?(l=te,y=j.packedLength):n instanceof u&&(l=xe,y=u.packedLength),this._frustumType=l,this._frustum=n.clone(),this._origin=o.clone(f),this._orientation=N.clone(i),this._drawNearPlane=m,this._vertexFormat=h,this._workerName="createFrustumGeometry",this.packedLength=2+y+o.packedLength+N.packedLength+E.packedLength}Y.pack=function(e,n,i){b.typeOf.object("value",e),b.defined("array",n),i=i??0;let f=e._frustumType,h=e._frustum;return n[i++]=f,f===te?(j.pack(h,n,i),i+=j.packedLength):(u.pack(h,n,i),i+=u.packedLength),o.pack(e._origin,n,i),i+=o.packedLength,N.pack(e._orientation,n,i),i+=N.packedLength,E.pack(e._vertexFormat,n,i),i+=E.packedLength,n[i]=e._drawNearPlane?1:0,n};var ve=new j,Re=new u,qe=new N,Se=new o,ke=new E;Y.unpack=function(e,n,i){b.defined("array",e),n=n??0;let f=e[n++],h;f===te?(h=j.unpack(e,n,ve),n+=j.packedLength):(h=u.unpack(e,n,Re),n+=u.packedLength);let m=o.unpack(e,n,Se);n+=o.packedLength;let l=N.unpack(e,n,qe);n+=N.packedLength;let y=E.unpack(e,n,ke);n+=E.packedLength;let r=e[n]===1;if(!c(i))return new Y({frustum:h,origin:m,orientation:l,vertexFormat:y,_drawNearPlane:r});let s=f===i._frustumType?i._frustum:void 0;return i._frustum=h.clone(s),i._frustumType=f,i._origin=o.clone(m,i._origin),i._orientation=N.clone(l,i._orientation),i._vertexFormat=E.clone(y,i._vertexFormat),i._drawNearPlane=r,i};function X(e,n,i,f,h,m,l,y){let r=e/3*2;for(let s=0;s<4;++s)c(n)&&(n[e]=m.x,n[e+1]=m.y,n[e+2]=m.z),c(i)&&(i[e]=l.x,i[e+1]=l.y,i[e+2]=l.z),c(f)&&(f[e]=y.x,f[e+1]=y.y,f[e+2]=y.z),e+=3;h[r]=0,h[r+1]=0,h[r+2]=1,h[r+3]=0,h[r+4]=1,h[r+5]=1,h[r+6]=0,h[r+7]=1}var De=new H,Me=new P,oe=new P,ge=new o,Ce=new o,Fe=new o,Ne=new o,Ee=new o,Ae=new o,U=new Array(3),I=new Array(4);I[0]=new g(-1,-1,1,1);I[1]=new g(1,-1,1,1);I[2]=new g(1,1,1,1);I[3]=new g(-1,1,1,1);var be=new Array(4);for(let e=0;e<4;++e)be[e]=new g;Y._computeNearFarPlanes=function(e,n,i,f,h,m,l,y){let r=H.fromQuaternion(n,De),s=m??ge,_=l??Ce,d=y??Fe;s=H.getColumn(r,0,s),_=H.getColumn(r,1,_),d=H.getColumn(r,2,d),o.normalize(s,s),o.normalize(_,_),o.normalize(d,d),o.negate(s,s);let p=P.computeView(e,d,_,s,Me),t,a,S=f.projectionMatrix;if(i===te){let O=P.multiply(S,p,oe);a=P.inverse(O,oe)}else t=P.inverseTransformation(p,oe);c(a)?(U[0]=f.near,U[1]=f.far):(U[0]=0,U[1]=f.near,U[2]=f.far);for(let O=0;O<2;++O)for(let T=0;T<4;++T){let C=g.clone(I[T],be[T]);if(c(a)){C=P.multiplyByVector(a,C,C);let M=1/C.w;o.multiplyByScalar(C,M,C),o.subtract(C,e,C),o.normalize(C,C);let K=o.dot(d,C);o.multiplyByScalar(C,U[O]/K,C),o.add(C,e,C)}else{let M=f.offCenterFrustum;c(M)&&(f=M);let K=U[O],G=U[O+1];C.x=(C.x*(f.right-f.left)+f.left+f.right)*.5,C.y=(C.y*(f.top-f.bottom)+f.bottom+f.top)*.5,C.z=(C.z*(K-G)-K-G)*.5,C.w=1,P.multiplyByVector(t,C,C)}h[12*O+T*3]=C.x,h[12*O+T*3+1]=C.y,h[12*O+T*3+2]=C.z}};Y.createGeometry=function(e){let n=e._frustumType,i=e._frustum,f=e._origin,h=e._orientation,m=e._drawNearPlane,l=e._vertexFormat,y=m?6:5,r=new Float64Array(3*4*6);Y._computeNearFarPlanes(f,h,n,i,r);let s=3*4*2;r[s]=r[3*4],r[s+1]=r[3*4+1],r[s+2]=r[3*4+2],r[s+3]=r[0],r[s+4]=r[1],r[s+5]=r[2],r[s+6]=r[3*3],r[s+7]=r[3*3+1],r[s+8]=r[3*3+2],r[s+9]=r[3*7],r[s+10]=r[3*7+1],r[s+11]=r[3*7+2],s+=3*4,r[s]=r[3*5],r[s+1]=r[3*5+1],r[s+2]=r[3*5+2],r[s+3]=r[3],r[s+4]=r[4],r[s+5]=r[5],r[s+6]=r[0],r[s+7]=r[1],r[s+8]=r[2],r[s+9]=r[3*4],r[s+10]=r[3*4+1],r[s+11]=r[3*4+2],s+=3*4,r[s]=r[3],r[s+1]=r[4],r[s+2]=r[5],r[s+3]=r[3*5],r[s+4]=r[3*5+1],r[s+5]=r[3*5+2],r[s+6]=r[3*6],r[s+7]=r[3*6+1],r[s+8]=r[3*6+2],r[s+9]=r[3*2],r[s+10]=r[3*2+1],r[s+11]=r[3*2+2],s+=3*4,r[s]=r[3*2],r[s+1]=r[3*2+1],r[s+2]=r[3*2+2],r[s+3]=r[3*6],r[s+4]=r[3*6+1],r[s+5]=r[3*6+2],r[s+6]=r[3*7],r[s+7]=r[3*7+1],r[s+8]=r[3*7+2],r[s+9]=r[3*3],r[s+10]=r[3*3+1],r[s+11]=r[3*3+2],m||(r=r.subarray(3*4));let _=new fe({position:new W({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:r})});if(c(l.normal)||c(l.tangent)||c(l.bitangent)||c(l.st)){let p=c(l.normal)?new Float32Array(12*y):void 0,t=c(l.tangent)?new Float32Array(3*4*y):void 0,a=c(l.bitangent)?new Float32Array(3*4*y):void 0,S=c(l.st)?new Float32Array(2*4*y):void 0,O=ge,T=Ce,C=Fe,M=o.negate(O,Ne),K=o.negate(T,Ee),G=o.negate(C,Ae);s=0,m&&(X(s,p,t,a,S,G,O,T),s+=3*4),X(s,p,t,a,S,C,M,T),s+=3*4,X(s,p,t,a,S,M,G,T),s+=3*4,X(s,p,t,a,S,K,G,M),s+=3*4,X(s,p,t,a,S,O,C,T),s+=3*4,X(s,p,t,a,S,T,C,M),c(p)&&(_.normal=new W({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),c(t)&&(_.tangent=new W({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t})),c(a)&&(_.bitangent=new W({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:a})),c(S)&&(_.st=new W({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:S}))}let d=new Uint16Array(6*y);for(let p=0;p<y;++p){let t=p*6,a=p*4;d[t]=a,d[t+1]=a+1,d[t+2]=a+2,d[t+3]=a,d[t+4]=a+2,d[t+5]=a+3}return new ce({attributes:_,indices:d,primitiveType:ae.TRIANGLES,boundingSphere:re.fromVertices(r)})};var Vt=Y;export{u as a,j as b,Vt as c}; -- Gitblit v1.9.3