/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{ObjectStack as r}from"../../core/ObjectStack.js";import{length as c,add as n,scale as t}from"../../core/libs/gl-matrix-2/math/vec3.js";import{copy as o,fromValues as e,create as u}from"./ray.js";function i(r){return r?{ray:u(r.ray),c0:r.c0,c1:r.c1}:{ray:u(),c0:0,c1:Number.MAX_VALUE}}function a(r,c,n){const t=j.get();return t.ray=r,t.c0=c,t.c1=n,t}function f(r,c=i()){return y(r.ray,r.c0,r.c1,c)}function y(r,c,n,t=i()){return o(r,t.ray),t.c0=c,t.c1=n,t}function m(r,c=i()){return o(r,c.ray),c.c0=0,c.c1=Number.MAX_VALUE,c}function s(r,n,t=i()){const o=c(r.vector);return e(r.origin,n,t.ray),t.c0=0,t.c1=o,t}function p(r,c){return g(r,r.c0,c)}function b(r,c){return g(r,r.c1,c)}function g(r,c,o){return n(o,r.ray.origin,t(o,r.ray.direction,c))}const j=new r(()=>i());export{f as copy,i as create,s as fromLineSegmentAndDirection,m as fromRay,y as fromValues,g as getAt,b as getEnd,p as getStart,a as wrap};
