/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{copy as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r,IDENTITY as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as s,b as e,i as a,d as n,n as o}from"../../../../chunks/vec32.js";import{create as c,UNIT_Z as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as m}from"../../../../chunks/vec42.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as l,copy as y}from"../../../../geometry/support/ray.js";class f{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:(s(u,this.ray.direction,this.distance),e(u))}withinDistance(t){return!!p(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!p(this)&&(s(u,this.ray.direction,this.distance),a(t,this.ray.origin,u),!0)}getTransformedNormal(t){return n(g,this.normal),g[3]=0,m(g,g,this.transformation),n(t,g),o(t,t)}constructor(t){this.intersector=4,this.normal=c(),this.transformation=r(),this._ray=l(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,y(t,this._ray)}set(r,s,e,a,o,c,m){this.intersector=r,this.distance=e,n(this.normal,a??h),t(this.transformation,o??i),this.target=s,this.drapedLayerOrder=c,this.renderPriority=m}copy(r){y(r.ray,this._ray),this.intersector=r.intersector,this.distance=r.distance,this.target=r.target,this.drapedLayerOrder=r.drapedLayerOrder,this.renderPriority=r.renderPriority,n(this.normal,r.normal),t(this.transformation,r.transformation)}}function p(t){return null!=t?.distance}const u=c(),g=d();export{f as IntersectorResult,p as isValidIntersectorResult};
