EmbreeIntersector.h 799 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef EMBREE_INTERSECTOR_H
  2. #define EMBREE_INTERSECTOR_H
  3. #undef interface
  4. #undef near
  5. #undef far
  6. #include "common/intersector.h"
  7. #include "common/accel.h"
  8. //#include "types.h"
  9. template <
  10. typename PointMatrixType,
  11. typename FaceMatrixType,
  12. typename RowVector3>
  13. class EmbreeIntersector
  14. {
  15. public:
  16. EmbreeIntersector(const PointMatrixType & V, const FaceMatrixType & F);
  17. virtual ~EmbreeIntersector();
  18. bool intersectRay(const RowVector3& origin, const RowVector3& direction, embree::Hit &hit) const;
  19. bool intersectSegment(const RowVector3& a, const RowVector3& ab, embree::Hit &hit) const;
  20. private:
  21. embree::BuildTriangle *triangles;
  22. embree::BuildVertex *vertices;
  23. embree::Ref<embree::Accel> _accel;
  24. embree::Ref<embree::Intersector> _intersector;
  25. };
  26. #endif //EMBREE_INTERSECTOR_H