Skip to content

Commit

Permalink
Adds IsFor convenience function for Contactable
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-langholtz committed Oct 7, 2023
1 parent a5436f7 commit 67a3b1e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Library/include/playrho/Contactable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ constexpr bool operator!=(const Contactable& lhs, const Contactable& rhs) noexce
return !(lhs == rhs);
}

/// @brief Is-for convenience function.
/// @return true if contactable is for the identified body and shape, else false.
constexpr bool IsFor(const Contactable& c, BodyID bodyID, ShapeID shapeID) noexcept
{
return (c.bodyId == bodyID) && (c.shapeId == shapeID);
}

}

#endif /* PLAYRHO_CONTACTABLE_HPP */

0 comments on commit 67a3b1e

Please sign in to comment.