vmmlib  1.8.0
Templatized C++ vector and matrix math library
 All Classes Namespaces Files Functions Variables Typedefs Pages
vmml::intersection< T > Class Template Reference
+ Collaboration diagram for vmml::intersection< T >:

Public Types

typedef vector< 3, T > vec3
 
typedef vector< 4, T > vec4
 

Public Member Functions

 intersection (const vec3 &origin, const vec3 &direction)
 Constructors. More...
 
bool test_sphere (const vec4 &sphere, T &t) const
 Ray Sphere Intersection - Optimized solution "Real-time Rendering 3rd Edition". More...
 

Detailed Description

template<typename T>
class vmml::intersection< T >

Definition at line 47 of file intersection.hpp.

Constructor & Destructor Documentation

template<typename T >
vmml::intersection< T >::intersection ( const vec3 origin,
const vec3 direction 
)
inline

Constructors.

Parameters
[in]originRay origin
[in]directionRay direction

Definition at line 59 of file intersection.hpp.

Member Function Documentation

template<typename T >
bool vmml::intersection< T >::test_sphere ( const vec4 sphere,
T &  t 
) const

Ray Sphere Intersection - Optimized solution "Real-time Rendering 3rd Edition".

Parameters
[in]centerSphere center
[in]radiusSphere radius
[out]tIntersection distance
Returns
Whether the ray intersects the sphere

Sphere behind the ray origin and ray origin outside the sphere

Squared distance from sphere center to the projection

Distance from the sphere center to the surface along the ray direction

Definition at line 86 of file intersection.hpp.


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