diff --git a/Step 3/cmake-build-debug/.ninja_deps b/Step 3/cmake-build-debug/.ninja_deps index 8c4233c..55be3bf 100644 Binary files a/Step 3/cmake-build-debug/.ninja_deps and b/Step 3/cmake-build-debug/.ninja_deps differ diff --git a/Step 3/cmake-build-debug/.ninja_log b/Step 3/cmake-build-debug/.ninja_log index 9ac363e..9e0b0fc 100644 --- a/Step 3/cmake-build-debug/.ninja_log +++ b/Step 3/cmake-build-debug/.ninja_log @@ -23,3 +23,48 @@ 2 2362 1668306655590361727 CMakeFiles/Step_3.dir/src/graphics/gl/shader.cpp.o 71dc053459a0e1f1 2 3200 1668306656426385604 CMakeFiles/Step_3.dir/src/engine/main.cpp.o 604a2e8d964efb9f 2 1622 1668274730524259221 CMakeFiles/Step_3.dir/src/engine/util/parser.cpp.o e7cc33824fbdff30 +3 942 1668362748605515989 CMakeFiles/Step_3.dir/src/graphics/gl/gl.c.o 7e874136640e6898 +2 1373 1668362749041528665 CMakeFiles/Step_3.dir/src/engine/globals.cpp.o 3e7c95bef1d0ddaa +3 1631 1668362749297536103 CMakeFiles/Step_3.dir/src/graphics/debug_gui.cpp.o 6b49c8b248d04bb6 +3 1762 1668362749429539940 CMakeFiles/Step_3.dir/src/engine/util/parser.cpp.o e9e3fe6fe9a4de66 +2 1849 1668362749513542381 CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o d5972a669671ede +2 2023 1668362749689547500 CMakeFiles/Step_3.dir/src/engine/math/colliders.cpp.o 12778f168a75833b +3 2081 1668362749749549242 CMakeFiles/Step_3.dir/src/graphics/gl/gl.cpp.o c67f39c07aae8f1c +2023 2244 1668362749909553892 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui_impl_glfw.cpp.o 35f01a0bb2fddead +3 2354 1668362750021557148 CMakeFiles/Step_3.dir/src/engine/util/models.cpp.o f8031520e846a554 +2244 2466 1668362750133560403 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui_impl_opengl3.cpp.o 45a2ee53269bffeb +2082 2569 1668362750237563426 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui_impl_x11.cpp.o 6f5a39b3d5d543ae +3 2845 1668362750505571219 CMakeFiles/Step_3.dir/src/engine/world.cpp.o fa088ebdd4dea6cb +2 3085 1668362750749578312 CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o 39bc1042baf06dcd +942 3150 1668362750817580289 CMakeFiles/Step_3.dir/src/graphics/gl/shader.cpp.o 67f44a482b45cec6 +1763 3332 1668362750997585518 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui_demo.cpp.o cf522ea42b0f8fd3 +2 3562 1668362751225592146 CMakeFiles/Step_3.dir/src/engine/main.cpp.o 9281ecbfd964c525 +2 3800 1668362751465599125 CMakeFiles/Step_3.dir/src/engine/image/image.cpp.o 4ca9d05ad8f3d295 +2569 3864 1668362751533601098 CMakeFiles/Step_3.dir/src/graphics/input.cpp.o 10752ac78f398bdb +2354 4138 1668362751805609008 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui_tables.cpp.o dc4b23b5e01a8208 +1374 4227 1668362751893611563 CMakeFiles/Step_3.dir/src/graphics/graphics.cpp.o 53ce7d6ed877d888 +1849 4534 1668362752197620402 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui_draw.cpp.o 707f99c685c75a0f +2466 5248 1668362752913641215 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui_widgets.cpp.o d81abd5f968f8f53 +1631 5297 1668362752961642610 CMakeFiles/Step_3.dir/src/graphics/imgui/imgui.cpp.o f152a6b2309aba93 +5297 5505 1668362753169648656 Step_3 7f6959eaebe4da02 +1 1693 1668362807195219265 CMakeFiles/Step_3.dir/src/engine/util/models.cpp.o f8031520e846a554 +1 2108 1668362807611231362 CMakeFiles/Step_3.dir/src/engine/world.cpp.o fa088ebdd4dea6cb +2 2177 1668362807679233339 CMakeFiles/Step_3.dir/src/graphics/graphics.cpp.o 53ce7d6ed877d888 +1 2414 1668362807915240201 CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o 39bc1042baf06dcd +1 2489 1668362807991242410 CMakeFiles/Step_3.dir/src/engine/main.cpp.o 9281ecbfd964c525 +2489 2692 1668362808195248344 Step_3 7f6959eaebe4da02 +1 965 1668362864276879195 CMakeFiles/Step_3.dir/src/engine/globals.cpp.o 3e7c95bef1d0ddaa +1 1166 1668362864480885130 CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o d5972a669671ede +1 2161 1668362865472913981 CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o 39bc1042baf06dcd +1 2299 1668362865612918054 CMakeFiles/Step_3.dir/src/engine/main.cpp.o 9281ecbfd964c525 +2299 2502 1668362865812923870 Step_3 7f6959eaebe4da02 +1 1228 1668362988976506901 CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o d5972a669671ede +1 2230 1668362989976535999 CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o 39bc1042baf06dcd +1 2290 1668362990036537746 CMakeFiles/Step_3.dir/src/engine/main.cpp.o 9281ecbfd964c525 +1 1013 1668363015781286921 CMakeFiles/Step_3.dir/src/engine/globals.cpp.o 3e7c95bef1d0ddaa +1014 1262 1668363016025294021 Step_3 7f6959eaebe4da02 +1 992 1668363033961816015 CMakeFiles/Step_3.dir/src/engine/globals.cpp.o 3e7c95bef1d0ddaa +1 1252 1668363034221823584 CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o d5972a669671ede +1 2232 1668363035201852107 CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o 39bc1042baf06dcd +1 2254 1668363035221852687 CMakeFiles/Step_3.dir/src/engine/main.cpp.o 9281ecbfd964c525 +2254 2476 1668363035445859208 Step_3 7f6959eaebe4da02 diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/globals.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/globals.cpp.o index e35f70b..3dc8664 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/globals.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/globals.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/image/image.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/image/image.cpp.o index e2aaa84..4bba870 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/image/image.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/image/image.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/main.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/main.cpp.o index 415de1e..cd000b3 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/main.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/main.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/math/colliders.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/math/colliders.cpp.o index 9496fc8..e9287d4 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/math/colliders.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/math/colliders.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o index a7ee135..91e8fad 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o index 15fa12d..653b8fe 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/debug.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/models.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/models.cpp.o index 2111b6c..7a1b824 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/models.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/models.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/parser.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/parser.cpp.o index 56a0770..7010753 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/parser.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/util/parser.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/world.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/world.cpp.o index e401184..5166df7 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/world.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/engine/world.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/gl.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/gl.cpp.o index 89b8e9d..bc5cec2 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/gl.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/gl.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/shader.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/shader.cpp.o index fa6f67e..06d1928 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/shader.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/gl/shader.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/graphics.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/graphics.cpp.o index a855734..ecd9873 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/graphics.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/graphics.cpp.o differ diff --git a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/input.cpp.o b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/input.cpp.o index 7ab490d..0ec1b23 100644 Binary files a/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/input.cpp.o and b/Step 3/cmake-build-debug/CMakeFiles/Step_3.dir/src/graphics/input.cpp.o differ diff --git a/Step 3/cmake-build-debug/Step_3 b/Step 3/cmake-build-debug/Step_3 index 03e272d..2e82b29 100755 Binary files a/Step 3/cmake-build-debug/Step_3 and b/Step 3/cmake-build-debug/Step_3 differ diff --git a/Step 3/cmake-build-debug/Testing/Temporary/LastTest.log b/Step 3/cmake-build-debug/Testing/Temporary/LastTest.log index 693344f..5a37f4e 100644 --- a/Step 3/cmake-build-debug/Testing/Temporary/LastTest.log +++ b/Step 3/cmake-build-debug/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Nov 12 21:32 EST +Start testing: Nov 13 13:10 EST ---------------------------------------------------------- -End testing: Nov 12 21:32 EST +End testing: Nov 13 13:10 EST diff --git a/Step 3/cmake-build-release/.ninja_deps b/Step 3/cmake-build-release/.ninja_deps index e223d63..61c1c91 100644 Binary files a/Step 3/cmake-build-release/.ninja_deps and b/Step 3/cmake-build-release/.ninja_deps differ diff --git a/Step 3/cmake-build-release/.ninja_log b/Step 3/cmake-build-release/.ninja_log index 2882597..9a541f4 100644 --- a/Step 3/cmake-build-release/.ninja_log +++ b/Step 3/cmake-build-release/.ninja_log @@ -26,3 +26,9 @@ 2 2242 1668360836450355031 CMakeFiles/Step_3.dir/src/engine/util/parser.cpp.o 1007c86c207ac940 2 1579 1668362569316307713 CMakeFiles/Step_3.dir/src/engine/world.cpp.o 6470df278966c4 1579 1704 1668362569440311315 Step_3 f055ce2b85635598 +1 1319 1668362704700239985 CMakeFiles/Step_3.dir/src/engine/util/models.cpp.o 164394d360c43072 +2 1568 1668362704948247191 CMakeFiles/Step_3.dir/src/graphics/graphics.cpp.o ce988de97a5cb51d +2 1667 1668362705048250097 CMakeFiles/Step_3.dir/src/engine/world.cpp.o 6470df278966c4 +1 1710 1668362705092251375 CMakeFiles/Step_3.dir/src/engine/raytracing.cpp.o 11f0e227e9fda9ca +1 2005 1668362705384259861 CMakeFiles/Step_3.dir/src/engine/main.cpp.o 641dce3f86933e2e +2005 2097 1668362705476262536 Step_3 f055ce2b85635598 diff --git a/Step 3/cmake-build-release/2022-11-13 13:5:36.png b/Step 3/cmake-build-release/2022-11-13 13:5:36.png new file mode 100644 index 0000000..f213845 Binary files /dev/null and b/Step 3/cmake-build-release/2022-11-13 13:5:36.png differ diff --git a/Step 3/cmake-build-release/CMakeFiles/Step_3.dir/src/engine/world.cpp.o b/Step 3/cmake-build-release/CMakeFiles/Step_3.dir/src/engine/world.cpp.o index be1cced..b4ba9f6 100644 Binary files a/Step 3/cmake-build-release/CMakeFiles/Step_3.dir/src/engine/world.cpp.o and b/Step 3/cmake-build-release/CMakeFiles/Step_3.dir/src/engine/world.cpp.o differ diff --git a/Step 3/cmake-build-release/Step_3 b/Step 3/cmake-build-release/Step_3 index 4075fa4..80a4e30 100755 Binary files a/Step 3/cmake-build-release/Step_3 and b/Step 3/cmake-build-release/Step_3 differ diff --git a/Step 3/cmake-build-release/Testing/Temporary/LastTest.log b/Step 3/cmake-build-release/Testing/Temporary/LastTest.log index 66f32ef..8718328 100644 --- a/Step 3/cmake-build-release/Testing/Temporary/LastTest.log +++ b/Step 3/cmake-build-release/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Nov 13 13:02 EST +Start testing: Nov 13 13:05 EST ---------------------------------------------------------- -End testing: Nov 13 13:02 EST +End testing: Nov 13 13:05 EST diff --git a/Step 3/include/engine/math/bvh.h b/Step 3/include/engine/math/bvh.h index 8e20ca6..003dea5 100644 --- a/Step 3/include/engine/math/bvh.h +++ b/Step 3/include/engine/math/bvh.h @@ -52,10 +52,11 @@ namespace Raytracing { for (const auto& obj: objs) { // if this object doesn't have an AABB, we cannot use a BVH on it // If this ever fails we have a problem with the implementation. - assert(obj.aabb.isEmpty()); + assert(!obj.aabb.isEmpty()); if (obj.aabb.intersects(aabbs.first)) { space.left.push_back(obj); - } else if (obj.aabb.intersects(aabbs.second)) { + } + if (obj.aabb.intersects(aabbs.second)) { space.right.push_back(obj); } } diff --git a/Step 3/include/engine/util/debug.h b/Step 3/include/engine/util/debug.h index 1fedc37..05b06cd 100644 --- a/Step 3/include/engine/util/debug.h +++ b/Step 3/include/engine/util/debug.h @@ -20,7 +20,7 @@ namespace Raytracing { class profiler; - extern std::unordered_map profiles; + extern std::unordered_map> profiles; class DebugTab{ protected: @@ -47,7 +47,7 @@ namespace Raytracing { auto p = profiles.at(name); p->start(tabName); } else { - auto p = new profiler(name); + auto p = std::make_shared(name); profiles.insert(std::pair(name, p)); p->start(tabName); } @@ -65,7 +65,6 @@ namespace Raytracing { static void print(const std::string& name){ try { profiles.at(name)->print(); - delete(profiles.at(name)); } catch (std::exception& e){} } @@ -77,15 +76,11 @@ namespace Raytracing { void render(); static void render(int count) { - for (auto p : profiles) + for (const auto& p : profiles) p.second->render(); } - ~profiler(); - static void cleanup(){ - for (const auto& p : profiles) - delete(p.second); - } + ~profiler() = default; }; } diff --git a/Step 3/src/engine/globals.cpp b/Step 3/src/engine/globals.cpp index 42eceb3..74749ba 100644 --- a/Step 3/src/engine/globals.cpp +++ b/Step 3/src/engine/globals.cpp @@ -10,5 +10,5 @@ bool* pauseRaytracing; bool* haltRaytracing; namespace Raytracing { - std::unordered_map profiles; + std::unordered_map> profiles; } \ No newline at end of file diff --git a/Step 3/src/engine/main.cpp b/Step 3/src/engine/main.cpp index 44f6268..558bd54 100644 --- a/Step 3/src/engine/main.cpp +++ b/Step 3/src/engine/main.cpp @@ -196,8 +196,5 @@ int main(int argc, char** args) { deleteQuad(); #endif - for (auto& p : Raytracing::profiles) - delete(p.second); - return 0; } diff --git a/Step 3/src/engine/util/debug.cpp b/Step 3/src/engine/util/debug.cpp index e19d606..aea7adc 100644 --- a/Step 3/src/engine/util/debug.cpp +++ b/Step 3/src/engine/util/debug.cpp @@ -58,8 +58,8 @@ namespace Raytracing { ImGui::NewLine();*/ } - profiler::~profiler() { + //profiler::~profiler() { // currently unused as we don't have a UI yet. //TD::debugUI::deleteTab(this); - } + //} }