|
|
/** * @license * Cesium - https://github.com/CesiumGS/cesium
* Version 1.140.0 * * 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 E}from"./chunk-N6SIW7ZL.js";import{a as S,b as y}from"./chunk-K35RPNUR.js";import{e as z}from"./chunk-RTRJ3LVQ.js";var m=class o{constructor(n,c,e){this.x=n??0,this.y=c??0,this.z=e??0}static fromSpherical(n,c){y.typeOf.object("spherical",n),z(c)||(c=new o);let e=n.clock,t=n.cone,f=n.magnitude??1,O=f*Math.sin(t);return c.x=O*Math.cos(e),c.y=O*Math.sin(e),c.z=f*Math.cos(t),c}static fromElements(n,c,e,t){return z(t)?(t.x=n,t.y=c,t.z=e,t):new o(n,c,e)}static clone(n,c){if(z(n))return z(c)?(c.x=n.x,c.y=n.y,c.z=n.z,c):new o(n.x,n.y,n.z)}static pack(n,c,e){return y.typeOf.object("value",n),y.defined("array",c),e=e??0,c[e++]=n.x,c[e++]=n.y,c[e]=n.z,c}static unpack(n,c,e){return y.defined("array",n),c=c??0,z(e)||(e=new o),e.x=n[c++],e.y=n[c++],e.z=n[c],e}static packArray(n,c){y.defined("array",n);let e=n.length,t=e*3;if(!z(c))c=new Array(t);else{if(!Array.isArray(c)&&c.length!==t)throw new S("If result is a typed array, it must have exactly array.length * 3 elements");c.length!==t&&(c.length=t)}for(let f=0;f<e;++f)o.pack(n[f],c,f*3);return c}static unpackArray(n,c){if(y.defined("array",n),y.typeOf.number.greaterThanOrEquals("array.length",n.length,3),n.length%3!==0)throw new S("array length must be a multiple of 3.");let e=n.length;z(c)?c.length=e/3:c=new Array(e/3);for(let t=0;t<e;t+=3){let f=t/3;c[f]=o.unpack(n,t,c[f])}return c}static maximumComponent(n){return y.typeOf.object("cartesian",n),Math.max(n.x,n.y,n.z)}static minimumComponent(n){return y.typeOf.object("cartesian",n),Math.min(n.x,n.y,n.z)}static minimumByComponent(n,c,e){return y.typeOf.object("first",n),y.typeOf.object("second",c),y.typeOf.object("result",e),e.x=Math.min(n.x,c.x),e.y=Math.min(n.y,c.y),e.z=Math.min(n.z,c.z),e}static maximumByComponent(n,c,e){return y.typeOf.object("first",n),y.typeOf.object("second",c),y.typeOf.object("result",e),e.x=Math.max(n.x,c.x),e.y=Math.max(n.y,c.y),e.z=Math.max(n.z,c.z),e}static clamp(n,c,e,t){y.typeOf.object("value",n),y.typeOf.object("min",c),y.typeOf.object("max",e),y.typeOf.object("result",t);let f=E.clamp(n.x,c.x,e.x),O=E.clamp(n.y,c.y,e.y),b=E.clamp(n.z,c.z,e.z);return t.x=f,t.y=O,t.z=b,t}static magnitudeSquared(n){return y.typeOf.object("cartesian",n),n.x*n.x+n.y*n.y+n.z*n.z}static magnitude(n){return Math.sqrt(o.magnitudeSquared(n))}static distance(n,c){return y.typeOf.object("left",n),y.typeOf.object("right",c),o.subtract(n,c,k),o.magnitude(k)}static distanceSquared(n,c){return y.typeOf.object("left",n),y.typeOf.object("right",c),o.subtract(n,c,k),o.magnitudeSquared(k)}static normalize(n,c){y.typeOf.object("cartesian",n),y.typeOf.object("result",c);let e=o.magnitude(n);if(c.x=n.x/e,c.y=n.y/e,c.z=n.z/e,isNaN(c.x)||isNaN(c.y)||isNaN(c.z))throw new S("normalized result is not a number");return c}static dot(n,c){return y.typeOf.object("left",n),y.typeOf.object("right",c),n.x*c.x+n.y*c.y+n.z*c.z}static multiplyComponents(n,c,e){return y.typeOf.object("left",n),y.typeOf.object("right",c),y.typeOf.object("result",e),e.x=n.x*c.x,e.y=n.y*c.y,e.z=n.z*c.z,e}static divideComponents(n,c,e){return y.typeOf.object("left",n),y.typeOf.object("right",c),y.typeOf.object("result",e),e.x=n.x/c.x,e.y=n.y/c.y,e.z=n.z/c.z,e}static add(n,c,e){return y.typeOf.object("left",n),y.typeOf.object("right",c),y.typeOf.object("result",e),e.x=n.x+c.x,e.y=n.y+c.y,e.z=n.z+c.z,e}static subtract(n,c,e){return y.typeOf.object("left",n),y.typeOf.object("right",c),y.typeOf.object("result",e),e.x=n.x-c.x,e.y=n.y-c.y,e.z=n.z-c.z,e}static multiplyByScalar(n,c,e){return y.typeOf.object("cartesian",n),y.typeOf.number("scalar",c),y.typeOf.object("result",e),e.x=n.x*c,e.y=n.y*c,e.z=n.z*c,e}static divideByScalar(n,c,e){return y.typeOf.object("cartesian",n),y.typeOf.number("scalar",c),y.typeOf.object("result",e),e.x=n.x/c,e.y=n.y/c,e.z=n.z/c,e}static negate(n,c){return y.typeOf.object("cartesian",n),y.typeOf.object("result",c),c.x=-n.x,c.y=-n.y,c.z=-n.z,c}static abs(n,c){return y.typeOf.object("cartesian",n),y.typeOf.object("result",c),c.x=Math.abs(n.x),c.y=Math.abs(n.y),c.z=Math.abs(n.z),c}static lerp(n,c,e,t){return y.typeOf.object("start",n),y.typeOf.o(${this[1]}, ${this[4]}, ${this[7]})(${this[2]}, ${this[5]}, ${this[8]})`};var pn=p;var $={};$.EMPTY_OBJECT=Object.freeze({});$.EMPTY_ARRAY=Object.freeze([]);var On=$;export{R as a,pn as b,On as c};
|