Feature/more constexpr (#125)

* added constexpr

* fix

* improved stuff

* added const

* improvement

* fix

* fix

* patch
This commit is contained in:
2025-12-24 02:32:14 +03:00
committed by GitHub
parent 897484bea1
commit d935caf1a4
36 changed files with 543 additions and 399 deletions

View File

@@ -9,7 +9,8 @@ using Vector3f = omath::Vector3<float>;
struct DummyCollider
{
using VectorType = Vector3f;
VectorType find_abs_furthest_vertex_position(const VectorType& dir) const noexcept
[[nodiscard]]
static VectorType find_abs_furthest_vertex_position(const VectorType& dir) noexcept
{
// map direction to a small point so support_point is finite
return Vector3f{dir.x * 0.01f, dir.y * 0.01f, dir.z * 0.01f};
@@ -25,12 +26,13 @@ TEST(EpaInternal, SolveHandlesSmallPolytope)
Simplex s;
s = { Vector3f{0.01f, 0.f, 0.f}, Vector3f{0.f, 0.01f, 0.f}, Vector3f{0.f, 0.f, 0.01f}, Vector3f{-0.01f, -0.01f, -0.01f} };
DummyCollider a, b;
constexpr DummyCollider a;
constexpr DummyCollider b;
EpaDummy::Params params;
params.max_iterations = 16;
params.tolerance = 1e-6f;
auto result = EpaDummy::solve(a, b, s, params);
const auto result = EpaDummy::solve(a, b, s, params);
// Should either return a valid result or gracefully return nullopt
if (result)