We make sure that good values are passed to GetPolygon() and checking that the visual mesh doesn't have a wrong displacement when it pass over a object that it has as compound bound a mesh triangle.
It seems that with triangle mesh selected as compound bounds and under "certain conditions" when we do glTranslated(resultpoint,resultpoint,resultpoint); the object that projects the shadow is translated to the hitting point of the projected shadow.
If we use glTranslated(oglmatrix,oglmatrix,oglmatrix); we will ensure that we will translate the object to the object position.
Anyway, I have tried to reproduce the bug from a new blend file (copying mesh positions, physics attributes, etc) and I weren't able to do it. Then, is it possible that the mesh in the bug file is corrupted or damaged? Here is the new filethat i did and the bug file
I'm not familiar with this code so I'm not sure why we get a hit reported without having a mesh, I guess this is intentional?
Doing the check to prevent the crash should be fine then, but maybe it's better to test for m_hitMesh?