Skip to content

Commit

Permalink
Added groups
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-beqiraj committed Feb 6, 2025
1 parent 9e1c742 commit 97fa17c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Engine/src/SceneObjects/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void Prisma::Node::removeChild(uint64_t uuid, bool removeRecursive)
{
component.second->destroy();
}

m_children[index]->parent(nullptr);
m_children.erase(m_children.begin() + index);

CacheScene::getInstance().updateSizes(true);
Expand Down
9 changes: 6 additions & 3 deletions GUI/src/NodeCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,20 @@ std::shared_ptr<Prisma::Node> Prisma::NodeCreator::createArea()
verticesData->vertices = vertices;
verticesData->indices = indices;

auto planeArea=createMesh(verticesData, "PlaneArea");
auto newInstance = std::make_shared<Mesh>();
newInstance->loadModel(verticesData);
newInstance->matrix(glm::mat4(1.0));
newInstance->name("PlaneMesh" + std::to_string(newInstance->uuid()));
auto whiteMaterial = getEmptyMaterial();
whiteMaterial->color(glm::vec4(1.0));
whiteMaterial->plain(true);
std::dynamic_pointer_cast<Mesh>(planeArea->children()[0])->material(whiteMaterial);
newInstance->material(whiteMaterial);
auto parent = std::make_shared<Prisma::Node>();
parent->name("ParentArea_" + std::to_string(parent->uuid()));
auto light = std::make_shared<Light<LightType::LightArea>>();
light->name("Area" + std::to_string(light->uuid()));
parent->addChild(light);
parent->addChild(planeArea);
parent->addChild(newInstance);
Prisma::GlobalData::getInstance().currentGlobalScene()->root->addChild(parent);
return light;
}
Expand Down

0 comments on commit 97fa17c

Please sign in to comment.