Minor fixes

This commit is contained in:
SirLynix 2023-08-25 17:14:33 +02:00
parent 5b9f79a554
commit 627400f4f2
3 changed files with 13 additions and 28 deletions

View File

@ -313,14 +313,14 @@ namespace Nz
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)
GetCorner(BoxCorner::FarLeftBottom),
GetCorner(BoxCorner::FarLeftTop),
GetCorner(BoxCorner::FarRightBottom),
GetCorner(BoxCorner::FarRightTop),
GetCorner(BoxCorner::NearLeftBottom),
GetCorner(BoxCorner::NearLeftTop),
GetCorner(BoxCorner::NearRightBottom),
GetCorner(BoxCorner::NearRightTop)
};
}
@ -691,19 +691,6 @@ namespace Nz
return lhs.ApproxEqual(rhs, maxDifference);
}
/*!
* \brief Interpolates the box to other one with a factor of interpolation
* \return A new box which is the interpolation of two rectangles
*
* \param from Initial box
* \param to Target box
* \param interpolation Factor of interpolation
*
* \remark interpolation is meant to be between 0 and 1, other values are potentially undefined behavior
* \remark With NAZARA_DEBUG, a NazaraError is thrown and Zero() is returned
*
* \see Lerp
*/
template<typename T>
constexpr Box<T> Box<T>::FromExtends(const Vector3<T>& vec1, const Vector3<T>& vec2)
{

View File

@ -254,10 +254,10 @@ namespace Nz
constexpr EnumArray<RectCorner, Vector2<T>> Rect<T>::GetCorners() const
{
return {
GetCorner(Nz::RectCorner::LeftBottom),
GetCorner(Nz::RectCorner::LeftTop),
GetCorner(Nz::RectCorner::RightBottom),
GetCorner(Nz::RectCorner::RightTop)
GetCorner(RectCorner::LeftBottom),
GetCorner(RectCorner::LeftTop),
GetCorner(RectCorner::RightBottom),
GetCorner(RectCorner::RightTop)
};
}

View File

@ -28,9 +28,7 @@ namespace Nz
inline void DebugDrawer::DrawFrustum(const Frustumf& frustum, const Color& color)
{
EnumArray<BoxCorner, Vector3f> corners;
for (auto&& [corner, pos] : corners.iter_kv())
pos = frustum.ComputeCorner(corner);
EnumArray<BoxCorner, Vector3f> corners = frustum.ComputeCorners();
DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearRightBottom], color);
DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearLeftTop], color);