2 lines
36 KiB
JavaScript
2 lines
36 KiB
JavaScript
|
define(["exports","./Cartographic-3309dd0d","./Check-7b2a090c","./when-b60132fc","./Cartesian2-47311507","./Math-119be1a3","./Cartesian4-3ca25aab","./RuntimeError-4a5c8994"],(function(e,n,t,a,r,i,u,s){"use strict";function o(e){this._ellipsoid=a.defaultValue(e,r.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(o.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),o.prototype.project=function(e,t){var r=this._semimajorAxis,i=e.longitude*r,u=e.latitude*r,s=e.height;return a.defined(t)?(t.x=i,t.y=u,t.z=s,t):new n.Cartesian3(i,u,s)},o.prototype.unproject=function(e,t){var r=this._oneOverSemimajorAxis,i=e.x*r,u=e.y*r,s=e.z;return a.defined(t)?(t.longitude=i,t.latitude=u,t.height=s,t):new n.Cartographic(i,u,s)};var c=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function l(e,n){this.start=a.defaultValue(e,0),this.stop=a.defaultValue(n,0)}function d(e,n,t,r,i,u,s,o,c){this[0]=a.defaultValue(e,0),this[1]=a.defaultValue(r,0),this[2]=a.defaultValue(s,0),this[3]=a.defaultValue(n,0),this[4]=a.defaultValue(i,0),this[5]=a.defaultValue(o,0),this[6]=a.defaultValue(t,0),this[7]=a.defaultValue(u,0),this[8]=a.defaultValue(c,0)}d.packedLength=9,d.pack=function(e,n,t){return t=a.defaultValue(t,0),n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n[t++]=e[3],n[t++]=e[4],n[t++]=e[5],n[t++]=e[6],n[t++]=e[7],n[t++]=e[8],n},d.unpack=function(e,n,t){return n=a.defaultValue(n,0),a.defined(t)||(t=new d),t[0]=e[n++],t[1]=e[n++],t[2]=e[n++],t[3]=e[n++],t[4]=e[n++],t[5]=e[n++],t[6]=e[n++],t[7]=e[n++],t[8]=e[n++],t},d.clone=function(e,n){if(a.defined(e))return a.defined(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n):new d(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},d.fromArray=function(e,n,t){return n=a.defaultValue(n,0),a.defined(t)||(t=new d),t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t[3]=e[n+3],t[4]=e[n+4],t[5]=e[n+5],t[6]=e[n+6],t[7]=e[n+7],t[8]=e[n+8],t},d.fromColumnMajorArray=function(e,n){return d.clone(e,n)},d.fromRowMajorArray=function(e,n){return a.defined(n)?(n[0]=e[0],n[1]=e[3],n[2]=e[6],n[3]=e[1],n[4]=e[4],n[5]=e[7],n[6]=e[2],n[7]=e[5],n[8]=e[8],n):new d(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},d.fromQuaternion=function(e,n){var t=e.x*e.x,r=e.x*e.y,i=e.x*e.z,u=e.x*e.w,s=e.y*e.y,o=e.y*e.z,c=e.y*e.w,l=e.z*e.z,f=e.z*e.w,C=e.w*e.w,h=t-s-l+C,m=2*(r-f),y=2*(i+c),p=2*(r+f),v=-t+s-l+C,x=2*(o-u),w=2*(i-c),g=2*(o+u),z=-t-s+l+C;return a.defined(n)?(n[0]=h,n[1]=p,n[2]=w,n[3]=m,n[4]=v,n[5]=g,n[6]=y,n[7]=x,n[8]=z,n):new d(h,m,y,p,v,x,w,g,z)},d.fromHeadingPitchRoll=function(e,n){var t=Math.cos(-e.pitch),r=Math.cos(-e.heading),i=Math.cos(e.roll),u=Math.sin(-e.pitch),s=Math.sin(-e.heading),o=Math.sin(e.roll),c=t*r,l=-i*s+o*u*r,f=o*s+i*u*r,C=t*s,h=i*r+o*u*s,m=-o*r+i*u*s,y=-u,p=o*t,v=i*t;return a.defined(n)?(n[0]=c,n[1]=C,n[2]=y,n[3]=l,n[4]=h,n[5]=p,n[6]=f,n[7]=m,n[8]=v,n):new d(c,l,f,C,h,m,y,p,v)},d.fromScale=function(e,n){return a.defined(n)?(n[0]=e.x,n[1]=0,n[2]=0,n[3]=0,n[4]=e.y,n[5]=0,n[6]=0,n[7]=0,n[8]=e.z,n):new d(e.x,0,0,0,e.y,0,0,0,e.z)},d.fromUniformScale=function(e,n){return a.defined(n)?(n[0]=e,n[1]=0,n[2]=0,n[3]=0,n[4]=e,n[5]=0,n[6]=0,n[7]=0,n[8]=e,n):new d(e,0,0,0,e,0,0,0,e)},d.fromCrossProduct=function(e,n){return a.defined(n)?(n[0]=0,n[1]=e.z,n[2]=-e.y,n[3]=-e.z,n[4]=0,n[5]=e.x,n[6]=e.y,n[7]=-e.x,n[8]=0,n):new d(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},d.fromRotationX=function(e,n){var t=Math.cos(e),r=Math.sin(e);return a.defined(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=r,n[6]=0,n[7]=-r,n[8]=t,n):new d(1,0,0,0,t,-r,0,r,t)},d.fromRotationY=function(e,n){var t=Math.cos(e),r=Math.sin(e);return a.defined(n)?(n[0]=t,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=t,n):new d(t,0,r,0,1,0,-r,0,t)},d.fromRotationZ=function(e,n){var t=Math.cos(e),r=Math.sin(e);return a.defined(n)?(n[0]=t,n[1]=r,n[2]=0,n[3]=-r,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new d(t,-r,0,r,t,0,0,0,1)},d.toArray=function(e,n){return a.defined(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8]
|