de.jreality.scene.pick
Class Hit

java.lang.Object
  extended by de.jreality.scene.pick.Hit
All Implemented Interfaces:
PickResult

public class Hit
extends Object
implements PickResult


Nested Class Summary
static class Hit.HitComparator
           
 
Field Summary
 
Fields inherited from interface de.jreality.scene.pick.PickResult
PICK_TYPE_FACE, PICK_TYPE_LINE, PICK_TYPE_OBJECT, PICK_TYPE_POINT
 
Constructor Summary
Hit(SceneGraphPath path, double[] pointWorld, double dist, double affineCoord, int pickType, int index, int triIndex)
           
 
Method Summary
static boolean convertToBary(double[] bary, double[] x0, double[] x1, double[] x2, double[] x)
           
 double getAffineCoordinate()
           
 double getDist()
           
 int getIndex()
          returns the index of the picked face/edge/point
 double[] getObjectCoordinates()
           
 SceneGraphPath getPickPath()
           
 int getPickType()
          returns if the type of the pick: - PICK_TYPE_OBJECT - PICK_TYPE_FACE - PICK_TYPE_LINE - PICK_TYPE_POINT
 double[] getTextureCoordinates()
          returns texture coordinates if available.
 double[] getWorldCoordinates()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hit

public Hit(SceneGraphPath path,
           double[] pointWorld,
           double dist,
           double affineCoord,
           int pickType,
           int index,
           int triIndex)
Method Detail

getPickPath

public SceneGraphPath getPickPath()
Specified by:
getPickPath in interface PickResult

getWorldCoordinates

public double[] getWorldCoordinates()
Specified by:
getWorldCoordinates in interface PickResult
Returns:
pick point in world coordinates

getObjectCoordinates

public double[] getObjectCoordinates()
Specified by:
getObjectCoordinates in interface PickResult
Returns:
pick point in object coordinates

getDist

public double getDist()

getIndex

public int getIndex()
Description copied from interface: PickResult
returns the index of the picked face/edge/point

Specified by:
getIndex in interface PickResult
Returns:
the index or -1 if not available

toString

public String toString()
Overrides:
toString in class Object

getPickType

public int getPickType()
Description copied from interface: PickResult
returns if the type of the pick: - PICK_TYPE_OBJECT - PICK_TYPE_FACE - PICK_TYPE_LINE - PICK_TYPE_POINT

Specified by:
getPickType in interface PickResult
Returns:

getAffineCoordinate

public double getAffineCoordinate()

convertToBary

public static boolean convertToBary(double[] bary,
                                    double[] x0,
                                    double[] x1,
                                    double[] x2,
                                    double[] x)

getTextureCoordinates

public double[] getTextureCoordinates()
Description copied from interface: PickResult
returns texture coordinates if available.

Specified by:
getTextureCoordinates in interface PickResult
Returns:
the coordinates of null.