Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates simplex iterator and size access
Changes the index type for accessing simplex points to `std::size_t` for consistency and safety.

Adds `[[nodiscard]]` attribute to `size()` and iterator functions to signal potential misuse and enable static analysis.

These updates are part of the GJK algorithm implementation.
  • Loading branch information
orange-cpp committed Nov 9, 2025
commit 31cc1116ae73a4817b4e92b233b09be2dd2b4be7
8 changes: 4 additions & 4 deletions include/omath/collision/simplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ namespace omath::collision
m_size = std::min(m_size + 1, 4);
}

Vector3<float>& operator[](const int i)
Vector3<float>& operator[](const std::size_t i)
{
return m_points[i];
}
size_t size() const
[[nodiscard]] std::size_t size() const
{
return m_size;
}

auto begin() const
[[nodiscard]] auto begin() const
{
return m_points.begin();
}
auto end() const
[[nodiscard]] auto end() const
{
return m_points.end() - (4 - m_size);
}
Expand Down