Non-skined mesh WIP

This commit is contained in:
Teejoon
2016-02-02 17:18:42 +01:00
parent 9573958a86
commit bb4a65a1db
5 changed files with 78 additions and 26 deletions
+2 -1
View File
@@ -269,7 +269,8 @@ bool attachAABBComponentFromModel(World* world, EntityID id)
glm::vec3 mini = glm::vec3(INFINITY, INFINITY, INFINITY);
glm::vec3 maxi = glm::vec3(-INFINITY, -INFINITY, -INFINITY);
for (const auto& v : modelRes->Vertices()) {
for (unsigned int i = 0; i < modelRes->NumberOfVertices(); i++) {
const auto& v = modelRes->Vertices()[i];
const auto& wPos = modelMatrix * glm::vec4(v.Position.x, v.Position.y, v.Position.z, 1);
maxi.x = std::max(wPos.x, maxi.x);
maxi.y = std::max(wPos.y, maxi.y);