Files
td_official/public/sdk/Cesium/Workers/Matrix2-cf4c6e69.js

26 lines
60 KiB
JavaScript
Raw Permalink Normal View History

2025-07-29 11:22:30 +08:00
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.98
*
* 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.
*/
define(["exports","./defaultValue-50f7432c","./ComponentDatatype-9b23164a","./RuntimeError-48e1f06d"],(function(t,e,n,r){"use strict";function i(t,n,r){this.x=e.defaultValue(t,0),this.y=e.defaultValue(n,0),this.z=e.defaultValue(r,0)}i.fromSpherical=function(t,n){e.defined(n)||(n=new i);const r=t.clock,a=t.cone,u=e.defaultValue(t.magnitude,1),o=u*Math.sin(a);return n.x=o*Math.cos(r),n.y=o*Math.sin(r),n.z=u*Math.cos(a),n},i.fromElements=function(t,n,r,a){return e.defined(a)?(a.x=t,a.y=n,a.z=r,a):new i(t,n,r)},i.clone=function(t,n){if(e.defined(t))return e.defined(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){return r=e.defaultValue(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},i.unpack=function(t,n,r){return n=e.defaultValue(n,0),e.defined(r)||(r=new i),r.x=t[n++],r.y=t[n++],r.z=t[n],r},i.packArray=function(t,n){const r=t.length,a=3*r;e.defined(n)?(Array.isArray(n)||n.length===a)&&n.length!==a&&(n.length=a):n=new Array(a);for(let e=0;e<r;++e)i.pack(t[e],n,3*e);return n},i.unpackArray=function(t,n){const r=t.length;e.defined(n)?n.length=r/3:n=new Array(r/3);for(let e=0;e<r;e+=3){const r=e/3;n[r]=i.unpack(t,e,n[r])}return n},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},i.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},i.clamp=function(t,e,r,i){const a=n.CesiumMath.clamp(t.x,e.x,r.x),u=n.CesiumMath.clamp(t.y,e.y,r.y),o=n.CesiumMath.clamp(t.z,e.z,r.z);return i.x=a,i.y=u,i.z=o,i},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};const a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.distanceSquared=function(t,e){return i.subtract(t,e,a),i.magnitudeSquared(a)},i.normalize=function(t,e){const n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},i.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},i.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},i.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},i.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},i.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};const u=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,u),r=i.multiplyByScalar(t,1-n,r),i.add(u,r,r)};const o=new i,s=new i;i.angleBetween=function(t,e){i.normalize(t,o),i.normalize(e,s);const n=i.dot(o,s),r=i.magnitude(i.cross(o,s,o));return Math.atan2(r,n)};const c=new i;i.mostOrthogonalAxis=function(t,e){const n=i.normalize(t,c);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):n.y<=n.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.projectVector=function(t,e,n){const r=i.dot(t,e)/i.dot(e,e);return i.multiplyByScalar(e,r,n)},i.equals=function(t,n){return t===n||e.defined(t)&&e.defined(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z},i.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},i.equalsEpsilon=function(t,r,i,a){return t===r||e.defined(t)&&e.defined(r)&&n.CesiumMath.equalsEpsilon(t.x,r.x,i,a)&&n.CesiumMath.equalsEpsilon(t.y,r.y,i,a)&&n.CesiumMath.equalsEpsilon(t.z,r.z,i,a)},i.cross=function(t,e,n){const r=t.x,i=t.y,a=t.z,u=e.x,o=e.y,s=e.z,c=i*s-a*o,l=a*u-r*s,f=r*o-i*u;return n.x=c,n.y=l,n.z=f,n},i.midpoint=function(t,e,n){return n.x=.5*(t.x+e.x),n.y=.5*(t.y+e.y),n.z=.5*(t.z+e.z),n},i.fromDegrees=function(t,e,r,a,u){return t=n.CesiumMath.toRadians(t),e=n.CesiumMath.toRadians(e),i.fromRadians(t,e,r,a,u)};let l=new i,f=new i;const d=new i(40680631590769,406806