UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.9 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/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{g as s,l as e,f as a,c 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";import{IntersectorType as f}from"./IntersectorType.js";class p{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:(s(u,this.ray.direction,this.distance),e(u))}withinDistance(t){return!!g(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!g(this)&&(s(u,this.ray.direction,this.distance),a(t,this.ray.origin,u),!0)}getTransformedNormal(t){return n(j,this.normal),j[3]=0,m(j,j,this.transformation),n(t,j),o(t,t)}constructor(t){this.intersector=f.OBJECT,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=f.OBJECT,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 g(t){return null!=t?.distance}const u=c(),j=d();export{p as IntersectorResult,g as isValidIntersectorResult};