apply model offset to meshes

This commit is contained in:
MihailRis 2024-10-26 14:11:23 +03:00
parent 322d7cd7a6
commit 84ba063908

View File

@ -177,6 +177,13 @@ static Model load_model(
util::Buffer<char> chars(nameLength);
reader.get(chars.data(), nameLength);
std::string name(chars.data(), nameLength);
glm::vec3 offset {x, y, z};
for (auto& mesh : meshes) {
for (auto& vertex : mesh.vertices) {
vertex.coord -= offset;
}
}
return Model {std::move(name), model::Model {std::move(meshes)}, {x, y, z}};
}