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

@@ -309,6 +309,21 @@ namespace Nz
return Vector3<T>();
}
template<typename T>
constexpr EnumArray<BoxCorner, Vector3<T>> Box<T>::GetCorners() const
{
return {
GetCorner(Nz::BoxCorner::FarLeftBottom),
GetCorner(Nz::BoxCorner::FarLeftTop),
GetCorner(Nz::BoxCorner::FarRightBottom),
GetCorner(Nz::BoxCorner::FarRightTop),
GetCorner(Nz::BoxCorner::NearLeftBottom),
GetCorner(Nz::BoxCorner::NearLeftTop),
GetCorner(Nz::BoxCorner::NearRightBottom),
GetCorner(Nz::BoxCorner::NearRightTop)
};
}
/*!
* \brief Gets a Vector3 for the lengths
* \return The lengths of the box (width, height, depth)