Package org.joml
Class RayAabIntersection
- java.lang.Object
- 
- org.joml.RayAabIntersection
 
- 
 public class RayAabIntersection extends java.lang.ObjectThis is an implementation of the Fast Ray/Axis-Aligned Bounding Box Overlap Tests using Ray Slopes paper.It is an efficient implementation when testing many axis-aligned boxes against the same ray. This class is thread-safe and can be used in a multithreaded environment when testing many axis-aligned boxes against the same ray concurrently. - Author:
- Kai Burjack
 
- 
- 
Constructor SummaryConstructors Constructor Description RayAabIntersection()Create a newRayAabIntersectionwithout initializing a ray.RayAabIntersection(float originX, float originY, float originZ, float dirX, float dirY, float dirZ)Create a newRayAabIntersectionand initialize it with a ray with origin(originX, originY, originZ)and direction(dirX, dirY, dirZ).
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidset(float originX, float originY, float originZ, float dirX, float dirY, float dirZ)Update the ray stored by thisRayAabIntersectionwith the new origin(originX, originY, originZ)and direction(dirX, dirY, dirZ).booleantest(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)Test whether the ray stored in thisRayAabIntersectionintersect the axis-aligned box given via its minimum corner(minX, minY, minZ)and its maximum corner(maxX, maxY, maxZ).
 
- 
- 
- 
Constructor Detail- 
RayAabIntersectionpublic RayAabIntersection() Create a newRayAabIntersectionwithout initializing a ray.Before using the intersect()method, the methodset()must be called in order to initialize the created RayAabIntersection instance with a ray.
 - 
RayAabIntersectionpublic RayAabIntersection(float originX, float originY, float originZ, float dirX, float dirY, float dirZ)Create a newRayAabIntersectionand initialize it with a ray with origin(originX, originY, originZ)and direction(dirX, dirY, dirZ).In order to change the direction and/or origin of the ray later, use set().- Parameters:
- originX- the x coordinate of the origin
- originY- the y coordinate of the origin
- originZ- the z coordinate of the origin
- dirX- the x coordinate of the direction
- dirY- the y coordinate of the direction
- dirZ- the z coordinate of the direction
- See Also:
- set(float, float, float, float, float, float)
 
 
- 
 - 
Method Detail- 
setpublic void set(float originX, float originY, float originZ, float dirX, float dirY, float dirZ)Update the ray stored by thisRayAabIntersectionwith the new origin(originX, originY, originZ)and direction(dirX, dirY, dirZ).- Parameters:
- originX- the x coordinate of the ray origin
- originY- the y coordinate of the ray origin
- originZ- the z coordinate of the ray origin
- dirX- the x coordinate of the ray direction
- dirY- the y coordinate of the ray direction
- dirZ- the z coordinate of the ray direction
 
 - 
testpublic boolean test(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)Test whether the ray stored in thisRayAabIntersectionintersect the axis-aligned box given via its minimum corner(minX, minY, minZ)and its maximum corner(maxX, maxY, maxZ).This implementation uses a tableswitch to dispatch to the correct intersection method. This method is thread-safe and can be used to test many axis-aligned boxes concurrently. - Parameters:
- minX- the x coordinate of the minimum corner
- minY- the y coordinate of the minimum corner
- minZ- the z coordinate of the minimum corner
- maxX- the x coordinate of the maximum corner
- maxY- the y coordinate of the maximum corner
- maxZ- the z coordinate of the maximum corner
- Returns:
- trueiff the ray intersects the given axis-aligned box;- falseotherwise
 
 
- 
 
-