VOXELGENERATOR: create new layers below the current active one

master
Martin Gerhardy 2022-03-30 20:34:19 +02:00
parent 576a381c11
commit 96384d2683
1 changed files with 2 additions and 1 deletions

View File

@ -437,7 +437,8 @@ static int luaVoxel_scenegraph_new_node(lua_State* s) {
const glm::vec3 size = v->region().getDimensionsInVoxels();
node.setPivot(0, rp, size);
voxelformat::SceneGraph* sceneGraph = lua::LUA::globalData<voxelformat::SceneGraph>(s, luaVoxel_globalscenegraph());
const int nodeId = voxelformat::addNodeToSceneGraph(*sceneGraph, node, sceneGraph->root().id());
int* currentNodeId = lua::LUA::globalData<int>(s, luaVoxel_globalnodeid());
const int nodeId = voxelformat::addNodeToSceneGraph(*sceneGraph, node, *currentNodeId);
if (nodeId == -1) {
return clua_error(s, "Failed to add new node");
}