i'm doing a ray cast test and i also need to know the triangle that has been hitten.
By looking in the LocalRayResult structure, i found that m_shapePart and m_triangleIndex (in the m_localShapeInfo pointer), contains some information about that.
So, i tried to write some code like this:
Code: Select all
btPrimitiveTriangle pt;
((const btGImpactMeshShapePart::TrimeshPrimitiveManager*)getMeshPart(m_shapePart)->getPrimitiveManager())->get_primitive_triangle(m_triangleIndex,pt);
By debugging the function, i noticed that the exception was thrown in the getVertex() function of the primitive manager, and i can't find a solution.
Is there anyway to obtain a trimesh triangle, by specifying the shape part and the triangle index?