Graphics/Sprite: Fix AABB

This commit is contained in:
Jérôme Leclercq
2022-01-21 21:44:21 +01:00
parent 213c7d8a1e
commit b3ff5767f7

View File

@@ -89,7 +89,7 @@ namespace Nz
inline void Sprite::UpdateVertices()
{
Boxf aabb;
Boxf aabb(-1.f, -1.f, -1.f);
VertexStruct_XYZ_Color_UV* vertices = m_vertices.data();
@@ -105,6 +105,9 @@ namespace Nz
vertices->position = Vector3f(m_size * cornerExtent[UnderlyingCast(corner)], 0.f) - m_origin;
vertices->uv = m_textureCoords.GetCorner(corner);
if (aabb.IsValid())
aabb.ExtendTo(vertices->position);
else
aabb.Set(vertices->position);
vertices++;