com.jme.intersection
Class PickResults

java.lang.Object
  extended by com.jme.intersection.PickResults
Direct Known Subclasses:
BoundingPickResults, TrianglePickResults

public abstract class PickResults
extends java.lang.Object

PickResults contains information resulting from a pick test. The results will contain a list of every node that was "struck" during a pick test. Distance can be used to order the results. If checkDistance is set, objects will be ordered with the first element in the list being the closest picked object.

Version:
$Id: PickResults.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell

Constructor Summary
PickResults()
          Constructor instantiates a new PickResults object.
 
Method Summary
abstract  void addPick(Ray ray, Geometry g)
          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 Geometry objects.
 int getNumber()
          getNumber retrieves the number of geometries that have been placed in the results.
 PickData getPickData(int i)
          Retrieves a geometry (enclosed in PickData) from a specific index.
abstract  void processPick()
          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 willCheckDistance()
          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 Detail

PickResults

public PickResults()
Constructor instantiates a new PickResults object.

Method Detail

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 Geometry 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 Geometry objects.


addPick

public abstract void addPick(Ray ray,
                             Geometry g)
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.
g - the object to add to the pick data.

processPick

public abstract 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.