Fix performance bottleneck in IGL

This commit is contained in:
tamasmeszaros 2019-08-16 13:55:39 +02:00
parent dac301e3b6
commit eba8c39846
2 changed files with 17 additions and 15 deletions

View file

@ -29,7 +29,9 @@ IGL_INLINE bool igl::ray_mesh_intersect(
// Should be but can't be const
Vector3d s_d = s.template cast<double>();
Vector3d dir_d = dir.template cast<double>();
hits.clear();
hits.clear();
hits.reserve(F.rows());
// loop over all triangles
for(int f = 0;f<F.rows();f++)
{