com.jme.intersection
Class PickData
java.lang.Object
com.jme.intersection.PickData
- Direct Known Subclasses:
- TrianglePickData
public class PickData
- extends java.lang.Object
PickData contains information about a picking operation (or Ray/Volume
intersection). This data contains the mesh the ray hit, the triangles it hit,
and the ray itself.
- Author:
- Mark Powell
Constructor Summary |
PickData(Ray ray,
Geometry targetMesh,
java.util.ArrayList<java.lang.Integer> targetTris,
boolean checkDistance)
instantiates a new PickData object. |
PickData(Ray ray,
Geometry targetMesh,
boolean checkDistance)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
distance
protected float distance
PickData
public PickData(Ray ray,
Geometry targetMesh,
boolean checkDistance)
PickData
public PickData(Ray ray,
Geometry targetMesh,
java.util.ArrayList<java.lang.Integer> targetTris,
boolean checkDistance)
- instantiates a new PickData object.
getTargetMesh
public Geometry getTargetMesh()
getTargetMesh
returns the geometry that was hit by the
ray.
- Returns:
- the geometry hit by the ray.
setTargetMesh
public void setTargetMesh(Geometry mesh)
setTargetMesh
sets the geometry hit by the ray.
- Parameters:
mesh
- the geometry hit by the ray.
getTargetTris
public java.util.ArrayList<java.lang.Integer> getTargetTris()
- Returns:
- Returns the target.
setTargetTris
public void setTargetTris(java.util.ArrayList<java.lang.Integer> target)
- Parameters:
target
- The target to set.
getRay
public Ray getRay()
- Returns:
- Returns the ray.
setRay
public void setRay(Ray ray)
- Parameters:
ray
- The ray to set.
getDistance
public float getDistance()
calculateDistance
protected float calculateDistance()
- For bounds picking this method returns the distance of the ray origin to
the bound. For triangle picking the it should return the distance to the
closest hit triangle.
- Returns:
- distance to the target