/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../core/ObjectStack","../../chunks/vec3","./ray","./vectorStacks"],(function(e,r,c,t,n){"use strict";function o(e){return e?{ray:t.create(e.ray),c0:e.c0,c1:e.c1}:{ray:t.create(),c0:0,c1:Number.MAX_VALUE}}function u(e,r,c){const t=d.get();return t.ray=e,t.c0=r,t.c1=c,t}function a(e,r=o()){return i(e.ray,e.c0,e.c1,r)}function i(e,r,c,n=o()){return t.copy(e,n.ray),n.c0=r,n.c1=c,n}function f(e,r=o()){return t.copy(e,r.ray),r.c0=0,r.c1=Number.MAX_VALUE,r}function y(e,r=o()){return s(e,c.normalize(n.sv3d.get(),e.vector),r)}function s(e,r,n=o()){const u=c.length(e.vector);return t.fromValues(e.origin,r,n.ray),n.c0=0,n.c1=u,n}function g(e,r){return m(e,e.c0,r)}function l(e,r){return m(e,e.c1,r)}function m(e,r,t){return c.add(t,e.ray.origin,c.scale(t,e.ray.direction,r))}const d=new r.ObjectStack((()=>({c0:0,c1:0,ray:null})));e.copy=a,e.create=o,e.fromLineSegment=y,e.fromLineSegmentAndDirection=s,e.fromRay=f,e.fromValues=i,e.getAt=m,e.getEnd=l,e.getStart=g,e.wrap=u,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
