EigenMesh3D does not store a copy of the mesh

Instead, it stores a pointer to extern TriangleMesh (which must not be destroyed before the EigenMesh3D object)
This commit is contained in:
Lukas Matena 2020-05-23 13:54:41 +02:00
parent 1f833921a2
commit 55395e046f
4 changed files with 51 additions and 19 deletions

View file

@ -104,8 +104,8 @@ private:
// whether certain points are visible or obscured by the mesh etc.
class MeshRaycaster {
public:
// The class makes a copy of the mesh as EigenMesh3D.
// The pointer can be invalidated after constructor returns.
// The class references extern TriangleMesh, which must stay alive
// during MeshRaycaster existence.
MeshRaycaster(const TriangleMesh& mesh)
: m_emesh(mesh)
{