Simple class to wrap Embree's ray tracing functionality.
More...
#include <EmbreeIntersector.h>
|
| EmbreeIntersector () |
|
virtual | ~EmbreeIntersector () |
|
void | init (const PointMatrixType &V, const FaceMatrixType &F, bool isStatic=false) |
| Initialize with a given mesh.
|
|
void | init (const std::vector< const PointMatrixType * > &V, const std::vector< const FaceMatrixType * > &F, const std::vector< int > &masks, bool isStatic=false) |
| Initialize with a given mesh.
|
|
void | deinit () |
| Deinitialize embree datasctructures for current mesh.
|
|
bool | intersectRay (const Eigen::RowVector3f &origin, const Eigen::RowVector3f &direction, Hit &hit, float tnear=0, float tfar=std::numeric_limits< float >::infinity(), int mask=0xFFFFFFFF) const |
| Given a ray find the first hit.
|
|
bool | intersectBeam (const Eigen::RowVector3f &origin, const Eigen::RowVector3f &direction, Hit &hit, float tnear=0, float tfar=std::numeric_limits< float >::infinity(), int mask=0xFFFFFFFF, int geoId=-1, bool closestHit=true, unsigned int samples=4) const |
| Given a ray find the first hit This is a conservative hit test where multiple rays within a small radius will be tested and only the closesest hit is returned.
|
|
bool | intersectRay (const Eigen::RowVector3f &origin, const Eigen::RowVector3f &direction, std::vector< Hit > &hits, int &num_rays, float tnear=0, float tfar=std::numeric_limits< float >::infinity(), int mask=0xFFFFFFFF) const |
| Given a ray find all hits in order.
|
|
bool | intersectSegment (const Eigen::RowVector3f &a, const Eigen::RowVector3f &ab, Hit &hit, int mask=0xFFFFFFFF) const |
| Given a ray find the first hit.
|
|
Simple class to wrap Embree's ray tracing functionality.
◆ PointMatrixType
◆ FaceMatrixType
◆ EmbreeIntersector()
igl::embree::EmbreeIntersector::EmbreeIntersector |
( |
| ) |
|
◆ ~EmbreeIntersector()
virtual igl::embree::EmbreeIntersector::~EmbreeIntersector |
( |
| ) |
|
|
virtual |
◆ init() [1/2]
Initialize with a given mesh.
- Parameters
-
[in] | V | #V by 3 list of vertex positions |
[in] | F | #F by 3 list of Oriented triangles |
[in] | isStatic | scene is optimized for static geometry |
Side effects:
The first time this is ever called the embree engine is initialized.
◆ init() [2/2]
void igl::embree::EmbreeIntersector::init |
( |
const std::vector< const PointMatrixType * > & |
V, |
|
|
const std::vector< const FaceMatrixType * > & |
F, |
|
|
const std::vector< int > & |
masks, |
|
|
bool |
isStatic = false |
|
) |
| |
Initialize with a given mesh.
- Parameters
-
[in] | V | vector of #V by 3 list of vertex positions for each geometry |
[in] | F | vector of #F by 3 list of Oriented triangles for each geometry |
[in] | masks | a 32 bit mask to identify active geometries. |
[in] | isStatic | scene is optimized for static geometry |
Side effects:
The first time this is ever called the embree engine is initialized.
◆ deinit()
void igl::embree::EmbreeIntersector::deinit |
( |
| ) |
|
Deinitialize embree datasctructures for current mesh.
Also called on destruction: no need to call if you just want to init() once and destroy.
◆ intersectRay() [1/2]
bool igl::embree::EmbreeIntersector::intersectRay |
( |
const Eigen::RowVector3f & |
origin, |
|
|
const Eigen::RowVector3f & |
direction, |
|
|
Hit & |
hit, |
|
|
float |
tnear = 0 , |
|
|
float |
tfar = std::numeric_limits< float >::infinity() , |
|
|
int |
mask = 0xFFFFFFFF |
|
) |
| const |
Given a ray find the first hit.
- Parameters
-
[in] | origin | 3d origin point of ray |
[in] | direction | 3d (not necessarily normalized) direction vector of ray |
[in] | tnear | start of ray segment |
[in] | tfar | end of ray segment |
[in] | masks | a 32 bit mask to identify active geometries. |
[out] | hit | information about hit |
- Returns
- true if and only if there was a hit
◆ intersectBeam()
bool igl::embree::EmbreeIntersector::intersectBeam |
( |
const Eigen::RowVector3f & |
origin, |
|
|
const Eigen::RowVector3f & |
direction, |
|
|
Hit & |
hit, |
|
|
float |
tnear = 0 , |
|
|
float |
tfar = std::numeric_limits< float >::infinity() , |
|
|
int |
mask = 0xFFFFFFFF , |
|
|
int |
geoId = -1 , |
|
|
bool |
closestHit = true , |
|
|
unsigned int |
samples = 4 |
|
) |
| const |
Given a ray find the first hit This is a conservative hit test where multiple rays within a small radius will be tested and only the closesest hit is returned.
- Parameters
-
[in] | origin | 3d origin point of ray |
[in] | direction | 3d (not necessarily normalized) direction vector of ray |
[in] | tnear | start of ray segment |
[in] | tfar | end of ray segment |
[in] | masks | a 32 bit mask to identify active geometries. |
[in] | geoId | id of geometry mask (default std::numeric_limits<float>::infinity() if no: no masking) |
[in] | closestHit | true for gets closest hit, false for furthest hit |
[out] | hit | information about hit |
- Returns
- true if and only if there was a hit
◆ intersectRay() [2/2]
bool igl::embree::EmbreeIntersector::intersectRay |
( |
const Eigen::RowVector3f & |
origin, |
|
|
const Eigen::RowVector3f & |
direction, |
|
|
std::vector< Hit > & |
hits, |
|
|
int & |
num_rays, |
|
|
float |
tnear = 0 , |
|
|
float |
tfar = std::numeric_limits< float >::infinity() , |
|
|
int |
mask = 0xFFFFFFFF |
|
) |
| const |
Given a ray find all hits in order.
- Parameters
-
[in] | origin | 3d origin point of ray |
[in] | direction | 3d (not necessarily normalized) direction vector of ray |
[in] | tnear | start of ray segment |
[in] | tfar | end of ray segment |
[in] | masks | a 32 bit mask to identify active geometries. |
[out] | hit | information about hit |
[out] | num_rays | number of rays shot (at least one) |
- Returns
- true if and only if there was a hit
◆ intersectSegment()
bool igl::embree::EmbreeIntersector::intersectSegment |
( |
const Eigen::RowVector3f & |
a, |
|
|
const Eigen::RowVector3f & |
ab, |
|
|
Hit & |
hit, |
|
|
int |
mask = 0xFFFFFFFF |
|
) |
| const |
Given a ray find the first hit.
- Parameters
-
[in] | a | 3d first end point of segment |
[in] | ab | 3d vector from a to other endpoint b |
[out] | hit | information about hit |
- Returns
- true if and only if there was a hit
The documentation for this class was generated from the following file: