de.javagl.swogl
Class IntersectionInfo

java.lang.Object
  extended by de.javagl.swogl.IntersectionInfo

public final class IntersectionInfo
extends java.lang.Object

This class summarizes information about the intersection between a Ray and a SwoglComponent. Instances of this class may be obtained from SwoglContainer.computeIntersectionInfos(java.awt.Point).


Method Summary
 javax.vecmath.Point3f computeIntersectionPosition()
          Compute the position where the intersection happened, in the local coordinate system of the SwoglComponent, and return it as a Point.
 PickingInfo createPickingInfo()
          Returns the PickingInfo for the intersection described by this IntersectionInfo
 javax.vecmath.Point3f getBaryCoords()
          Returns a copy of the barycentric coordinates where the triangle was intersected.
 float getDistance()
          Returns the distance of the intersection from the ray origin
 SwoglComponent getSwoglComponent()
          Returns the SwoglComponent that was intersected
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSwoglComponent

public SwoglComponent getSwoglComponent()
Returns the SwoglComponent that was intersected

Returns:
The SwoglComponent that was intersected

getDistance

public float getDistance()
Returns the distance of the intersection from the ray origin

Returns:
The distance of the intersection from the ray origin

getBaryCoords

public javax.vecmath.Point3f getBaryCoords()
Returns a copy of the barycentric coordinates where the triangle was intersected.

Returns:
The barycentric coordinates of the intersection.

computeIntersectionPosition

public javax.vecmath.Point3f computeIntersectionPosition()
Compute the position where the intersection happened, in the local coordinate system of the SwoglComponent, and return it as a Point. To convert this position into world coordinates, it has to be transformed with the transformation matrix of the SwoglComponent.

Returns:
The intersection position

createPickingInfo

public PickingInfo createPickingInfo()
Returns the PickingInfo for the intersection described by this IntersectionInfo

Returns:
The PickingInfo for this intersection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object