mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-25 18:03:27 +00:00
keeping 1 AABB type
This commit is contained in:
@@ -12,5 +12,17 @@ namespace omath::primitives
|
||||
{
|
||||
Vector3<Type> min;
|
||||
Vector3<Type> max;
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector3<Type> center() const noexcept
|
||||
{
|
||||
return (min + max) / static_cast<Type>(2);
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr Vector3<Type> extents() const noexcept
|
||||
{
|
||||
return (max - min) / static_cast<Type>(2);
|
||||
}
|
||||
};
|
||||
} // namespace omath::primitives
|
||||
|
||||
Reference in New Issue
Block a user