Просмотр исходного кода

fixed example as per intel's instruction

Former-commit-id: 982c5e30923358e4bf86f9b31572fc8af0449dc9
Alec Jacobson (jalec 11 лет назад
Родитель
Сommit
767da595bb
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      examples/embree/example.cpp

+ 4 - 3
examples/embree/example.cpp

@@ -38,7 +38,7 @@ double bbd;
 // Faces
 Eigen::MatrixXi F;
 // Embree intersection structure
-igl::EmbreeIntersector<double,int> ei;
+igl::EmbreeIntersector<double,int> * ei;
 // Hits collected
 std::vector<igl::Hit > hits;
 // Ray information, "projection screen" corners
@@ -327,7 +327,7 @@ void mouse_move(int mouse_x, int mouse_y)
   // Shoot ray at unprojected mouse in view direction
   dir = d-s;
   int num_rays_shot;
-  ei.intersectRay(s,dir,hits,num_rays_shot);
+  ei->intersectRay(s,dir,hits,num_rays_shot);
   for(vector<igl::Hit>::iterator hit = hits.begin();
       hit != hits.end();
       hit++)
@@ -464,7 +464,7 @@ int main(int argc, char * argv[])
     V.colwise().minCoeff()).maxCoeff();
 
   // Init embree
-  ei = EmbreeIntersector<double,int>(V,F);
+  ei = new EmbreeIntersector<double,int>(V,F);
 
   // Init glut
   glutInit(&argc,argv);
@@ -478,5 +478,6 @@ int main(int argc, char * argv[])
   glutMotionFunc(mouse_drag);
   glutPassiveMotionFunc(mouse_move);
   glutMainLoop();
+  delete ei;
   return 0;
 }