DHART
Loading...
Searching...
No Matches
nanort Namespace Reference

Classes

class  BBox
 Bounding box. More...
 
struct  BinBuffer
 
class  BVHAccel
 Bounding Volume Hierarchy acceleration. More...
 
struct  BVHBuildOptions
 BVH build option. More...
 
class  BVHBuildStatistics
 BVH build statistics. More...
 
class  BVHNode
 
class  BVHTraceOptions
 BVH trace option. More...
 
class  IntersectComparator
 
class  NodeHit
 Hit class for traversing nodes. More...
 
class  NodeHitComparator
 Comparator object for NodeHit. More...
 
class  Ray
 
class  real3
 
class  StackAllocator
 
class  StackContainer
 
class  StackVector
 
class  TriangleIntersection
 
class  TriangleIntersector
 
class  TriangleMesh
 
class  TriangleSAHPred
 

Enumerations

enum  RayType {
  RAY_TYPE_NONE = 0x0 , RAY_TYPE_PRIMARY = 0x1 , RAY_TYPE_SECONDARY = 0x2 , RAY_TYPE_DIFFUSE = 0x4 ,
  RAY_TYPE_REFLECTION = 0x8 , RAY_TYPE_REFRACTION = 0x10
}
 

Functions

template<typename T >
real3< T > operator* (T f, const real3< T > &v)
 
template<typename T >
real3< T > vneg (const real3< T > &rhs)
 
template<typename T >
vlength (const real3< T > &rhs)
 
template<typename T >
real3< T > vnormalize (const real3< T > &rhs)
 
template<typename T >
real3< T > vcross (const real3< T > a, const real3< T > b)
 
template<typename T >
vdot (const real3< T > a, const real3< T > b)
 
template<typename T >
real3< T > vsafe_inverse (const real3< T > v)
 
template<typename real >
const real * get_vertex_addr (const real *p, const size_t idx, const size_t stride_bytes)
 
template<class T >
const T & safemin (const T &a, const T &b)
 
template<class T >
const T & safemax (const T &a, const T &b)
 
template<typename T >
CalculateSurfaceArea (const real3< T > &min, const real3< T > &max)
 
template<typename T >
void GetBoundingBoxOfTriangle (real3< T > *bmin, real3< T > *bmax, const T *vertices, const unsigned int *faces, unsigned int index)
 
template<typename T , class P >
void ContributeBinBuffer (BinBuffer *bins, const real3< T > &scene_min, const real3< T > &scene_max, unsigned int *indices, unsigned int left_idx, unsigned int right_idx, const P &p)
 
template<typename T >
SAH (size_t ns1, T leftArea, size_t ns2, T rightArea, T invS, T Taabb, T Ttri)
 
template<typename T >
bool FindCutFromBinBuffer (T *cut_pos, int *minCostAxis, const BinBuffer *bins, const real3< T > &bmin, const real3< T > &bmax, size_t num_primitives, T costTaabb)
 
template<typename T , class P >
void ComputeBoundingBox (real3< T > *bmin, real3< T > *bmax, const unsigned int *indices, unsigned int left_index, unsigned int right_index, const P &p)
 
template<typename T >
void GetBoundingBox (real3< T > *bmin, real3< T > *bmax, const std::vector< BBox< T > > &bboxes, unsigned int *indices, unsigned int left_index, unsigned int right_index)
 
template<typename T >
bool IntersectRayAABB (T *tminOut, T *tmaxOut, T min_t, T max_t, const T bmin[3], const T bmax[3], real3< T > ray_org, real3< T > ray_inv_dir, int ray_dir_sign[3])
 
template<>
bool IntersectRayAABB< float > (float *tminOut, float *tmaxOut, float min_t, float max_t, const float bmin[3], const float bmax[3], real3< float > ray_org, real3< float > ray_inv_dir, int ray_dir_sign[3])
 
