DHART
Loading...
Searching...
No Matches
nanort::TriangleIntersector< T, H > Class Template Reference

#include <nanort.h>

+ Collaboration diagram for nanort::TriangleIntersector< T, H >:

Classes

struct  RayCoeff
 

Public Member Functions

 TriangleIntersector (const T *vertices, const unsigned int *faces, const size_t vertex_stride_bytes)
 
bool Intersect (T *t_inout, const unsigned int prim_index) const
 Do ray intersection stuff for prim_index th primitive and return hit distance t, barycentric coordinate u and v. Returns true if there's intersection. More...
 
GetT () const
 Returns the nearest hit distance. More...
 
void Update (T t, unsigned int prim_idx) const
 Update is called when initializing intersection and nearest hit is found. More...
 
void PrepareTraversal (const Ray< T > &ray, const BVHTraceOptions &trace_options) const
 Prepare BVH traversal (e.g. compute inverse ray direction) This function is called only once in BVH traversal. More...
 
void PostTraversal (const Ray< T > &ray, bool hit, H *isect) const
 Post BVH traversal stuff. Fill isect if there is a hit. More...
 

Private Attributes

const T * vertices_
 
const unsigned int * faces_
 
const size_t vertex_stride_bytes_
 
real3< T > ray_org_
 
RayCoeff ray_coeff_
 
BVHTraceOptions trace_options_
 
t_min_
 
t_
 
u_
 
v_
 
unsigned int prim_id_
 

Detailed Description

template<typename T = float, class H = TriangleIntersection<T>>
class nanort::TriangleIntersector< T, H >

Definition at line 983 of file nanort.h.


Class Documentation

◆ nanort::TriangleIntersector::RayCoeff

struct nanort::TriangleIntersector::RayCoeff
template<typename T = float, class H = TriangleIntersection<T>>
struct nanort::TriangleIntersector< T, H >::RayCoeff

Definition at line 995 of file nanort.h.

+ Collaboration diagram for nanort::TriangleIntersector< T, H >::RayCoeff:
Class Members
int kx
int ky
int kz
T Sx
T Sy
T Sz

Constructor & Destructor Documentation

◆ TriangleIntersector()

template<typename T = float, class H = TriangleIntersection<T>>
nanort::TriangleIntersector< T, H >::TriangleIntersector ( const T *  vertices,
const unsigned int *  faces,
const size_t  vertex_stride_bytes 
)
inline

Definition at line 985 of file nanort.h.

Member Function Documentation

◆ GetT()

template<typename T = float, class H = TriangleIntersection<T>>
T nanort::TriangleIntersector< T, H >::GetT ( ) const
inline

Returns the nearest hit distance.

Definition at line 1106 of file nanort.h.

References nanort::TriangleIntersector< T, H >::t_.

◆ Intersect()

◆ PostTraversal()

template<typename T = float, class H = TriangleIntersection<T>>
void nanort::TriangleIntersector< T, H >::PostTraversal ( const Ray< T > &  ray,
bool  hit,
H *  isect 
) const
inline

◆ PrepareTraversal()

◆ Update()

template<typename T = float, class H = TriangleIntersection<T>>
void nanort::TriangleIntersector< T, H >::Update ( t,
unsigned int  prim_idx 
) const
inline

Update is called when initializing intersection and nearest hit is found.

Definition at line 1109 of file nanort.h.

References nanort::TriangleIntersector< T, H >::prim_id_, and nanort::TriangleIntersector< T, H >::t_.

Member Data Documentation

◆ faces_

template<typename T = float, class H = TriangleIntersection<T>>
const unsigned int* nanort::TriangleIntersector< T, H >::faces_
private

Definition at line 1170 of file nanort.h.

Referenced by nanort::TriangleIntersector< T, H >::Intersect().

◆ prim_id_

template<typename T = float, class H = TriangleIntersection<T>>
unsigned int nanort::TriangleIntersector< T, H >::prim_id_
mutableprivate

◆ ray_coeff_

template<typename T = float, class H = TriangleIntersection<T>>
RayCoeff nanort::TriangleIntersector< T, H >::ray_coeff_
mutableprivate

◆ ray_org_

template<typename T = float, class H = TriangleIntersection<T>>
real3<T> nanort::TriangleIntersector< T, H >::ray_org_
mutableprivate

◆ t_

template<typename T = float, class H = TriangleIntersection<T>>
T nanort::TriangleIntersector< T, H >::t_
mutableprivate

◆ t_min_

template<typename T = float, class H = TriangleIntersection<T>>
T nanort::TriangleIntersector< T, H >::t_min_
mutableprivate

◆ trace_options_

template<typename T = float, class H = TriangleIntersection<T>>
BVHTraceOptions nanort::TriangleIntersector< T, H >::trace_options_
mutableprivate

◆ u_

template<typename T = float, class H = TriangleIntersection<T>>
T nanort::TriangleIntersector< T, H >::u_
mutableprivate

◆ v_

template<typename T = float, class H = TriangleIntersection<T>>
T nanort::TriangleIntersector< T, H >::v_
mutableprivate

◆ vertex_stride_bytes_

template<typename T = float, class H = TriangleIntersection<T>>
const size_t nanort::TriangleIntersector< T, H >::vertex_stride_bytes_
private

Definition at line 1171 of file nanort.h.

Referenced by nanort::TriangleIntersector< T, H >::Intersect().

◆ vertices_

template<typename T = float, class H = TriangleIntersection<T>>
const T* nanort::TriangleIntersector< T, H >::vertices_
private

Definition at line 1169 of file nanort.h.

Referenced by nanort::TriangleIntersector< T, H >::Intersect().


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