Calculates penetration vector for EPA algorithm

Adds `penetration_vector` to the `epa_result` struct to represent the direction and magnitude of penetration.

This allows for more accurate collision response calculations and simplifies access to penetration information.

Updates both the early-exit and iterative EPA calculations within `epa_algorithm.hpp` to compute and store the penetration vector, factoring in the relative origin of the colliding meshes.
This commit is contained in:
2025-11-13 21:19:09 +03:00
parent a5b24f90dc
commit 12f888b8d4
2 changed files with 16 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ namespace omath::collision
return m_mesh.vertex_to_world_space(find_furthest_vertex(direction));
}
[[nodiscard]]
const VertexType& get_origin() const
{
return m_mesh.get_origin();
}
private:
MeshType m_mesh;
};