Sdk/GraphicsComponent: Remake bounding volume handling

GraphicsComponent now only have an AABB but their instanced renderable now have individual BoundingVolume
This commit is contained in:
Jérôme Leclercq
2018-08-31 17:32:48 +02:00
parent 7bb6c84752
commit e42ff5b18a
6 changed files with 118 additions and 100 deletions

View File

@@ -87,7 +87,7 @@ namespace Ndk
Nz::Vector2f origin = GetContentOrigin();
const Nz::Vector2f& contentSize = GetContentSize();
Nz::Boxf textBox = m_textEntity->GetComponent<GraphicsComponent>().GetBoundingVolume().obb.localBox;
Nz::Boxf textBox = m_textEntity->GetComponent<GraphicsComponent>().GetAABB();
m_textEntity->GetComponent<NodeComponent>().SetPosition(origin.x + contentSize.x / 2 - textBox.width / 2, origin.y + contentSize.y / 2 - textBox.height / 2);
}