mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add static glTF support (#14557)
Co-authored-by: Lars Mueller <appgurulars@gmx.de> Co-authored-by: jordan4ibanez <jordan4ibanez@users.noreply.github.com> Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
This commit is contained in:
parent
8972c80d7d
commit
ac11a14509
47 changed files with 2863 additions and 28 deletions
|
@ -2807,8 +2807,13 @@ void GUIFormSpecMenu::parseModel(parserData *data, const std::string &element)
|
|||
|
||||
auto meshnode = e->setMesh(mesh);
|
||||
|
||||
for (u32 i = 0; i < textures.size() && i < meshnode->getMaterialCount(); ++i)
|
||||
e->setTexture(i, m_tsrc->getTexture(unescape_string(textures[i])));
|
||||
for (u32 i = 0; i < meshnode->getMaterialCount(); ++i) {
|
||||
const auto texture_idx = mesh->getTextureSlot(i);
|
||||
if (texture_idx >= textures.size())
|
||||
warningstream << "Invalid model element: Not enough textures" << std::endl;
|
||||
else
|
||||
e->setTexture(i, m_tsrc->getTexture(unescape_string(textures[texture_idx])));
|
||||
}
|
||||
|
||||
if (vec_rot.size() >= 2)
|
||||
e->setRotation(v2f(stof(vec_rot[0]), stof(vec_rot[1])));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue