Parse glTF joints & weights attributes

This commit is contained in:
Nikita Lisitsa 2023-03-26 00:12:20 +03:00
parent 0c2c950a8c
commit 1561162cf8
2 changed files with 6 additions and 0 deletions

View file

@ -38,6 +38,8 @@ namespace psemek::gfx
std::optional<std::size_t> position;
std::optional<std::size_t> normal;
std::optional<std::size_t> texcoord;
std::optional<std::size_t> joints;
std::optional<std::size_t> weights;
std::size_t indices;
std::optional<std::size_t> material;
};

View file

@ -155,6 +155,10 @@ namespace psemek::gfx
primitive_target.normal = attributes["NORMAL"].GetUint64();
if (attributes.HasMember("TEXCOORD_0"))
primitive_target.texcoord = attributes["TEXCOORD_0"].GetUint64();
if (attributes.HasMember("JOINTS_0"))
primitive_target.joints = attributes["JOINTS_0"].GetUint64();
if (attributes.HasMember("WEIGHTS_0"))
primitive_target.weights = attributes["WEIGHTS_0"].GetUint64();
}
}