Commit 645ba9e0 authored by Philip Trettner's avatar Philip Trettner
Browse files

Merge branch 'develop' of...

Merge branch 'develop' of https://www.graphics.rwth-aachen.de:9000/ptrettner/typed-geometry into develop
parents e42136c0 6c6f84ef
......@@ -71,6 +71,21 @@ struct aabb
{
}
template <class OtherT>
constexpr aabb(pos<D, OtherT> min, size<D, OtherT> size) : min(min)
{
for (auto i = 0; i < D; ++i)
TG_CONTRACT(ScalarT(size[i]) >= ScalarT(0));
this->max.x = ScalarT(min.x + size.width);
if constexpr (D >= 2)
this->max.y = ScalarT(min.y + size.height);
if constexpr (D >= 3)
this->max.z = ScalarT(min.z + size.depth);
if constexpr (D >= 4)
this->max.w = ScalarT(min.w + size.w);
}
[[nodiscard]] constexpr pos_t operator[](tg::comp<D, ScalarT> const& c) const;
[[nodiscard]] bool operator==(aabb const& rhs) const { return min == rhs.min && max == rhs.max; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment