6 #include <boost/optional.hpp>
20 #if defined LVR2_USE_OPENCL
23 #if defined LVR2_USE_EMBREE
27 using std::unique_ptr;
28 using std::make_unique;
55 MyIntType intersection;
57 if(rc->castRay(ray_origin, ray_dir, intersection))
59 std::cout <<
"Hit the mesh!" << std::endl;
60 std::cout << intersection << std::endl;
69 size_t num_rays = 100000;
73 std::vector<Vector3f> ray_dirs(num_rays, {1.0,0.0,0.0});
88 std::vector<MyIntType> intersections;
89 std::vector<uint8_t> hits;
92 rc->castRays(ray_origin, ray_dirs, intersections, hits);
96 std::cout <<
"Hit the mesh!" << std::endl;
97 std::cout << intersections.back() << std::endl;
106 size_t num_rays = 100000;
109 std::vector<Vector3f> ray_origins(num_rays, {0.0,0.0,0.0});
110 std::vector<Vector3f> ray_dirs(num_rays, {1.0,0.0,0.0});
126 std::vector<AllInt> intersections;
127 std::vector<uint8_t> hits;
130 rc->castRays(ray_origins, ray_dirs, intersections, hits);
134 std::cout <<
"Hit the mesh!" << std::endl;
135 std::cout << intersections.back() << std::endl;
141 std::cout <<
"1. Shoot a single ray onto a mesh" << std::endl;
143 std::cout <<
"2. Shoot rays contraining same origin" << std::endl;
145 std::cout <<
"3. Shoot multi rays" << std::endl;