template<>
bool IntersectRayAABB< double > (double *tminOut, double *tmaxOut, double min_t, double max_t, const double bmin[3], const double bmax[3], real3< double > ray_org, real3< double > ray_inv_dir, int ray_dir_sign[3])
 

Class Documentation

◆ nanort::TriangleIntersection

class nanort::TriangleIntersection
template<typename T = float>
class nanort::TriangleIntersection< T >

Definition at line 972 of file nanort.h.

+ Collaboration diagram for nanort::TriangleIntersection< T >:
Class Members
unsigned int prim_id
T t
T u
T v

Enumeration Type Documentation

◆ RayType

Enumerator
RAY_TYPE_NONE 
RAY_TYPE_PRIMARY 
RAY_TYPE_SECONDARY 
RAY_TYPE_DIFFUSE 
RAY_TYPE_REFLECTION 
RAY_TYPE_REFRACTION 

Definition at line 94 of file nanort.h.

Function Documentation

◆ CalculateSurfaceArea()

template<typename T >
T nanort::CalculateSurfaceArea ( const real3< T > &  min,
const real3< T > &  max 
)
inline

Definition at line 1216 of file nanort.h.

Referenced by FindCutFromBinBuffer().

+ Here is the caller graph for this function:

◆ ComputeBoundingBox()

template<typename T , class P >
void nanort::ComputeBoundingBox ( real3< T > *  bmin,
real3< T > *  bmax,
const unsigned int *  indices,
unsigned int  left_index,
unsigned int  right_index,
const P &  p 
)
inline

Definition at line 1553 of file nanort.h.

Referenced by nanort::BVHAccel< T >::Build(), and nanort::BVHAccel< T >::BuildTree().

+ Here is the caller graph for this function:

◆ ContributeBinBuffer()

template<typename T , class P >
void nanort::ContributeBinBuffer ( BinBuffer bins,
const real3< T > &  scene_min,
const real3< T > &  scene_max,
unsigned int *  indices,
unsigned int  left_idx,
unsigned int  right_idx,
const P &  p 
)
inline

Definition at line 1252 of file nanort.h.

References nanort::BinBuffer::bin, and nanort::BinBuffer::bin_size.

Referenced by nanort::BVHAccel< T >::BuildTree().

+ Here is the caller graph for this function:

◆ FindCutFromBinBuffer()

template<typename T >
bool nanort::FindCutFromBinBuffer ( T *  cut_pos,
int *  minCostAxis,
const BinBuffer bins,
const real3< T > &  bmin,
const real3< T > &  bmax,
size_t  num_primitives,
costTaabb 
)
inline

Definition at line 1334 of file nanort.h.

References nanort::BinBuffer::bin, nanort::BinBuffer::bin_size, CalculateSurfaceArea(), and SAH().

Referenced by nanort::BVHAccel< T >::BuildTree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_vertex_addr()

template<typename real >
const real * nanort::get_vertex_addr ( const real *  p,
const size_t  idx,
const size_t  stride_bytes 
)
inline

Definition at line 474 of file nanort.h.

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

+ Here is the caller graph for this function:

◆ GetBoundingBox()

template<typename T >
void nanort::GetBoundingBox ( real3< T > *  bmin,
real3< T > *  bmax,
const std::vector< BBox< T > > &  bboxes,
unsigned int *  indices,
unsigned int  left_index,
unsigned int  right_index 
)
inline

Definition at line 1577 of file nanort.h.

Referenced by nanort::BVHAccel< T >::BuildTree().

+ Here is the caller graph for this function:

◆ GetBoundingBoxOfTriangle()

template<typename T >
void nanort::GetBoundingBoxOfTriangle ( real3< T > *  bmin,
real3< T > *  bmax,
const T *  vertices,
const unsigned int *  faces,
unsigned int  index 
)
inline

Definition at line 1223 of file nanort.h.

◆ IntersectRayAABB()

template<typename T >
bool nanort::IntersectRayAABB ( T *  tminOut,
T *  tmaxOut,
min_t,
max_t,
const T  bmin[3],
const T  bmax[3],
real3< T >  ray_org,
real3< T >  ray_inv_dir,
int  ray_dir_sign[3] 
)
inline

Referenced by nanort::BVHAccel< T >::ListNodeIntersections(), and nanort::BVHAccel< T >::Traverse().

+ Here is the caller graph for this function:

◆ IntersectRayAABB< double >()

template<>
bool nanort::IntersectRayAABB< double > ( double tminOut,
double tmaxOut,
double  min_t,
double  max_t,
const double  bmin[3],
const double  bmax[3],
real3< double ray_org,
real3< double ray_inv_dir,
int  ray_dir_sign[3] 
)
inline

Definition at line 2344 of file nanort.h.

References safemax(), and safemin().

+ Here is the call graph for this function:

◆ IntersectRayAABB< float >()

template<>
bool nanort::IntersectRayAABB< float > ( float *  tminOut,
float *  tmaxOut,
float  min_t,
float  max_t,
const float  bmin[3],
const float  bmax[3],
real3< float >  ray_org,
real3< float >  ray_inv_dir,
int  ray_dir_sign[3] 
)
inline

Definition at line 2301 of file nanort.h.

References safemax(), and safemin().

+ Here is the call graph for this function:

◆ operator*()

template<typename T >
real3< T > nanort::operator* ( f,
const real3< T > &  v 
)
inline

Definition at line 373 of file nanort.h.

References nanort::real3< T >::x(), nanort::real3< T >::y(), and nanort::real3< T >::z().

+ Here is the call graph for this function:

◆ safemax()

template<class T >
const T & nanort::safemax ( const T &  a,
const T &  b 
)

Definition at line 1194 of file nanort.h.

Referenced by IntersectRayAABB< double >(), and IntersectRayAABB< float >().

+ Here is the caller graph for this function:

◆ safemin()

template<class T >
const T & nanort::safemin ( const T &  a,
const T &  b 
)

Definition at line 1190 of file nanort.h.

Referenced by IntersectRayAABB< double >(), and IntersectRayAABB< float >().

+ Here is the caller graph for this function:

◆ SAH()

template<typename T >
T nanort::SAH ( size_t  ns1,
leftArea,
size_t  ns2,
rightArea,
invS,
Taabb,
Ttri 
)
inline

Definition at line 1322 of file nanort.h.

Referenced by FindCutFromBinBuffer().

+ Here is the caller graph for this function:

◆ vcross()

template<typename T >
real3< T > nanort::vcross ( const real3< T >  a,
const real3< T >  b 
)
inline

Definition at line 401 of file nanort.h.

◆ vdot()

template<typename T >
T nanort::vdot ( const real3< T >  a,
const real3< T >  b 
)
inline

Definition at line 410 of file nanort.h.

◆ vlength()

template<typename T >
T nanort::vlength ( const real3< T > &  rhs)
inline

Definition at line 383 of file nanort.h.

References nanort::real3< T >::x(), nanort::real3< T >::y(), and nanort::real3< T >::z().

Referenced by vnormalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vneg()

template<typename T >
real3< T > nanort::vneg ( const real3< T > &  rhs)
inline

Definition at line 378 of file nanort.h.

References nanort::real3< T >::x(), nanort::real3< T >::y(), and nanort::real3< T >::z().

+ Here is the call graph for this function:

◆ vnormalize()

template<typename T >
real3< T > nanort::vnormalize ( const real3< T > &  rhs)
inline

Definition at line 388 of file nanort.h.

References nanort::real3< T >::v, and vlength().

+ Here is the call graph for this function:

◆ vsafe_inverse()

template<typename T >
real3< T > nanort::vsafe_inverse ( const real3< T >  v)
inline

Definition at line 415 of file nanort.h.

Referenced by nanort::BVHAccel< T >::ListNodeIntersections(), and nanort::BVHAccel< T >::Traverse().

+ Here is the caller graph for this function: