Class IntersectionRecord

java.lang.Object
com.ardor3d.intersection.IntersectionRecord

public class IntersectionRecord extends Object
  • Constructor Details

    • IntersectionRecord

      public IntersectionRecord(double[] distances, Vector3[] points)
      Instantiates a new IntersectionRecord defining the distances and points.
      Parameters:
      distances - the distances of this intersection.
      points - the points of this intersection.
      Throws:
      Ardor3dException - if distances.length != points.length
    • IntersectionRecord

      public IntersectionRecord(double[] distances, Vector3[] points, List<PrimitiveKey> primitives)
      Instantiates a new IntersectionRecord defining the distances and points.
      Parameters:
      distances - the distances of this intersection.
      points - the points of this intersection.
      primitives - the primitives at each index. May be null.
      Throws:
      Ardor3dException - if distances.length != points.length or points.length != primitives.size() (if primitives is not null)
    • IntersectionRecord

      public IntersectionRecord(double[] distances, Vector3[] points, Vector3[] normals, List<PrimitiveKey> primitives)
      Instantiates a new IntersectionRecord defining the distances and points.
      Parameters:
      distances - the distances of this intersection.
      points - the points of this intersection.
      normals - the normals of this intersection.
      primitives - the primitives at each index. May be null.
      Throws:
      Ardor3dException - if distances.length != points.length or points.length != primitives.size() (if primitives is not null)
  • Method Details

    • sortIntersections

      public void sortIntersections()
      Sorts intersections from near to far
    • getNumberOfIntersections

      public int getNumberOfIntersections()
      Returns:
      the number of intersections that occurred.
    • getIntersectionPoint

      public Vector3 getIntersectionPoint(int index)
      Returns an intersection point at a provided index.
      Parameters:
      index - the index of the point to obtain.
      Returns:
      the point at the index of the array.
    • getIntersectionNormal

      public Vector3 getIntersectionNormal(int index)
      Returns an intersection normal at a provided index.
      Parameters:
      index - the index of the point to obtain.
      Returns:
      the normal at the index of the array.
    • getIntersectionDistance

      public double getIntersectionDistance(int index)
      Returns an intersection distance at a provided index.
      Parameters:
      index - the index of the distance to obtain.
      Returns:
      the distance at the index of the array.
    • getIntersectionPrimitive

      public PrimitiveKey getIntersectionPrimitive(int index)
      Parameters:
      index - the index of the primitive to obtain.
      Returns:
      the primitive at the given index.
    • getClosestDistance

      public double getClosestDistance()
      Returns:
      the smallest distance in the distance array or -1 if there are no distances in this.
    • getFurthestDistance

      public double getFurthestDistance()
      Returns:
      the largest distance in the distance array or -1 if there are no distances in this.
    • getClosestIntersection

      public int getClosestIntersection()
      Returns:
      the index in this record with the smallest relative distance or -1 if there are no distances in this record.
    • getFurthestIntersection

      public int getFurthestIntersection()
      Returns:
      the index in this record with the largest relative distance or -1 if there are no distances in this record.