Models/Collideables/etc. won't need a AABB component anymore, if it has a Model component. In addition, they should take rotation into account, i.e it doesn't have to be axis-aligned.

This commit is contained in:
William Moberg
2016-02-09 19:20:04 +01:00
parent eec59a40c8
commit 7140b740b5
6 changed files with 51 additions and 47 deletions
+9
View File
@@ -64,6 +64,15 @@ Model::Model(std::string fileName)
GLERROR("GLEW: BufferFail5");
//CreateBuffers();
glm::vec3 mini(INFINITY);
glm::vec3 maxi(-INFINITY);
for (const auto& v : m_RawModel->m_Vertices) {
mini = glm::min(mini, v.Position);
maxi = glm::max(maxi, v.Position);
}
m_Box = AABB(maxi, mini);
}
Model::~Model()