Package com.ardor3d.intersection
Class PickResults
java.lang.Object
com.ardor3d.intersection.PickResults
- Direct Known Subclasses:
BoundingPickResults
,PrimitivePickResults
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
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
addPick
generates an entry to be added to the list of picked objects.void
addPickData
(PickData data) Places a new geometry (enclosed in PickData) into the results list.void
clear()
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.
-
Constructor Details
-
PickResults
public PickResults()Constructor instantiates a newPickResults
object.
-
-
Method Details
-
addPickData
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
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
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
-