.. role:: ts-api-decorator

####################
RaySphereIntersector
####################

.. js:module:: cee
   :noindex:

.. container:: ts-api-section

   .. js:class:: RaySphereIntersector

      Helper class for computing the intersection between a ray and number of points with a given threshold
      (the radius).



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~cee.RaySphereIntersector.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~cee.RaySphereIntersector.findAllIntersectedSpheresOrderedByDistanceToRay`
   * :js:meth:`~cee.RaySphereIntersector.findClosestIntersectedSphereToRay`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: RaySphereIntersector.constructor()



      :rtype: RaySphereIntersector



Methods
=======

.. rst-class:: ts-api-section

:ts-api-decorator:`static` findAllIntersectedSpheresOrderedByDistanceToRay
--------------------------------------------------------------------------

.. js:method:: RaySphereIntersector.findAllIntersectedSpheresOrderedByDistanceToRay( ray, radius, pointsArr)

   :param ray: None
   :type ray: Ray
   :param radius: None
   :type radius: number
   :param pointsArr: None
   :type pointsArr: ArrayLike <number>


   Find all the points (spheres) intersected by the ray, and return them ordered by the distance
   to the Ray (closest first).

   The spheres are defined with a radius and an array of points in the pointsArr array

   The pointsArr array contains a number of sphere centers in a 1d array:
   <s1.x, s1.y, s1.z, s2.x, s2.y, s2.z> ...


   :rtype: [function]

.. rst-class:: ts-api-section

:ts-api-decorator:`static` findClosestIntersectedSphereToRay
------------------------------------------------------------

.. js:method:: RaySphereIntersector.findClosestIntersectedSphereToRay( ray, radius, pointsArr)

   :param ray: None
   :type ray: Ray
   :param radius: None
   :type radius: number
   :param pointsArr: None
   :type pointsArr: ArrayLike <number>


   Returns the index of the closest intersected sphere to the ray

   The spheres are defined with a radius and an array of points in the pointsArr array

   The pointsArr array contains a number of sphere centers in a 1d array:
   <s1.x, s1.y, s1.z, s2.x, s2.y, s2.z> ...


   :rtype: number

