feat: add removeNode function to StardustBridge for node deletion
This commit is contained in:
@@ -161,6 +161,16 @@ bool StardustBridge::updateNodeTransform(NodeId id, const glm::mat4& transform)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StardustBridge::removeNode(NodeId id) {
|
||||
auto it = m_nodes.find(id);
|
||||
if (it == m_nodes.end()) return false;
|
||||
m_nodes.erase(it);
|
||||
if (m_fnRemoveNode) {
|
||||
(void)m_fnRemoveNode(id);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void StardustBridge::poll() {
|
||||
if (!m_connected) return;
|
||||
|
||||
@@ -237,6 +247,7 @@ bool StardustBridge::loadBridge() {
|
||||
m_fnShutdown = reinterpret_cast<fn_shutdown_t>(req("sdxr_shutdown"));
|
||||
m_fnCreateNode = reinterpret_cast<fn_create_node_t>(req("sdxr_create_node"));
|
||||
m_fnUpdateNode = reinterpret_cast<fn_update_node_t>(req("sdxr_update_node"));
|
||||
m_fnRemoveNode = reinterpret_cast<fn_remove_node_t>(req("sdxr_remove_node"));
|
||||
if (m_fnStart && m_fnPoll && m_fnCreateNode && m_fnUpdateNode) {
|
||||
m_bridgeHandle = h;
|
||||
std::cout << "[StardustBridge] Loaded Rust bridge: " << path << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user