public

Inheritance Graph

graph BT
	Slope
	click Slope "classGeometry_1_1Intersection_1_1Slope"

Description

Fast intersection tests of a ray with multiple axis-aligned boxes. A class is used instead of a single function because precomputations for the ray have to be carried out before the test can be performed. Based on the article: Martin Eisemann, Marcus Magnor, Thorsten Grosch, Stefan Müller: Fast Ray/Axis-Aligned Bounding Box Overlap Tests using Ray Slopes. Journal of Graphics, GPU, and Game Tools 12, 4, pp. 35-46, 2007.

Note: Parts of the public domain source code accompanying the article were used.

Parameters

value_t
Eitherfloatordouble

Author: Benjamin Eikel

Date: 2013-02-19

Public Functions

   
   
  Slope(const ray_t & ray)
Create a new instance and associate it with a ray.
   
bool isRayIntersectingBox(const box_t & box) const
   
bool getRayBoxIntersection(const box_t & box, value_t & intersection) const
   
const ray_t & getRay() const
Return the stored ray.

Documentation

function
Geometry::Intersection::Slope::Slope

public
     
     
Slope( const ray_t & ray )

Create a new instance and associate it with a ray.

Defined in Geometry/RayBoxIntersection.h:89


function
Geometry::Intersection::Slope::isRayIntersectingBox

public const
     
     
bool isRayIntersectingBox( const box_t & box ) const

Check if the associated ray intersects a box.

Parameters

box
Axis-aligned box

Returns

trueif the ray and the box intersect,falseif there is no intersection

Note: Function in the article is called “slope”

Note: This function is usually a little bit faster than getRayBoxIntersection()

Defined in Geometry/RayBoxIntersection.h:101


function
Geometry::Intersection::Slope::getRayBoxIntersection

public const
     
     
bool getRayBoxIntersection( const box_t & box,
  value_t & intersection
) const    

Calculate the intersection between the associated ray and a box.

Parameters

box
Axis-aligned box
intersection
Intersection point between ray and box. It is given as the ray parameter and set only if there is an intersection.

Returns

trueif the ray and the box intersect,falseif there is no intersection

Note: Function in the article is called “slopeint_mul”

Note: This function is usually a little bit slower than isRayIntersectingBox()

Defined in Geometry/RayBoxIntersection.h:116


function
Geometry::Intersection::Slope::getRay

public const inline
   
   
const ray_t & getRay( ) const

Return the stored ray.

Defined in Geometry/RayBoxIntersection.h:119