diff --git a/data/shader/raytracer/common.hsh b/data/shader/raytracer/common.hsh index c5f82175f..ba640a7c8 100644 --- a/data/shader/raytracer/common.hsh +++ b/data/shader/raytracer/common.hsh @@ -6,7 +6,7 @@ #include <../common/octahedron.hsh> #define INF 1000000000000.0 -#define EPSILON 0.01 +#define EPSILON 0.1 #define DIRECTIONAL_LIGHT 0 #define TRIANGLE_LIGHT 1 diff --git a/src/editor/ui/panels/SceneHierarchyPanel.cpp b/src/editor/ui/panels/SceneHierarchyPanel.cpp index 50e02a0fd..5c4c83cc7 100644 --- a/src/editor/ui/panels/SceneHierarchyPanel.cpp +++ b/src/editor/ui/panels/SceneHierarchyPanel.cpp @@ -179,6 +179,7 @@ namespace Atlas::Editor::UI { } // If the hierarchy is emtpy after movements or deletions, also remove the hierarchy + hierarchyComponent = deleteEntity ? nullptr : entity.TryGetComponent(); if (hierarchyComponent && hierarchyComponent->GetChildren().empty()) { entity.RemoveComponent(); } diff --git a/src/engine/renderer/PrimitiveBatch.cpp b/src/engine/renderer/PrimitiveBatch.cpp index 56fc959c0..a09ed096b 100644 --- a/src/engine/renderer/PrimitiveBatch.cpp +++ b/src/engine/renderer/PrimitiveBatch.cpp @@ -67,7 +67,7 @@ namespace Atlas { void PrimitiveBatch::TransferData() { - if (!lineDataValid) { + if (!lineDataValid && GetLineCount() > 0) { lineVertices.SetSize(GetLineCount() * 2, lineVertexData.data()); @@ -78,7 +78,7 @@ namespace Atlas { } - if (!triangleDataValid) { + if (!triangleDataValid && GetTriangleCount() > 0) { triangleVertices.SetSize(GetTriangleCount() * 3, triangleVertexData.data()); diff --git a/src/engine/scene/Scene.cpp b/src/engine/scene/Scene.cpp index c79de2d4f..952c3f360 100644 --- a/src/engine/scene/Scene.cpp +++ b/src/engine/scene/Scene.cpp @@ -32,7 +32,8 @@ namespace Atlas { if (removeRecursively) { auto hierarchyComponent = entity.TryGetComponent(); if (hierarchyComponent) { - for (auto childEntity : hierarchyComponent->GetChildren()) { + auto children = hierarchyComponent->GetChildren(); + for (auto childEntity : children) { DestroyEntity(childEntity, removeRecursively); } }