de.grogra.vecmath.geom
Class Intersection

java.lang.Object
  extended by de.grogra.vecmath.geom.Intersection

public class Intersection
extends java.lang.Object

Instances of Intersection specify the properties of an intersection point of a Line with the surface of a Volume. They are part of an IntersectionList.

Author:
Ole Kniemeyer

Field Summary
static int ALL
          Parameter for Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) indicating that all intersections have to be found.
static int ANY
          Parameter for Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) indicating that some arbitrary intersection of the set of all intersections has to be found.
static int CLOSEST
          Parameter for Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) indicating that only the closest intersection (minimal value of parameter) has to be found.
static int ENTERING
          Value for type indicating that the line is entering the solid volume at this intersection poing.
 int face
          This field can be used by the volume to store additional information, e.g., a face index.
static int LEAVING
          Value for type indicating that the line is leaving the solid volume at this intersection point.
 Line line
          Defines the line which was used for this intersection point.
 double parameter
          The intersection point is located at line.origin + parameter * line.direction.
static int PASSING
          Value for type indicating that the line is passing the non-solid (infinitely thin) "volume" (in this case it is not a true volume, rather a surface) at this intersection point.
 Volume solid
          Defines the solid volume on whose surface this intersection point lies.
 Point3d tmpPoint0
          This point may be used freely in methods which perform computations based on this intersection.
 Vector3d tmpVector0
          This vector may be used freely in methods which perform computations based on this intersection.
 int type
          Indicates the type of intersection, one of ENTERING, LEAVING, or PASSING.
 Volume volume
          Defines the volume which computed this intersection point.
 java.lang.Object volumeData
          This field can be used by the volume to store additional information.
 Vector3d volumeVector
          This field can be used by the volume to store additional information.
 
Constructor Summary
Intersection(IntersectionList list)
           
 
Method Summary
 Intersection deepCopy()
           
 Vector3d getNormal()
          Returns the surface geometric normal unit vector in global coordinates.
 Point3d getPoint()
          Returns the intersection point in global coordinates.
 Vector3d getUTangent()
          Returns the surface geometric normal unit vector in global coordinates.
 Vector2d getUV()
          Returns the uv coordinates of this intersection point.
 Vector3d getVTangent()
           
 void negateNormal()
          This method can be invoked by CSG operations to indicate that the true normal vector is the negation of the vector which would be computed otherwise.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
Parameter for Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) indicating that all intersections have to be found.

See Also:
Constant Field Values

ANY

public static final int ANY
Parameter for Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) indicating that some arbitrary intersection of the set of all intersections has to be found.

See Also:
Constant Field Values

CLOSEST

public static final int CLOSEST
Parameter for Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) indicating that only the closest intersection (minimal value of parameter) has to be found.

See Also:
Constant Field Values

ENTERING

public static final int ENTERING
Value for type indicating that the line is entering the solid volume at this intersection poing.

See Also:
Constant Field Values

face

public int face
This field can be used by the volume to store additional information, e.g., a face index.


LEAVING

public static final int LEAVING
Value for type indicating that the line is leaving the solid volume at this intersection point.

See Also:
Constant Field Values

line

public Line line
Defines the line which was used for this intersection point.


parameter

public double parameter
The intersection point is located at line.origin + parameter * line.direction. Within an IntersectionList, intersections are sorted in ascending order of parameter.


PASSING

public static final int PASSING
Value for type indicating that the line is passing the non-solid (infinitely thin) "volume" (in this case it is not a true volume, rather a surface) at this intersection point.

See Also:
Constant Field Values

solid

public Volume solid
Defines the solid volume on whose surface this intersection point lies. Normally, it equals volume, but for CSG operations, it is set to the resulting CSG volume.


tmpPoint0

public Point3d tmpPoint0
This point may be used freely in methods which perform computations based on this intersection.


tmpVector0

public Vector3d tmpVector0
This vector may be used freely in methods which perform computations based on this intersection.


type

public int type
Indicates the type of intersection, one of ENTERING, LEAVING, or PASSING.


volume

public Volume volume
Defines the volume which computed this intersection point.


volumeData

public java.lang.Object volumeData
This field can be used by the volume to store additional information.


volumeVector

public final Vector3d volumeVector
This field can be used by the volume to store additional information.

Constructor Detail

Intersection

public Intersection(IntersectionList list)
Method Detail

deepCopy

public Intersection deepCopy()

getNormal

public Vector3d getNormal()
Returns the surface geometric normal unit vector in global coordinates. It is the outer normal vector, pointing from the surface outwards. The vector is computed once by Volume.computeNormal(Intersection, Vector3d). The returned value may not be modified.

Returns:
outer unit normal vector

getPoint

public Point3d getPoint()
Returns the intersection point in global coordinates. The returned value may not be modified.

Returns:
intersection point

getUTangent

public Vector3d getUTangent()
Returns the surface geometric normal unit vector in global coordinates. It is the outer normal vector, pointing from the surface outwards. The vector is computed once by Volume.computeNormal(Intersection, Vector3d). The returned value may not be modified.

Returns:
outer unit normal vector

getUV

public Vector2d getUV()
Returns the uv coordinates of this intersection point. It is computed once by Volume.computeUV(Intersection, Vector2d). The returned value may not be modified.

Returns:
uv coordinates

getVTangent

public Vector3d getVTangent()

negateNormal

public void negateNormal()
This method can be invoked by CSG operations to indicate that the true normal vector is the negation of the vector which would be computed otherwise.


toString

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