Add parent ID parameter to node creation functions in Rust and C++

This commit is contained in:
MayaTheShy
2025-11-16 22:08:57 -05:00
parent 8be82ca505
commit bcdbd11c7c
3 changed files with 7 additions and 4 deletions

View File

@@ -160,7 +160,8 @@ StardustBridge::NodeId StardustBridge::createNode(const std::string& name,
float m[16];
// GLM mat4 is column-major; pass as 16 floats as-is
std::memcpy(m, &transform[0][0], sizeof(m));
std::uint64_t rid = m_fnCreateNode(name.c_str(), m);
std::uint64_t parentVal = parent.has_value() ? *parent : 0;
std::uint64_t rid = m_fnCreateNode(name.c_str(), m, parentVal);
(void)rid; // Could map to NodeId if Rust returns its own id
}
return id;

View File

@@ -83,7 +83,7 @@ private:
using fn_start_t = int(*)(const char*);
using fn_poll_t = int(*)();
using fn_shutdown_t = void(*)();
using fn_create_node_t = std::uint64_t(*)(const char*, const float*);
using fn_create_node_t = std::uint64_t(*)(const char*, const float*, std::uint64_t);
using fn_update_node_t = int(*)(std::uint64_t, const float*);
using fn_remove_node_t = int(*)(std::uint64_t);
using fn_set_model_t = int(*)(std::uint64_t, const char*);