java.lang.Object
de.grogra.ray.intersection.Intersections
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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classThis class is used to speed up the sphere intersection calculation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBox_hasIntersection(Intersections.BoxIntersectionInput input, Intersections.BoxIntersectionLocalVariables local) static voidgetBox_IntersectionDescription(Intersections.BoxInput input, int params, IntersectionDescription desc, Intersections.BoxLocalVariables local) This method calculates different intersection values. !static booleangetBox_T(Intersections.BoxInput input, Intersections.ObjectOutput output, Intersections.BoxLocalVariables local) static voidgetCone_IntersectionDescription(Intersections.ConeInput input, int params, IntersectionDescription desc, Intersections.ConeLocalVariables local) This method calculates different intersection values. !static booleangetCone_T(Intersections.ConeInput input, Intersections.ObjectOutput output, Intersections.ConeLocalVariables local) static voidgetCylinder_IntersectionDescription(Intersections.CylinderInput input, int params, IntersectionDescription desc, Intersections.CylinderLocalVariables local) This method calculates different intersection values. !static booleangetCylinder_T(Intersections.CylinderInput input, Intersections.ObjectOutput output, Intersections.CylinderLocalVariables local) static voidgetFrustum_IntersectionDescription(Intersections.FrustumInput input, int params, IntersectionDescription desc, Intersections.FrustumLocalVariables local) This method calculates different intersection values. !static booleangetFrustum_T(Intersections.FrustumInput input, Intersections.ObjectOutput output, Intersections.FrustumLocalVariables local) static voidgetParallelogram_IntersectionDescription(Intersections.ParallelogramInput input, int params, IntersectionDescription desc, Intersections.ParallelogramLocalVariables local) This method calculates different intersection values. !static booleangetParallelogram_T(Intersections.ParallelogramInput input, Intersections.ObjectOutput output, Intersections.ParallelogramLocalVariables local) static voidgetPlane_IntersectionDescription(Intersections.PlaneInput input, int params, IntersectionDescription desc, Intersections.PlaneLocalVariables local) This method calculates different intersection values. !static booleangetPlane_T(Intersections.PlaneInput input, Intersections.ObjectOutput output, Intersections.PlaneLocalVariables local) static booleangetSolidCone_T(Intersections.ConeInput input, Intersections.ObjectOutput output, Intersections.ConeLocalVariables local) static booleangetSolidCylinder_T(Intersections.CylinderInput input, Intersections.ObjectOutput output, Intersections.CylinderLocalVariables local) static booleangetSolidFrustum_T(Intersections.FrustumInput input, Intersections.ObjectOutput output, Intersections.FrustumLocalVariables local) static booleangetSphere_hasIntersection(Intersections.SphereIntersectionInput input, Intersections.SphereIntersectionLocalVariables local) static voidgetSphere_IntersectionDescription(Intersections.SphereInput input, int params, IntersectionDescription desc, Intersections.SphereLocalVariables local) This method calculates different intersection values. !static booleangetSphere_T(Intersections.SphereInput input, Intersections.ObjectOutput output, Intersections.SphereLocalVariables local) static booleanisPointInsideBox(Point3d point, Vector3f minValues, Vector3f maxValues) static booleanisPointInsideBox(Point3f point, Vector3f minValues, Vector3f maxValues)
-
Field Details
-
EVALUATE_POINT
public static final int EVALUATE_POINT- See Also:
-
EVALUATE_NORMAL
public static final int EVALUATE_NORMAL- See Also:
-
EVALUATE_TANGET_VECTORS
public static final int EVALUATE_TANGET_VECTORS- See Also:
-
EVALUATE_UV_COORDINATES
public static final int EVALUATE_UV_COORDINATES- See Also:
-
EVALUATE_TRANSPARENCY
public static final int EVALUATE_TRANSPARENCY- See Also:
-
EVALUATE_SHADER
public static final int EVALUATE_SHADER- See Also:
-
UNDEFINED_PART
public static final int UNDEFINED_PART- See Also:
-
BOX_FRONT
public static final int BOX_FRONT- See Also:
-
BOX_BACK
public static final int BOX_BACK- See Also:
-
BOX_TOP
public static final int BOX_TOP- See Also:
-
BOX_BOTTOM
public static final int BOX_BOTTOM- See Also:
-
BOX_LEFT
public static final int BOX_LEFT- See Also:
-
BOX_RIGHT
public static final int BOX_RIGHT- See Also:
-
-
Constructor Details
-
Intersections
public Intersections()
-
-
Method Details
-
isPointInsideBox
-
isPointInsideBox
-
getSphere_hasIntersection
public static boolean getSphere_hasIntersection(Intersections.SphereIntersectionInput input, Intersections.SphereIntersectionLocalVariables local) -
getBox_hasIntersection
public static boolean getBox_hasIntersection(Intersections.BoxIntersectionInput input, Intersections.BoxIntersectionLocalVariables local) -
getSphere_T
public static boolean getSphere_T(Intersections.SphereInput input, Intersections.ObjectOutput output, Intersections.SphereLocalVariables 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. -
getPlane_T
public static boolean getPlane_T(Intersections.PlaneInput input, Intersections.ObjectOutput output, Intersections.PlaneLocalVariables 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. -
getParallelogram_T
public static boolean getParallelogram_T(Intersections.ParallelogramInput input, Intersections.ObjectOutput output, Intersections.ParallelogramLocalVariables 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. -
getBox_T
public static boolean getBox_T(Intersections.BoxInput input, Intersections.ObjectOutput output, Intersections.BoxLocalVariables 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. -
getSolidCylinder_T
public static boolean getSolidCylinder_T(Intersections.CylinderInput input, Intersections.ObjectOutput output, Intersections.CylinderLocalVariables local) -
getCylinder_T
public static boolean getCylinder_T(Intersections.CylinderInput input, Intersections.ObjectOutput output, Intersections.CylinderLocalVariables 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. -
getSolidCone_T
public static boolean getSolidCone_T(Intersections.ConeInput input, Intersections.ObjectOutput output, Intersections.ConeLocalVariables local) -
getCone_T
public static boolean getCone_T(Intersections.ConeInput input, Intersections.ObjectOutput output, Intersections.ConeLocalVariables 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. -
getSolidFrustum_T
public static boolean getSolidFrustum_T(Intersections.FrustumInput input, Intersections.ObjectOutput output, Intersections.FrustumLocalVariables local) -
getFrustum_T
public static boolean getFrustum_T(Intersections.FrustumInput input, Intersections.ObjectOutput output, Intersections.FrustumLocalVariables 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.
-