de.jreality.scene.pick
Class AABBPickSystem

java.lang.Object
  extended by de.jreality.scene.pick.AABBPickSystem
All Implemented Interfaces:
PickSystem

public class AABBPickSystem
extends java.lang.Object
implements PickSystem

Our pick system implementation. Uses Brute-force as default and AABBTrees if available.

Author:
Steffen Weissmann

Constructor Summary
AABBPickSystem()
           
 
Method Summary
 java.util.List<PickResult> computePick(double[] f, double[] t)
          The parameters need to be homogeneous coordinates.
static void filterList(HitFilter hf, double[] from, double[] to, java.util.List<PickResult> list)
           
static void getFrustumInterval(double[] from, double[] to, Viewer viewer)
           
 void setSceneRoot(SceneGraphComponent root)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AABBPickSystem

public AABBPickSystem()
Method Detail

setSceneRoot

public void setSceneRoot(SceneGraphComponent root)
Specified by:
setSceneRoot in interface PickSystem

computePick

public java.util.List<PickResult> computePick(double[] f,
                                              double[] t)
Description copied from interface: PickSystem
The parameters need to be homogeneous coordinates.

Specified by:
computePick in interface PickSystem
Parameters:
f - foot point of ray in world coordinates (x,y,z,1)
t - end point of ray in world coordinates (x,y,z,1) (can be at infinity) Valid pick points are of the form p = a*from+b*to where a*b >= 0 That is, the affine coordinate (b/a) of p on the line with basis (from,to) is non-negative
Returns:
list of PickResults sorted by distance from foot point

getFrustumInterval

public static void getFrustumInterval(double[] from,
                                      double[] to,
                                      Viewer viewer)

filterList

public static void filterList(HitFilter hf,
                              double[] from,
                              double[] to,
                              java.util.List<PickResult> list)