Graphics/Sprite: Fix AABB
This commit is contained in:
@@ -89,7 +89,7 @@ namespace Nz
|
|||||||
|
|
||||||
inline void Sprite::UpdateVertices()
|
inline void Sprite::UpdateVertices()
|
||||||
{
|
{
|
||||||
Boxf aabb;
|
Boxf aabb(-1.f, -1.f, -1.f);
|
||||||
|
|
||||||
VertexStruct_XYZ_Color_UV* vertices = m_vertices.data();
|
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->position = Vector3f(m_size * cornerExtent[UnderlyingCast(corner)], 0.f) - m_origin;
|
||||||
vertices->uv = m_textureCoords.GetCorner(corner);
|
vertices->uv = m_textureCoords.GetCorner(corner);
|
||||||
|
|
||||||
|
if (aabb.IsValid())
|
||||||
|
aabb.ExtendTo(vertices->position);
|
||||||
|
else
|
||||||
aabb.Set(vertices->position);
|
aabb.Set(vertices->position);
|
||||||
|
|
||||||
vertices++;
|
vertices++;
|
||||||
|
|||||||
Reference in New Issue
Block a user