Skip to content

Commit

Permalink
Fixed some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tippesi committed Feb 8, 2024
1 parent bb69679 commit 4b0c027
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/shader/raytracer/common.hsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/editor/ui/panels/SceneHierarchyPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<HierarchyComponent>();
if (hierarchyComponent && hierarchyComponent->GetChildren().empty()) {
entity.RemoveComponent<HierarchyComponent>();
}
Expand Down
4 changes: 2 additions & 2 deletions src/engine/renderer/PrimitiveBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace Atlas {

void PrimitiveBatch::TransferData() {

if (!lineDataValid) {
if (!lineDataValid && GetLineCount() > 0) {

lineVertices.SetSize(GetLineCount() * 2,
lineVertexData.data());
Expand All @@ -78,7 +78,7 @@ namespace Atlas {

}

if (!triangleDataValid) {
if (!triangleDataValid && GetTriangleCount() > 0) {

triangleVertices.SetSize(GetTriangleCount() * 3,
triangleVertexData.data());
Expand Down
3 changes: 2 additions & 1 deletion src/engine/scene/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ namespace Atlas {
if (removeRecursively) {
auto hierarchyComponent = entity.TryGetComponent<HierarchyComponent>();
if (hierarchyComponent) {
for (auto childEntity : hierarchyComponent->GetChildren()) {
auto children = hierarchyComponent->GetChildren();
for (auto childEntity : children) {
DestroyEntity(childEntity, removeRecursively);
}
}
Expand Down

0 comments on commit 4b0c027

Please sign in to comment.