2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 08:42:35 +00:00

feat: xmodles have toggleable shadows

This commit is contained in:
LJW-Dev
2026-03-22 19:22:19 +08:00
committed by Jan Laupetin
parent f47792ebe4
commit dd14988bad
3 changed files with 31 additions and 6 deletions
+12
View File
@@ -548,6 +548,18 @@ namespace
throw GltfLoadException("Xmodel has no name.");
xmodel.name = *node.extras->xmodel;
xmodel.doesCastShadow = true;
if (node.extras->flags)
{
std::vector<std::string> flagStrVec = utils::StringSplit(*node.extras->flags, ',');
for (std::string& flag : flagStrVec)
if (!flag.compare(surfaceTypeToNameMap[SURF_TYPE_NOCASTSHADOW]))
{
xmodel.doesCastShadow = false;
break;
}
}
Eigen::Vector4f position(0, 0, 0, 1.0f);
Eigen::Vector4f transformedPosition = nodeMatrix * position;
xmodel.origin.x = transformedPosition.x();