diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2022-07-11 09:08:45 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2022-07-11 09:08:45 +0200 |
| commit | 13acb0321b5f2ed392c94e1f7c64069d4242971a (patch) | |
| tree | e9ff2719e12eef14925cf2d26201a27d6efd27d7 /include/aabb.hpp | |
| parent | 9cde4d53339a86404c8cf073f4a30c6ebb0acc37 (diff) | |
Refactor bvh file
Diffstat (limited to 'include/aabb.hpp')
| -rw-r--r-- | include/aabb.hpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/include/aabb.hpp b/include/aabb.hpp index dcab8c9..ca6e84a 100644 --- a/include/aabb.hpp +++ b/include/aabb.hpp @@ -17,14 +17,8 @@ class aabb { auto &v2 = tri.p2;
auto &v3 = tri.p3;
- // TODO: Use vector 3 functions
- minimum.v[0] = fmin(fmin(v1.v[0], v2.v[0]), v3.v[0]);
- minimum.v[1] = fmin(fmin(v1.v[1], v2.v[1]), v3.v[1]);
- minimum.v[2] = fmin(fmin(v1.v[2], v2.v[2]), v3.v[2]);
-
- maximum.v[0] = fmax(fmax(v1.v[0], v2.v[0]), v3.v[0]);
- maximum.v[1] = fmax(fmax(v1.v[1], v2.v[1]), v3.v[1]);
- maximum.v[2] = fmax(fmax(v1.v[2], v2.v[2]), v3.v[2]);
+ minimum = v1.min(v2.min(v3));
+ maximum = v1.max(v2.max(v3));
}
void union_with(const aabb &box) {
|
