javax.media.j3d
Class PickInfo.IntersectionInfo

java.lang.Object
  extended by javax.media.j3d.PickInfo.IntersectionInfo
Enclosing class:
PickInfo

public class PickInfo.IntersectionInfo
extends java.lang.Object

The IntersectionInfo object holds extra information about an intersection of a PickShape with a Node as part of a PickInfo. Information such as the intersected geometry, the intersected point, and the vertex indices can be inquired. The local coordinates, normal, color and texture coordiantes of at the intersection can be computed, if they are present and readable, using the interpolation weights and vertex indices.

If the Shape3D being picked has multiple geometry arrays, the possible arrays of IntersectionInfo are stored in the PickInfo and referred to by a geometry index. If the picked geometry is of type, Text3D or CompressGeometry, getVertexIndices is invalid. If the picked Node is an Morph object, the geometry used in pick computation is alway at index 0.

Since:
Java 3D 1.4

Field Summary
private  double distance
           
private  Geometry geom
           
private  int geomIndex
           
private  Point3d intersectionPoint
           
private  int[] vertexIndices
           
 
Constructor Summary
PickInfo.IntersectionInfo()
          IntersectionInfo Constructor
 
Method Summary
 double getDistance()
          Retrieves the distance between the start point of the pickShape and the intersection point.
 Geometry getGeometry()
          Retrieves the reference to the intersected geometry in the picked object, either a Shape3D or Morph.
 int getGeometryIndex()
          Retrieves the index to the intersected geometry in the picked node, either a Shape3D or Morph.
 Point3d getIntersectionPoint()
          Retrieves the reference to the intersection point in the pickable node.
 int[] getVertexIndices()
          Retrieves the vertex indices of the intersected primitive in the geometry.
(package private)  void setDistance(double distance)
           
(package private)  void setGeometry(Geometry geom)
           
(package private)  void setGeometryIndex(int geomIndex)
           
(package private)  void setIntersectionPoint(Point3d intersectionPoint)
           
(package private)  void setVertexIndices(int[] vertexIndices)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

geomIndex

private int geomIndex

geom

private Geometry geom

intersectionPoint

private Point3d intersectionPoint

distance

private double distance

vertexIndices

private int[] vertexIndices
Constructor Detail

PickInfo.IntersectionInfo

PickInfo.IntersectionInfo()
IntersectionInfo Constructor

Method Detail

setGeometryIndex

void setGeometryIndex(int geomIndex)

setGeometry

void setGeometry(Geometry geom)

setIntersectionPoint

void setIntersectionPoint(Point3d intersectionPoint)

setDistance

void setDistance(double distance)

setVertexIndices

void setVertexIndices(int[] vertexIndices)

getGeometryIndex

public int getGeometryIndex()
Retrieves the index to the intersected geometry in the picked node, either a Shape3D or Morph.

Returns:
the index of the intersected geometry in the pickable node.

getGeometry

public Geometry getGeometry()
Retrieves the reference to the intersected geometry in the picked object, either a Shape3D or Morph.

Returns:
the intersected geometry in the pickable node.

getIntersectionPoint

public Point3d getIntersectionPoint()
Retrieves the reference to the intersection point in the pickable node.

Returns:
the intersected point in the pickable node.

getDistance

public double getDistance()
Retrieves the distance between the start point of the pickShape and the intersection point.

Returns:
distance between the start point of the pickShape and the intersection point.

getVertexIndices

public int[] getVertexIndices()
Retrieves the vertex indices of the intersected primitive in the geometry.

Returns:
the vertex indices of the intersected primitive.


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.