Skip to content

Commit

Permalink
Pass AABB by const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
catinjar committed Dec 6, 2021
1 parent 465de41 commit d05b5df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AABB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool AABB::Hit(const Ray &ray, float minT, float maxT) const
return true;
}

AABB SurroundingBox(AABB box1, AABB box2)
AABB SurroundingBox(const AABB& box1, const AABB& box2)
{
const Vector3 min(std::min(box1.min.x, box2.min.x), std::min(box1.min.y, box2.min.y), std::min(box1.min.z, box2.min.z));
const Vector3 max(std::max(box1.max.x, box2.max.x), std::max(box1.max.y, box2.max.y), std::max(box1.max.z, box2.max.z));
Expand Down
2 changes: 1 addition & 1 deletion src/AABB.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ class AABB
Vector3 max;
};

AABB SurroundingBox(AABB box1, AABB box2);
AABB SurroundingBox(const AABB& box1, const AABB& box2);

0 comments on commit d05b5df

Please sign in to comment.