Skip to content

Commit

Permalink
(update): adds missing toString method to AABB
Browse files Browse the repository at this point in the history
  • Loading branch information
wpumacay committed Oct 12, 2023
1 parent a9c28cb commit c270d21
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/math/utils/geometry_helpers.hpp
Expand Up @@ -153,6 +153,16 @@ struct AABB {
/// \param max The upper boundary point of this box
AABB(const Vec3& min, const Vec3& max) : p_min(min), p_max(max) {}

/// \brief Returns a string representation of this bounding box
auto toString() const -> std::string {
std::stringstream sstr_result;
sstr_result << "<AABB\n";
sstr_result << " min: " << p_min.toString() << "\n";
sstr_result << " max: " << p_max.toString() << "\n";
sstr_result << ">\n";
return sstr_result.str();
}

/// \brief Returns the center of this box
auto computeCenter() const -> Vec3 { return 0.5 * (p_min + p_max); }

Expand Down

0 comments on commit c270d21

Please sign in to comment.