Interface RayIntersection

All Superinterfaces:
Comparable<RayIntersection>, IPosition, MeshPoint, Serializable
All Known Implementing Classes:
RayIntersectionImpl

public interface RayIntersection extends MeshPoint, Comparable<RayIntersection>
A single ray intersection. The natural ordering sorts ray intersections by their distance from the ray's origin (regardless on the direction, i.e., absolute values is taken into account). In case of the same absolute values of the distances, an object with positive distance is preferred (is defined as smaller) over the one with negative value.
  • Method Details

    • getDistance

      double getDistance()
      Returns distance from the ray's origin to this ray intersection.
      Returns:
      distance from the ray's origin to this ray intersection
    • getHitTriangle

      MeshTriangle getHitTriangle()
      Returns hit triangle
      Returns:
      hit triangle
    • isDirectHit

      boolean isDirectHit()
      Determines if the ray intersection is in the direction of the ray (direct hit) or i opposite direction (indirect hit)
      Returns:
      true if the hit is in the ray's direction
    • setDistance

      void setDistance(javax.vecmath.Point3d rayOrigin)
      Set the distance of the intersection point from the ray's origin. If the intersection point lies in the opposite direction than ray's normal, then a negative distance is set.
      Parameters:
      rayOrigin - The origin of the ray that has been used to compute this intersection
    • compareTo

      int compareTo(RayIntersection other)
      Specified by:
      compareTo in interface Comparable<RayIntersection>