Skip to content
Snippets Groups Projects
Commit 1fe5504f authored by Tom Fischer's avatar Tom Fischer
Browse files

[GL] AABB: signal if the axis aligned bounding box is updated.

parent 0cab0ace
No related branches found
No related tags found
No related merge requests found
...@@ -86,14 +86,20 @@ public: ...@@ -86,14 +86,20 @@ public:
} }
} }
void update(PNT_TYPE const & pnt) bool update(PNT_TYPE const & pnt)
{ {
bool updated(false);
for (std::size_t k(0); k<3; k++) { for (std::size_t k(0); k<3; k++) {
if (pnt[k] < _min_pnt[k]) if (pnt[k] < _min_pnt[k]) {
_min_pnt[k] = pnt[k]; _min_pnt[k] = pnt[k];
if (_max_pnt[k] < pnt[k]) updated = true;
}
if (_max_pnt[k] < pnt[k]) {
_max_pnt[k] = pnt[k]; _max_pnt[k] = pnt[k];
updated = true;
}
} }
return updated;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment