de.grogra.ray.intersection
Class Intersections

java.lang.Object
  extended by de.grogra.ray.intersection.Intersections

public class Intersections
extends java.lang.Object

This is a helpful utility class for intersection calculations. It offers static mehtods to calculate intersections between a ray and a sphere, a box, a cylinder, a cone, a cone frustum, a plane or a parallelogram. For each of this cases there are two methods that can be used: get[object]_T Calculates only the distance of the ray origin to the intersection point. get[object]_IntersectionDescription Calculates diffenrent additional values of the intersection point. !!! It is important that you call get[object]_T first and with the same instance of the local varialbles object and after this second the method get[object]_IntersectionDescription. !!!

Author:
Micha

Nested Class Summary
static class Intersections.BoxInput
           
static class Intersections.BoxIntersectionInput
           
static class Intersections.BoxIntersectionLocalVariables
           
static class Intersections.BoxLocalVariables
           
static class Intersections.ConeInput
           
static class Intersections.ConeLocalVariables
           
static class Intersections.CylinderInput
           
static class Intersections.CylinderLocalVariables
           
static class Intersections.FrustumInput
           
static class Intersections.FrustumLocalVariables
           
static class Intersections.ObjectOutput
           
static class Intersections.ParallelogramInput
           
static class Intersections.ParallelogramLocalVariables
           
static class Intersections.PlaneInput
           
static class Intersections.PlaneLocalVariables
           
static class Intersections.SphereInput
           
static class Intersections.SphereIntersectionInput
           
static class Intersections.SphereIntersectionLocalVariables
           
static class Intersections.SphereLocalVariables
          This class is used to speed up the sphere intersection calculation.
 
Field Summary
static int BOX_BACK
           
static int BOX_BOTTOM
           
static int BOX_FRONT
           
static int BOX_LEFT
           
static int BOX_RIGHT
           
static int BOX_TOP
           
static int EVALUATE_NORMAL
           
static int EVALUATE_POINT
           
static int EVALUATE_SHADER
           
static int EVALUATE_TANGET_VECTORS
           
static int EVALUATE_TRANSPARENCY
           
static int EVALUATE_UV_COORDINATES
           
static int UNDEFINED_PART
           
 
Constructor Summary
Intersections()
           
 
Method Summary
static boolean getBox_hasIntersection(Intersections.BoxIntersectionInput input, Intersections.BoxIntersectionLocalVariables local)
           
static void getBox_IntersectionDescription(Intersections.BoxInput input, int params, IntersectionDescription desc, Intersections.BoxLocalVariables local)
          This method calculates different intersection values. !
static boolean getBox_T(Intersections.BoxInput input, Intersections.ObjectOutput output, Intersections.BoxLocalVariables local)
           
static void getCone_IntersectionDescription(Intersections.ConeInput input, int params, IntersectionDescription desc, Intersections.ConeLocalVariables local)
          This method calculates different intersection values. !
static boolean getCone_T(Intersections.ConeInput input, Intersections.ObjectOutput output, Intersections.ConeLocalVariables local)
           
static void getCylinder_IntersectionDescription(Intersections.CylinderInput input, int params, IntersectionDescription desc, Intersections.CylinderLocalVariables local)
          This method calculates different intersection values. !
static boolean getCylinder_T(Intersections.CylinderInput input, Intersections.ObjectOutput output, Intersections.CylinderLocalVariables local)
           
static void getFrustum_IntersectionDescription(Intersections.FrustumInput input, int params, IntersectionDescription desc, Intersections.FrustumLocalVariables local)
          This method calculates different intersection values. !
static boolean getFrustum_T(Intersections.FrustumInput input, Intersections.ObjectOutput output, Intersections.FrustumLocalVariables local)
           
static void getParallelogram_IntersectionDescription(Intersections.ParallelogramInput input, int params, IntersectionDescription desc, Intersections.ParallelogramLocalVariables local)
          This method calculates different intersection values. !
