added collider interface

This commit is contained in:
2025-12-06 13:34:34 +03:00
parent e97be8c142
commit e05eba42c3
9 changed files with 118 additions and 43 deletions

View File

@@ -17,14 +17,15 @@ namespace omath::collision
template<class ColliderType>
class GjkAlgorithm final
{
using VertexType = ColliderType::VertexType;
using VectorType = VertexType::VectorType;
using VectorType = ColliderType::VectorType;
public:
[[nodiscard]]
static VectorType find_support_vertex(const ColliderType& collider_a, const ColliderType& collider_b,
const VectorType& direction)
{
return collider_a.find_abs_furthest_vertex(direction).position - collider_b.find_abs_furthest_vertex(-direction).position;
return collider_a.find_abs_furthest_vertex_position(direction)
- collider_b.find_abs_furthest_vertex_position(-direction);
}
[[nodiscard]]