Class PickResults

java.lang.Object
com.ardor3d.intersection.PickResults
Direct Known Subclasses:
BoundingPickResults, PrimitivePickResults

public abstract class PickResults extends Object
PickResults stores information created during ray intersection tests. The results will contain a list of every Pickable element encountered in a pick test. Distance can be used to order the results. If checkDistance is set to true, objects will be ordered with the first element in the list being the closest picked object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor instantiates a new PickResults object.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    addPick generates an entry to be added to the list of picked objects.
    void
    Places a new geometry (enclosed in PickData) into the results list.
    void
    clear clears the list of all Mesh objects.
     
    int
    getNumber retrieves the number of geometries that have been placed in the results.
    getPickData(int i)
    Retrieves a geometry (enclosed in PickData) from a specific index.
    void
    Optional method that can be implemented by sub classes to define methods for handling picked objects.
    void
    setCheckDistance(boolean checkDistance)
    Sets if these pick results will order the data by distance from the origin of the Ray.
    boolean
    Reports if these pick results will order the data by distance from the origin of the Ray.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PickResults

      public PickResults()
      Constructor instantiates a new PickResults object.
  • Method Details

    • addPickData

      public void addPickData(PickData data)
      Places a new geometry (enclosed in PickData) into the results list.
      Parameters:
      data - the PickData to be placed in the results list.
    • getNumber

      public int getNumber()
      getNumber retrieves the number of geometries that have been placed in the results.
      Returns:
      the number of Mesh objects in the list.
    • getPickData

      public PickData getPickData(int i)
      Retrieves a geometry (enclosed in PickData) from a specific index.
      Parameters:
      i - the index requested.
      Returns:
      the data at the specified index.
    • clear

      public void clear()
      clear clears the list of all Mesh objects.
    • addPick

      public abstract void addPick(Ray3 ray, Pickable p)
      addPick generates an entry to be added to the list of picked objects. If checkDistance is true, the implementing class should order the object.
      Parameters:
      ray - the ray that was cast for the pick calculation.
      p - the pickable object to add to the pick data.
    • processPick

      public void processPick()
      Optional method that can be implemented by sub classes to define methods for handling picked objects. After calculating all pick results this method is called.
    • willCheckDistance

      public boolean willCheckDistance()
      Reports if these pick results will order the data by distance from the origin of the Ray.
      Returns:
      true if objects will be ordered by distance, false otherwise.
    • setCheckDistance

      public void setCheckDistance(boolean checkDistance)
      Sets if these pick results will order the data by distance from the origin of the Ray.
      Parameters:
      checkDistance - true if objects will be ordered by distance, false otherwise.
    • findFirstIntersectingPickData

      public PickData findFirstIntersectingPickData()