Thea
Public Member Functions | List of all members
RayIntersectableN< N, T > Class Template Referenceabstract

Abstract base class for an object that supports ray intersection queries in N-space. More...

#include <RayIntersectableN.hpp>

Inheritance diagram for RayIntersectableN< N, T >:
AxisAlignedBoxNBase< 3, T > HyperplaneNBase< 3, T > BallN< N, T > BoxN< N, T > Cone3 Cylinder3 AxisAlignedBoxNBase< N, T > HyperplaneNBase< N, T > Torus3 Triangle3Base< VertexTripleT > Triangle3Base< TriangleLocalVertexTriple3 >

Public Member Functions

virtual RayIntersectionN< N, T > rayIntersection (RayN< N, T > const &ray, T max_time=-1) const
 Get the intersection of a ray with the object, including the hit time and the normal at the intersection point. More...
 
virtual T rayIntersectionTime (RayN< N, T > const &ray, T max_time=-1) const =0
 Get the time taken for a ray to intersect the object, or a negative value if there was no intersection in the forward direction. More...
 
virtual bool rayIntersects (RayN< N, T > const &ray, T max_time=-1) const
 Check if a ray intersects the object in the forward direction. More...
 
virtual ~RayIntersectableN ()
 Destructor. More...
 

Detailed Description

template<int N, typename T = Real>
class Thea::RayIntersectableN< N, T >

Abstract base class for an object that supports ray intersection queries in N-space.

Definition at line 66 of file RayIntersectableN.hpp.

Constructor & Destructor Documentation

virtual ~RayIntersectableN ( )
virtual

Destructor.

Definition at line 72 of file RayIntersectableN.hpp.

Member Function Documentation

virtual RayIntersectionN<N, T> rayIntersection ( RayN< N, T > const &  ray,
max_time = -1 
) const
virtual

Get the intersection of a ray with the object, including the hit time and the normal at the intersection point.

A negative time is returned if there was no intersection in the forward direction. If the normal cannot be computed, the zero vector is returned.

Parameters
rayThe ray to test for intersection.
max_timeMaximum allowable hit time, ignored if negative.
Note
The returned normal need not have unit length.

Reimplemented in AxisAlignedBoxNBase< N, T >, AxisAlignedBoxNBase< 3, T >, BallN< N, T >, HyperplaneNBase< N, T >, HyperplaneNBase< N, Real >, HyperplaneNBase< 3, T >, BoxN< N, T >, and BoxN< 3, Real >.

Definition at line 102 of file RayIntersectableN.hpp.

virtual T rayIntersectionTime ( RayN< N, T > const &  ray,
max_time = -1 
) const
pure virtual

Get the time taken for a ray to intersect the object, or a negative value if there was no intersection in the forward direction.

All subclasses must reimplement this method. If the return value is negative, it should be at least

Parameters
rayThe ray to test for intersection.
max_timeMaximum allowable hit time, ignored if negative.

Implemented in AxisAlignedBoxNBase< N, T >, AxisAlignedBoxNBase< 3, T >, HyperplaneNBase< N, T >, HyperplaneNBase< N, Real >, HyperplaneNBase< 3, T >, BallN< N, T >, BoxN< N, T >, and BoxN< 3, Real >.

virtual bool rayIntersects ( RayN< N, T > const &  ray,
max_time = -1 
) const
virtual

Check if a ray intersects the object in the forward direction.

Parameters
rayThe ray to test for intersection.
max_timeMaximum allowable hit time, ignored if negative.

Reimplemented in AxisAlignedBoxNBase< N, T >, AxisAlignedBoxNBase< 3, T >, HyperplaneNBase< N, T >, HyperplaneNBase< N, Real >, HyperplaneNBase< 3, T >, BallN< N, T >, BoxN< N, T >, and BoxN< 3, Real >.

Definition at line 80 of file RayIntersectableN.hpp.


The documentation for this class was generated from the following file: