qa-regulatory-gwj-vue/static/map/cesium91/CesiumUnminified/Workers/Plane-bc8b6777.js

2 lines
1.6 KiB
JavaScript
Raw Normal View History

2023-11-07 10:04:37 +08:00
define(["exports","./Cartesian3-e0307675","./Matrix4-4c545f70","./Check-741c5f3c","./defaultValue-81eec7ed","./Math-e73894ab"],(function(n,e,a,t,r,i){"use strict";function s(n,a){this.normal=e.Cartesian3.clone(n),this.distance=a}s.fromPointNormal=function(n,a,t){const i=-e.Cartesian3.dot(a,n);return r.defined(t)?(e.Cartesian3.clone(a,t.normal),t.distance=i,t):new s(a,i)};const o=new e.Cartesian3;s.fromCartesian4=function(n,a){const t=e.Cartesian3.fromCartesian4(n,o),i=n.w;return r.defined(a)?(e.Cartesian3.clone(t,a.normal),a.distance=i,a):new s(t,i)},s.getPointDistance=function(n,a){return e.Cartesian3.dot(n.normal,a)+n.distance};const c=new e.Cartesian3;s.projectPointOntoPlane=function(n,a,t){r.defined(t)||(t=new e.Cartesian3);const i=s.getPointDistance(n,a),o=e.Cartesian3.multiplyByScalar(n.normal,i,c);return e.Cartesian3.subtract(a,o,t)};const l=new a.Matrix4,C=new a.Cartesian4,f=new e.Cartesian3;s.transform=function(n,t,r){const i=n.normal,o=n.distance,c=a.Matrix4.inverseTranspose(t,l);let d=a.Cartesian4.fromElements(i.x,i.y,i.z,o,C);d=a.Matrix4.multiplyByVector(c,d,d);const u=e.Cartesian3.fromCartesian4(d,f);return d=a.Cartesian4.divideByScalar(d,e.Cartesian3.magnitude(u),d),s.fromCartesian4(d,r)},s.clone=function(n,a){return r.defined(a)?(e.Cartesian3.clone(n.normal,a.normal),a.distance=n.distance,a):new s(n.normal,n.distance)},s.equals=function(n,a){return n.distance===a.distance&&e.Cartesian3.equals(n.normal,a.normal)},s.ORIGIN_XY_PLANE=Object.freeze(new s(e.Cartesian3.UNIT_Z,0)),s.ORIGIN_YZ_PLANE=Object.freeze(new s(e.Cartesian3.UNIT_X,0)),s.ORIGIN_ZX_PLANE=Object.freeze(new s(e.Cartesian3.UNIT_Y,0)),n.Plane=s}));