From 427ccb666bad30f0ab692063805b5df284197a51 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 25 Sep 2024 10:34:12 +0200 Subject: [PATCH] Use auto instead of decltype in cast_scene --- src/scene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scene.cpp b/src/scene.cpp index 50a9de3..602d605 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -191,14 +191,14 @@ std::optional cast_scene(const Ray ray, Scene& scene, const bool us if (depth > max_depth) return {}; - const std::function scene_func = use_bvh ? test_scene_octree : test_scene; + const auto scene_func = use_bvh ? test_scene_octree : test_scene; if (auto hit = scene_func(ray, scene)) { const float diffuse = lighting::point_light(hit->position, light_position, hit->normal); SceneResult result = {}; // direct lighting calculation - // currently only supports only one light (directional) + // currently only supports one light (directional) if (glm::dot(light_position - hit->position, hit->normal) > 0) { const glm::vec3 light_dir = glm::normalize(light_position - hit->position);