@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.22 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{castRenderScreenPointArray3 as r,screenPointObjectToArray as e}from"../../../../core/screenUtils.js";import{copy as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{n as t,d as o,c as i,i as c}from"../../../../chunks/vec32.js";import{create as s}from"../../../../geometry/support/ray.js";import{sv3d as u}from"../../../../geometry/support/vectorStacks.js";function m(r,n,o=s()){return g(r,e(n),o),t(o.direction,o.direction),o}function g(e,n,t){return l(e,e.screenToRender(n,r(u.get())),t)}function l(e,t,i){const c=r(n(u.get(),t));if(c[2]=0,!e.unprojectFromRenderScreen(c,i.origin))return null;const s=r(n(u.get(),t));s[2]=1;const m=e.unprojectFromRenderScreen(s,u.get());return null==m?null:(o(i.direction,m,i.origin),i)}function p(e,n,t){return f(e,e.screenToRender(n,r(u.get())),t)}function f(r,e,n){i(n.origin,r.eye);const t=c(u.get(),e[0],e[1],1),s=r.unprojectFromRenderScreen(t,u.get());return null==s?null:(o(n.direction,s,n.origin),n)}export{l as fromRender,f as fromRenderAtEye,g as fromScreen,p as fromScreenAtEye,m as fromScreenNormalized};