static boolean getParallelogram_T(Intersections.ParallelogramInput input, Intersections.ObjectOutput output, Intersections.ParallelogramLocalVariables local)
           
static void getPlane_IntersectionDescription(Intersections.PlaneInput input, int params, IntersectionDescription desc, Intersections.PlaneLocalVariables local)
          This method calculates different intersection values. !
static boolean getPlane_T(Intersections.PlaneInput input, Intersections.ObjectOutput output, Intersections.PlaneLocalVariables local)
           
static boolean getSolidCone_T(Intersections.ConeInput input, Intersections.ObjectOutput output, Intersections.ConeLocalVariables local)
           
static boolean getSolidCylinder_T(Intersections.CylinderInput input, Intersections.ObjectOutput output, Intersections.CylinderLocalVariables local)
           
static boolean getSolidFrustum_T(Intersections.FrustumInput input, Intersections.ObjectOutput output, Intersections.FrustumLocalVariables local)
           
static boolean getSphere_hasIntersection(Intersections.SphereIntersectionInput input, Intersections.SphereIntersectionLocalVariables local)
           
static void getSphere_IntersectionDescription(Intersections.SphereInput input, int params, IntersectionDescription desc, Intersections.SphereLocalVariables local)
          This method calculates different intersection values. !
static boolean getSphere_T(Intersections.SphereInput input, Intersections.ObjectOutput output, Intersections.SphereLocalVariables local)
           
static boolean isPointInsideBox(Point3d point, Vector3f minValues, Vector3f maxValues)
           
