mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +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
|
@ -64,6 +64,17 @@ struct SMesh : public IMesh
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
u32 getTextureSlot(u32 meshbufNr) const override
|
||||
{
|
||||
return TextureSlots.at(meshbufNr);
|
||||
}
|
||||
|
||||
void setTextureSlot(u32 meshbufNr, u32 textureSlot)
|
||||
{
|
||||
TextureSlots.at(meshbufNr) = textureSlot;
|
||||
}
|
||||
|
||||
|
||||
//! returns an axis aligned bounding box
|
||||
const core::aabbox3d<f32> &getBoundingBox() const override
|
||||
{
|
||||
|
@ -103,6 +114,7 @@ struct SMesh : public IMesh
|
|||
if (buf) {
|
||||
buf->grab();
|
||||
MeshBuffers.push_back(buf);
|
||||
TextureSlots.push_back(getMeshBufferCount() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,6 +134,8 @@ struct SMesh : public IMesh
|
|||
|
||||
//! The meshbuffers of this mesh
|
||||
std::vector<IMeshBuffer *> MeshBuffers;
|
||||
//! Mapping from meshbuffer number to bindable texture slot
|
||||
std::vector<u32> TextureSlots;
|
||||
|
||||
//! The bounding box of this mesh
|
||||
core::aabbox3d<f32> BoundingBox;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue