TTK
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ttk::BoundingVolumeHierarchy< IT > Class Template Reference

Acceleration structure for native ray tracer. Based on implementation described in Physically Based Rendering: From Theory to Implementation by Matt Pharr, Wenzel Jakob and Greg Humphreys. More...

#include <BoundingVolumeHierarchy.h>

Classes

struct  Node
 
struct  Triangle
 

Public Member Functions

 BoundingVolumeHierarchy (const float *coords, const IT *connectivityList, const size_t &nTriangles)
 
 ~BoundingVolumeHierarchy ()=default
 
std::shared_ptr< NodebuildTree (std::vector< Triangle > &triangles, size_t start, size_t end)
 
int buildTriangleList (std::vector< Triangle > &triangles, const float *coords, const IT *connectivityList, const size_t &nTriangles)
 
bool MollerTrumbore (Ray &ray, const IT v0, const IT v1, const IT v2, const float *vertexCoords) const
 
bool intersect (Ray &r, const IT *connectivityList, const float *vertexCoords, int *triangleIndex, float *distance, std::vector< int > &triangles, std::vector< float > &distances, bool segmentIntersection=false) const
 
bool intersect (Ray &r, const IT *connectivityList, const float *vertexCoords, int *triangleIndex, float *distance, bool segmentIntersection=false) const
 
bool intersect (Ray &r, const IT *connectivityList, const float *vertexCoords, std::vector< int > &triangles, std::vector< float > &distances, bool segmentIntersection=false) const
 
bool wasNodeHit (const Ray &r, Node *n) const
 

Detailed Description

template<typename IT>
class ttk::BoundingVolumeHierarchy< IT >

Acceleration structure for native ray tracer. Based on implementation described in Physically Based Rendering: From Theory to Implementation by Matt Pharr, Wenzel Jakob and Greg Humphreys.

Author
Rosty Hnatyshyn rosty.nosp@m.slav.nosp@m..hnat.nosp@m.yshy.nosp@m.n@gma.nosp@m.il.c.nosp@m.om
Date
10.11.2020

Definition at line 24 of file BoundingVolumeHierarchy.h.

Constructor & Destructor Documentation

◆ BoundingVolumeHierarchy()

template<typename IT >
ttk::BoundingVolumeHierarchy< IT >::BoundingVolumeHierarchy ( const float *  coords,
const IT *  connectivityList,
const size_t &  nTriangles 
)
inline

Definition at line 97 of file BoundingVolumeHierarchy.h.

◆ ~BoundingVolumeHierarchy()

template<typename IT >
ttk::BoundingVolumeHierarchy< IT >::~BoundingVolumeHierarchy ( )
default

Member Function Documentation

◆ buildTree()

template<typename IT >
std::shared_ptr< Node > ttk::BoundingVolumeHierarchy< IT >::buildTree ( std::vector< Triangle > &  triangles,
size_t  start,
size_t  end 
)
inline

Definition at line 109 of file BoundingVolumeHierarchy.h.

◆ buildTriangleList()

template<typename IT >
int ttk::BoundingVolumeHierarchy< IT >::buildTriangleList ( std::vector< Triangle > &  triangles,
const float *  coords,
const IT *  connectivityList,
const size_t &  nTriangles 
)
inline

Definition at line 207 of file BoundingVolumeHierarchy.h.

◆ intersect() [1/3]

template<typename IT >
bool ttk::BoundingVolumeHierarchy< IT >::intersect ( Ray r,
const IT *  connectivityList,
const float *  vertexCoords,
int *  triangleIndex,
float *  distance,
bool  segmentIntersection = false 
) const
inline

Definition at line 341 of file BoundingVolumeHierarchy.h.

◆ intersect() [2/3]

template<typename IT >
bool ttk::BoundingVolumeHierarchy< IT >::intersect ( Ray r,
const IT *  connectivityList,
const float *  vertexCoords,
int *  triangleIndex,
float *  distance,
std::vector< int > &  triangles,
std::vector< float > &  distances,
bool  segmentIntersection = false 
) const
inline

Definition at line 280 of file BoundingVolumeHierarchy.h.

◆ intersect() [3/3]

template<typename IT >
bool ttk::BoundingVolumeHierarchy< IT >::intersect ( Ray r,
const IT *  connectivityList,
const float *  vertexCoords,
std::vector< int > &  triangles,
std::vector< float > &  distances,
bool  segmentIntersection = false 
) const
inline

Definition at line 353 of file BoundingVolumeHierarchy.h.

◆ MollerTrumbore()

template<typename IT >
bool ttk::BoundingVolumeHierarchy< IT >::MollerTrumbore ( Ray ray,
const IT  v0,
const IT  v1,
const IT  v2,
const float *  vertexCoords 
) const
inline

Definition at line 243 of file BoundingVolumeHierarchy.h.

◆ wasNodeHit()

template<typename IT >
bool ttk::BoundingVolumeHierarchy< IT >::wasNodeHit ( const Ray r,
Node n 
) const
inline

Definition at line 365 of file BoundingVolumeHierarchy.h.


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