Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RaySphereIntersector

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

Hierarchy

  • RaySphereIntersector

Index

Methods

Static findAllIntersectedSpheresOrderedByDistanceToRay

  • findAllIntersectedSpheresOrderedByDistanceToRay(ray: Ray, radius: number, pointsArr: ArrayLike<number>): { index: number; l2Distance: 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> ...

    Parameters

    • ray: Ray
    • radius: number
    • pointsArr: ArrayLike<number>

    Returns { index: number; l2Distance: number }[]

Static findClosestIntersectedSphereToRay

  • findClosestIntersectedSphereToRay(ray: Ray, radius: number, pointsArr: ArrayLike<number>): 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> ...

    Parameters

    • ray: Ray
    • radius: number
    • pointsArr: ArrayLike<number>

    Returns number

Generated using TypeDoc