learning_cesium/XbsjCesium/Workers/Transforms-251ff661.js

2 lines
106 KiB
JavaScript
Raw Permalink Normal View History

2024-03-19 18:06:25 +08:00
define(["exports","./Cartesian2-697a9954","./Check-f3fec9b0","./when-54335d57","./Math-737a2579","./RuntimeError-88a32665"],function(e,R,o,T,F,B){"use strict";function t(e){this._ellipsoid=T.defaultValue(e,R.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(t.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),t.prototype.project=function(e,t){var n=this._semimajorAxis,r=e.longitude*n,n=e.latitude*n,e=e.height;return T.defined(t)?(t.x=r,t.y=n,t.z=e,t):new R.Cartesian3(r,n,e)},t.prototype.unproject=function(e,t){var n=this._oneOverSemimajorAxis,r=e.x*n,n=e.y*n,e=e.z;return T.defined(t)?(t.longitude=r,t.latitude=n,t.height=e,t):new R.Cartographic(r,n,e)};var a=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function i(e,t){this.start=T.defaultValue(e,0),this.stop=T.defaultValue(t,0)}function L(e,t,n,r,a,i,s,o,u){this[0]=T.defaultValue(e,0),this[1]=T.defaultValue(r,0),this[2]=T.defaultValue(s,0),this[3]=T.defaultValue(t,0),this[4]=T.defaultValue(a,0),this[5]=T.defaultValue(o,0),this[6]=T.defaultValue(n,0),this[7]=T.defaultValue(i,0),this[8]=T.defaultValue(u,0)}L.packedLength=9,L.pack=function(e,t,n){return n=T.defaultValue(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},L.unpack=function(e,t,n){return t=T.defaultValue(t,0),(n=!T.defined(n)?new L:n)[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},L.clone=function(e,t){if(T.defined(e))return T.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new L(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},L.fromArray=function(e,t,n){return t=T.defaultValue(t,0),(n=!T.defined(n)?new L:n)[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},L.fromColumnMajorArray=function(e,t){return L.clone(e,t)},L.fromRowMajorArray=function(e,t){return T.defined(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new L(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},L.fromQuaternion=function(e,t){var n=e.x*e.x,r=e.x*e.y,a=e.x*e.z,i=e.x*e.w,s=e.y*e.y,o=e.y*e.z,u=e.y*e.w,l=e.z*e.z,c=e.z*e.w,d=e.w*e.w,f=n-s-l+d,h=2*(r-c),p=2*(a+u),e=2*(r+c),r=s-n-l+d,c=2*(o-i),u=2*(a-u),i=2*(o+i),d=-n-s+l+d;return T.defined(t)?(t[0]=f,t[1]=e,t[2]=u,t[3]=h,t[4]=r,t[5]=i,t[6]=p,t[7]=c,t[8]=d,t):new L(f,h,p,e,r,c,u,i,d)},L.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),r=Math.cos(-e.heading),a=Math.cos(e.roll),i=Math.sin(-e.pitch),s=Math.sin(-e.heading),o=Math.sin(e.roll),u=n*r,l=-a*s+o*i*r,c=o*s+a*i*r,d=n*s,e=a*r+o*i*s,s=-o*r+a*i*s,i=-i,o=o*n,n=a*n;return T.defined(t)?(t[0]=u,t[1]=d,t[2]=i,t[3]=l,t[4]=e,t[5]=o,t[6]=c,t[7]=s,t[8]=n,t):new L(u,l,c,d,e,s,i,o,n)},L.fromScale=function(e,t){return T.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new L(e.x,0,0,0,e.y,0,0,0,e.z)},L.fromUniformScale=function(e,t){return T.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new L(e,0,0,0,e,0,0,0,e)},L.fromCrossProduct=function(e,t){return T.defined(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new L(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},L.fromRotationX=function(e,t){var n=Math.cos(e),e=Math.sin(e);return T.defined(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=e,t[6]=0,t[7]=-e,t[8]=n,t):new L(1,0,0,0,n,-e,0,e,n)},L.fromRotationY=function(e,t){var n=Math.cos(e),e=Math.sin(e);return T.defined(t)?(t[0]=n,t[1]=0,t[2]=-e,t[3]=0,t[4]=1,t[5]=0,t[6]=e,t[7]=0,t[8]=n,t):new L(n,0,e,0,1,0,-e,0,n)},L.fromRotationZ=function(e,t){var n=Math.cos(e),e=Math.sin(e);return T.defined(t)?(t[0]=n,t[1]=e,t[2]=0,t[3]=-e,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new L(n,-e,0,e,n,0,0,0,1)},L.toArray=function(e,t){return T.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},L.ge