Math/Box,Rect: Add GetCorners method

This commit is contained in:
SirLynix
2023-08-13 18:14:22 +02:00
parent 5a299da930
commit 28d69ab552
4 changed files with 30 additions and 0 deletions

View File

@@ -250,6 +250,17 @@ namespace Nz
return Vector2<T>();
}
template<typename T>
constexpr EnumArray<RectCorner, Vector2<T>> Rect<T>::GetCorners() const
{
return {
GetCorner(Nz::BoxCorner::LeftBottom),
GetCorner(Nz::BoxCorner::LeftTop),
GetCorner(Nz::BoxCorner::RightBottom),
GetCorner(Nz::BoxCorner::RightTop)
};
}
/*!
* \brief Gets a Vector2 for the lengths
* \return The lengths of the rectangle (width, height)