Parse glTF joints & weights attributes
This commit is contained in:
parent
0c2c950a8c
commit
1561162cf8
2 changed files with 6 additions and 0 deletions
|
|
@ -38,6 +38,8 @@ namespace psemek::gfx
|
||||||
std::optional<std::size_t> position;
|
std::optional<std::size_t> position;
|
||||||
std::optional<std::size_t> normal;
|
std::optional<std::size_t> normal;
|
||||||
std::optional<std::size_t> texcoord;
|
std::optional<std::size_t> texcoord;
|
||||||
|
std::optional<std::size_t> joints;
|
||||||
|
std::optional<std::size_t> weights;
|
||||||
std::size_t indices;
|
std::size_t indices;
|
||||||
std::optional<std::size_t> material;
|
std::optional<std::size_t> material;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,10 @@ namespace psemek::gfx
|
||||||
primitive_target.normal = attributes["NORMAL"].GetUint64();
|
primitive_target.normal = attributes["NORMAL"].GetUint64();
|
||||||
if (attributes.HasMember("TEXCOORD_0"))
|
if (attributes.HasMember("TEXCOORD_0"))
|
||||||
primitive_target.texcoord = attributes["TEXCOORD_0"].GetUint64();
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue