Minor fixes
This commit is contained in:
parent
5b9f79a554
commit
627400f4f2
|
|
@ -313,14 +313,14 @@ namespace Nz
|
||||||
constexpr EnumArray<BoxCorner, Vector3<T>> Box<T>::GetCorners() const
|
constexpr EnumArray<BoxCorner, Vector3<T>> Box<T>::GetCorners() const
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
GetCorner(Nz::BoxCorner::FarLeftBottom),
|
GetCorner(BoxCorner::FarLeftBottom),
|
||||||
GetCorner(Nz::BoxCorner::FarLeftTop),
|
GetCorner(BoxCorner::FarLeftTop),
|
||||||
GetCorner(Nz::BoxCorner::FarRightBottom),
|
GetCorner(BoxCorner::FarRightBottom),
|
||||||
GetCorner(Nz::BoxCorner::FarRightTop),
|
GetCorner(BoxCorner::FarRightTop),
|
||||||
GetCorner(Nz::BoxCorner::NearLeftBottom),
|
GetCorner(BoxCorner::NearLeftBottom),
|
||||||
GetCorner(Nz::BoxCorner::NearLeftTop),
|
GetCorner(BoxCorner::NearLeftTop),
|
||||||
GetCorner(Nz::BoxCorner::NearRightBottom),
|
GetCorner(BoxCorner::NearRightBottom),
|
||||||
GetCorner(Nz::BoxCorner::NearRightTop)
|
GetCorner(BoxCorner::NearRightTop)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -691,19 +691,6 @@ namespace Nz
|
||||||
return lhs.ApproxEqual(rhs, maxDifference);
|
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>
|
template<typename T>
|
||||||
constexpr Box<T> Box<T>::FromExtends(const Vector3<T>& vec1, const Vector3<T>& vec2)
|
constexpr Box<T> Box<T>::FromExtends(const Vector3<T>& vec1, const Vector3<T>& vec2)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -254,10 +254,10 @@ namespace Nz
|
||||||
constexpr EnumArray<RectCorner, Vector2<T>> Rect<T>::GetCorners() const
|
constexpr EnumArray<RectCorner, Vector2<T>> Rect<T>::GetCorners() const
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
GetCorner(Nz::RectCorner::LeftBottom),
|
GetCorner(RectCorner::LeftBottom),
|
||||||
GetCorner(Nz::RectCorner::LeftTop),
|
GetCorner(RectCorner::LeftTop),
|
||||||
GetCorner(Nz::RectCorner::RightBottom),
|
GetCorner(RectCorner::RightBottom),
|
||||||
GetCorner(Nz::RectCorner::RightTop)
|
GetCorner(RectCorner::RightTop)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,7 @@ namespace Nz
|
||||||
|
|
||||||
inline void DebugDrawer::DrawFrustum(const Frustumf& frustum, const Color& color)
|
inline void DebugDrawer::DrawFrustum(const Frustumf& frustum, const Color& color)
|
||||||
{
|
{
|
||||||
EnumArray<BoxCorner, Vector3f> corners;
|
EnumArray<BoxCorner, Vector3f> corners = frustum.ComputeCorners();
|
||||||
for (auto&& [corner, pos] : corners.iter_kv())
|
|
||||||
pos = frustum.ComputeCorner(corner);
|
|
||||||
|
|
||||||
DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearRightBottom], color);
|
DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearRightBottom], color);
|
||||||
DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearLeftTop], color);
|
DrawLine(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearLeftTop], color);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue