mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Refactors EPA algorithm loop
Replaces the `for(;;)` loop in the EPA algorithm with a `while(true)` loop for improved readability and clarity. This change enhances the maintainability of the code without altering its functionality.
This commit is contained in:
@@ -11,7 +11,8 @@
|
|||||||
namespace omath::collision
|
namespace omath::collision
|
||||||
{
|
{
|
||||||
template<class V>
|
template<class V>
|
||||||
concept EpaVector = requires(const V& a, const V& b, float s) {
|
concept EpaVector = requires(const V& a, const V& b, float s)
|
||||||
|
{
|
||||||
{ a - b } -> std::same_as<V>;
|
{ a - b } -> std::same_as<V>;
|
||||||
{ a.cross(b) } -> std::same_as<V>;
|
{ a.cross(b) } -> std::same_as<V>;
|
||||||
{ a.dot(b) } -> std::same_as<float>;
|
{ a.dot(b) } -> std::same_as<float>;
|
||||||
@@ -280,7 +281,7 @@ namespace omath::collision
|
|||||||
simplex.push_front(support);
|
simplex.push_front(support);
|
||||||
auto direction = -support;
|
auto direction = -support;
|
||||||
|
|
||||||
for (;;)
|
while (true)
|
||||||
{
|
{
|
||||||
support = find_support_vertex(a, b, direction);
|
support = find_support_vertex(a, b, direction);
|
||||||
if (support.dot(direction) <= 0.f)
|
if (support.dot(direction) <= 0.f)
|
||||||
|
|||||||
Reference in New Issue
Block a user