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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user