static boolean isPointInsideBox(Point3f point, Vector3f minValues, Vector3f maxValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOX_BACK

public static final int BOX_BACK
See Also:
Constant Field Values

BOX_BOTTOM

public static final int BOX_BOTTOM
See Also:
Constant Field Values

BOX_FRONT

public static final int BOX_FRONT
See Also:
Constant Field Values

BOX_LEFT

public static final int BOX_LEFT
See Also:
Constant Field Values

BOX_RIGHT

public static final int BOX_RIGHT
See Also:
Constant Field Values

BOX_TOP

public static final int BOX_TOP
See Also:
Constant Field Values

EVALUATE_NORMAL

public static final int EVALUATE_NORMAL
See Also:
Constant Field Values

EVALUATE_POINT

public static final int EVALUATE_POINT
See Also:
Constant Field Values

EVALUATE_SHADER

public static final int EVALUATE_SHADER
See Also:
Constant Field Values

EVALUATE_TANGET_VECTORS

public static final int EVALUATE_TANGET_VECTORS
See Also:
Constant Field Values

EVALUATE_TRANSPARENCY

public static final int EVALUATE_TRANSPARENCY
See Also:
Constant Field Values

EVALUATE_UV_COORDINATES

public static final int EVALUATE_UV_COORDINATES
See Also:
Constant Field Values

UNDEFINED_PART

public static final int UNDEFINED_PART
See Also:
Constant Field Values
Constructor Detail

Intersections

public Intersections()
Method Detail

getBox_hasIntersection

public static boolean getBox_hasIntersection(Intersections.BoxIntersectionInput input,
                                             Intersections.BoxIntersectionLocalVariables local)

getBox_IntersectionDescription

public static void getBox_IntersectionDescription(Intersections.BoxInput input,
                                                  int params,
                                                  IntersectionDescription desc,
                                                  Intersections.BoxLocalVariables local)
This method calculates different intersection values. !IMPORTANT! It is required that the method getBox_T was executed previously.


getBox_T

public static boolean getBox_T(Intersections.BoxInput input,
                               Intersections.ObjectOutput output,
                               Intersections.BoxLocalVariables local)

getCone_IntersectionDescription

public static void getCone_IntersectionDescription(Intersections.ConeInput input,
                                                   int params,
                                                   IntersectionDescription desc,
                                                   Intersections.ConeLocalVariables local)
This method calculates different intersection values. !IMPORTANT! It is required that the method getCone_T was executed previously.


getCone_T

public static boolean getCone_T(Intersections.ConeInput input,
                                Intersections.ObjectOutput output,
                                Intersections.ConeLocalVariables local)

getCylinder_IntersectionDescription

public static void getCylinder_IntersectionDescription(Intersections.CylinderInput input,
                                                       int params,
                                                       IntersectionDescription desc,
                                                       Intersections.CylinderLocalVariables local)
This method calculates different intersection values. !IMPORTANT! It is required that the method getCylinder_T was executed previously.


getCylinder_T

public static boolean getCylinder_T(Intersections.CylinderInput input,
                                    Intersections.ObjectOutput output,
                                    Intersections.CylinderLocalVariables local)

getFrustum_IntersectionDescription

public static void getFrustum_IntersectionDescription(Intersections.FrustumInput input,
                                                      int params,
                                                      IntersectionDescription desc,
                                                      Intersections.FrustumLocalVariables local)
This method calculates different intersection values. !IMPORTANT! It is required that the method getFrustum_T was executed previously.


getFrustum_T

public static boolean getFrustum_T(Intersections.FrustumInput input,
                                   Intersections.ObjectOutput output,
                                   Intersections.FrustumLocalVariables local)

getParallelogram_IntersectionDescription

public static void getParallelogram_IntersectionDescription(Intersections.ParallelogramInput input,
                                                            int params,
                                                            IntersectionDescription desc,
                                                            Intersections.ParallelogramLocalVariables local)
This method calculates different intersection values. !IMPORTANT! It is required that the method getParallelogram_T was executed previously.


getParallelogram_T

public static boolean getParallelogram_T(Intersections.ParallelogramInput input,
                                         Intersections.ObjectOutput output,
                                         Intersections.ParallelogramLocalVariables local)

getPlane_IntersectionDescription

public static void getPlane_IntersectionDescription(Intersections.PlaneInput input,
                                                    int params,
                                                    IntersectionDescription desc,
                                                    Intersections.PlaneLocalVariables local)
This method calculates different intersection values. !IMPORTANT! It is required that the method getPlane_T was executed previously.


getPlane_T

public static boolean getPlane_T(Intersections.PlaneInput input,
                                 Intersections.ObjectOutput output,
                                 Intersections.PlaneLocalVariables local)

getSolidCone_T

public static boolean getSolidCone_T(Intersections.ConeInput input,
                                     Intersections.ObjectOutput output,
                                     Intersections.ConeLocalVariables local)

getSolidCylinder_T

public static boolean getSolidCylinder_T(Intersections.CylinderInput input,
                                         Intersections.ObjectOutput output,
                                         Intersections.CylinderLocalVariables local)

getSolidFrustum_T

public static boolean getSolidFrustum_T(Intersections.FrustumInput input,
                                        Intersections.ObjectOutput output,
                                        Intersections.FrustumLocalVariables local)

getSphere_hasIntersection

public static boolean getSphere_hasIntersection(Intersections.SphereIntersectionInput input,
                                                Intersections.SphereIntersectionLocalVariables local)

getSphere_IntersectionDescription

public static void getSphere_IntersectionDescription(Intersections.SphereInput input,
                                                     int params,
                                                     IntersectionDescription desc,
                                                     Intersections.SphereLocalVariables local)
This method calculates different intersection values. !IMPORTANT! It is required that the method getSphere_T was executed previously.


getSphere_T

public static boolean getSphere_T(Intersections.SphereInput input,
                                  Intersections.ObjectOutput output,
                                  Intersections.SphereLocalVariables local)

isPointInsideBox

public static boolean isPointInsideBox(Point3d point,
                                       Vector3f minValues,
                                       Vector3f maxValues)

isPointInsideBox

public static boolean isPointInsideBox(Point3f point,
                                       Vector3f minValues,
                                       Vector3f maxValues)