Issue:
The documentation in mesh.h maybe wrong, or the documentation is correct and the chosen type (MatrixX&, Reference Type) is wrong. References can't be null by the C++ standard, and if they are this may lead to undefined behaviour.
See https://en.cppreference.com/w/cpp/language/reference_initialization and https://en.cppreference.com/w/cpp/language/reference
How to reproduce the bug:
`
const auto m_N(lRec.mesh->getVertexNormals());
std::cout << m_N(0) << std::endl;
return { 0.0f };
`
This crashes with an AccessViolationException@NULL, which can't or shouldn't happen with references, since they can't be null.
Solution:
Change the reference to a ptr type (MatrixX*) or change the MatrixX to be an empty matrix and provide a function to check whether normals exist (bool hasVertexNormals() for instance).
Issue:
The documentation in mesh.h maybe wrong, or the documentation is correct and the chosen type (MatrixX&, Reference Type) is wrong. References can't be null by the C++ standard, and if they are this may lead to undefined behaviour.
See https://en.cppreference.com/w/cpp/language/reference_initialization and https://en.cppreference.com/w/cpp/language/reference
How to reproduce the bug:
`
`
This crashes with an AccessViolationException@NULL, which can't or shouldn't happen with references, since they can't be null.
Solution:
Change the reference to a ptr type (MatrixX*) or change the MatrixX to be an empty matrix and provide a function to check whether normals exist (bool hasVertexNormals() for instance).