16#ifndef IGL_EMBREE_EMBREE_INTERSECTOR_H
17#define IGL_EMBREE_EMBREE_INTERSECTOR_H
20#include <Eigen/Geometry>
23#include <embree4/rtcore.h>
24#include <embree4/rtcore_ray.h>
61 bool isStatic =
false);
73 const std::vector<const PointMatrixType*>& V,
74 const std::vector<const FaceMatrixType*>& F,
75 const std::vector<int>& masks,
76 bool isStatic =
false);
93 const Eigen::RowVector3f& origin,
94 const Eigen::RowVector3f& direction,
97 float tfar = std::numeric_limits<float>::infinity(),
98 int mask = 0xFFFFFFFF)
const;
114 const Eigen::RowVector3f& origin,
115 const Eigen::RowVector3f& direction,
118 float tfar = std::numeric_limits<float>::infinity(),
119 int mask = 0xFFFFFFFF,
121 bool closestHit =
true,
122 unsigned int samples = 4)
const;
135 const Eigen::RowVector3f& origin,
136 const Eigen::RowVector3f& direction,
140 float tfar = std::numeric_limits<float>::infinity(),
141 int mask = 0xFFFFFFFF)
const;
150 const Eigen::RowVector3f& a,
151 const Eigen::RowVector3f& ab,
153 int mask = 0xFFFFFFFF)
const;
169 float tfar = std::numeric_limits<float>::infinity(),
170 int mask = 0xFFFFFFFF)
const;
174 struct Vertex {
float x,y,z,a;};
175 struct Triangle {
int v0, v1, v2;};
187 const Eigen::RowVector3f& origin,
188 const Eigen::RowVector3f& direction,
196#ifndef IGL_STATIC_LIBRARY
197# include "EmbreeIntersector.cpp"
int signedIntersectionsRay(const OriginType &origin, const DirectionType &direction, float tnear=0.0f, float tfar=std::numeric_limits< float >::infinity(), int mask=0xFFFFFFFF) const
Signed ray-mesh crossing count along (origin, direction).
bool intersectRay(const Eigen::RowVector3f &origin, const Eigen::RowVector3f &direction, Hit< float > &hit, float tnear=0, float tfar=std::numeric_limits< float >::infinity(), int mask=0xFFFFFFFF) const
Given a ray find the first hit.
Eigen::RowVector3f DirectionType
Definition EmbreeIntersector.h:41
void deinit()
Deinitialize embree datasctructures for current mesh.
Eigen::Matrix< float, Eigen::Dynamic, 3 > PointMatrixType
Definition EmbreeIntersector.h:38
bool intersectRay(const Eigen::RowVector3f &origin, const Eigen::RowVector3f &direction, std::vector< Hit< float > > &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< float > &hit, int mask=0xFFFFFFFF) const
Given a ray find the first hit.
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.
bool intersectBeam(const Eigen::RowVector3f &origin, const Eigen::RowVector3f &direction, Hit< float > &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...
virtual ~EmbreeIntersector()
void init(const PointMatrixType &V, const FaceMatrixType &F, bool isStatic=false)
Initialize with a given mesh.
Eigen::RowVector3f OriginType
Definition EmbreeIntersector.h:40
Eigen::Matrix< int, Eigen::Dynamic, 3 > FaceMatrixType
Definition EmbreeIntersector.h:39
Definition ambient_occlusion.h:15
Reimplementation of the embree::Hit struct from embree1.0.
Definition Hit.h:18