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

@@ -66,18 +66,18 @@ TEST(CollisionExtra, EPAConvergesOnSimpleCase)
std::vector<omath::primitives::Vertex<>>{{ {0.f,0.f,0.f}, {}, {} }, { {1.f,0.f,0.f}, {}, {} } },
{}
};
omath::source_engine::Mesh meshB = meshA;
meshB.set_origin({0.5f, 0.f, 0.f}); // translate to overlap
omath::source_engine::Mesh mesh_b = meshA;
mesh_b.set_origin({0.5f, 0.f, 0.f}); // translate to overlap
omath::source_engine::MeshCollider A(meshA);
omath::source_engine::MeshCollider B(meshB);
omath::source_engine::MeshCollider a(meshA);
omath::source_engine::MeshCollider b(mesh_b);
// Create a simplex that approximately contains the origin in Minkowski space
Simplex<omath::Vector3<float>> simplex;
simplex = { omath::Vector3<float>{0.5f,0.f,0.f}, omath::Vector3<float>{-0.5f,0.f,0.f}, omath::Vector3<float>{0.f,0.5f,0.f}, omath::Vector3<float>{0.f,-0.5f,0.f} };
auto pool = std::pmr::monotonic_buffer_resource(1024);
auto res = Epa<omath::source_engine::MeshCollider>::solve(A, B, simplex, {}, pool);
auto res = Epa<omath::source_engine::MeshCollider>::solve(a, b, simplex, {}, pool);
// EPA may or may not converge depending on numerics; ensure it returns optionally
// but if it does, fields should be finite
if (res.has_value())