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

feat: pathnodes are added through the GLTF file

This commit is contained in:
LJW-Dev
2026-03-22 20:24:14 +08:00
committed by Jan Laupetin
parent dd14988bad
commit 096efd03c0
4 changed files with 44 additions and 1 deletions
+23
View File
@@ -586,6 +586,26 @@ namespace
return true;
}
bool addPathNode_Node(const gltf::JsonNode& node)
{
assert(node.extras);
assert(node.extras->pathnode);
BSPPathNode pathnode;
Eigen::Matrix4f nodeMatrix = createNodeMatrix(node);
Eigen::Vector4f position(0, 0, 0, 1.0f);
Eigen::Vector4f transformedPosition = nodeMatrix * position;
pathnode.origin.x = transformedPosition.x();
pathnode.origin.y = transformedPosition.y();
pathnode.origin.z = transformedPosition.z();
RhcToLhcCoordinates(pathnode.origin.v);
m_bsp->pathnodes.emplace_back(pathnode);
return true;
}
bool addSpawnPointNode(const gltf::JsonNode& node)
{
assert(node.extras);
@@ -641,6 +661,9 @@ namespace
if (m_is_world_gfx && node.extras->spawnpoint)
return addSpawnPointNode(node);
if (m_is_world_gfx && node.extras->pathnode)
return addPathNode_Node(node);
}
if (node.mesh)