16#ifndef IGL_EMBREE_EMBREE_INTERSECTOR_H 
   17#define IGL_EMBREE_EMBREE_INTERSECTOR_H 
   20#include <Eigen/Geometry> 
   23#include <embree3/rtcore.h> 
   24#include <embree3/rtcore_ray.h> 
   59        bool isStatic = 
false);
 
   71        const std::vector<const PointMatrixType*>& V,
 
   72        const std::vector<const FaceMatrixType*>& F,
 
   73        const std::vector<int>& masks,
 
   74        bool isStatic = 
false);
 
   91        const Eigen::RowVector3f& origin,
 
   92        const Eigen::RowVector3f& direction,
 
   95        float tfar = std::numeric_limits<float>::infinity(),
 
   96        int mask = 0xFFFFFFFF) 
const;
 
  112        const Eigen::RowVector3f& origin,
 
  113        const Eigen::RowVector3f& direction,
 
  116        float tfar = std::numeric_limits<float>::infinity(),
 
  117        int mask = 0xFFFFFFFF,
 
  119        bool closestHit = 
true,
 
  120        unsigned int samples = 4) 
const;
 
  133        const Eigen::RowVector3f& origin,
 
  134        const Eigen::RowVector3f& direction,
 
  135        std::vector<Hit > &hits,
 
  138        float tfar = std::numeric_limits<float>::infinity(),
 
  139        int mask = 0xFFFFFFFF) 
const;
 
  148        const Eigen::RowVector3f& a,
 
  149        const Eigen::RowVector3f& ab,
 
  151        int mask = 0xFFFFFFFF) 
const;
 
  155      struct Vertex   {
float x,y,z,a;};
 
  156      struct Triangle {
int v0, v1, v2;};
 
  168        const Eigen::RowVector3f& origin,
 
  169        const Eigen::RowVector3f& direction,
 
 
  177#ifndef IGL_STATIC_LIBRARY 
  178#  include "EmbreeIntersector.cpp" 
Simple class to wrap Embree's ray tracing functionality.
Definition EmbreeIntersector.h:36
 
bool intersectSegment(const Eigen::RowVector3f &a, const Eigen::RowVector3f &ab, Hit &hit, 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 rad...
 
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.
 
Eigen::Matrix< float, Eigen::Dynamic, 3 > PointMatrixType
Definition EmbreeIntersector.h:38
 
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.
 
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.
 
virtual ~EmbreeIntersector()
 
void init(const PointMatrixType &V, const FaceMatrixType &F, bool isStatic=false)
Initialize with a given mesh.
 
Eigen::Matrix< int, Eigen::Dynamic, 3 > FaceMatrixType
Definition EmbreeIntersector.h:39
 
Reimplementation of the embree::Hit struct from embree1.0.
Definition Hit.h:18