mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
apply model offset to meshes
This commit is contained in:
parent
322d7cd7a6
commit
84ba063908
1 changed files with 7 additions and 0 deletions
|
|
@ -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}};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue