From eaa992bdbcbc0c36ddee4ee3dbeab60c8602f367 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 25 Sep 2024 10:31:07 +0200 Subject: [PATCH] Use std::pair instead of std::tuple in orthogonal_system --- src/scene.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scene.cpp b/src/scene.cpp index 278dee8..50a9de3 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -160,8 +160,8 @@ std::optional test_scene_octree(const Ray ray, const Scene& scene) { return {}; } -// methods adapated from https://users.cg.tuwien.ac.at/zsolnai/gfx/smallpaint/ -std::tuple orthogonal_system(const glm::vec3& v1) { +// methods adapted from https://users.cg.tuwien.ac.at/zsolnai/gfx/smallpaint/ +std::pair orthogonal_system(const glm::vec3& v1) { glm::vec3 v2; if (glm::abs(v1.x) > glm::abs(v1.y)) { // project to the y = 0 plane and construct a normalized orthogonal vector in this plane @@ -180,7 +180,7 @@ glm::vec3 hemisphere(const double u1, const double u2) { const double r = sqrt(1.0 - u1 * u1); const double phi = 2 * pi * u2; - return glm::vec3(cos(phi) * r, sin(phi) * r, u1); + return {cos(phi) * r, sin(phi) * r, u1}; } glm::vec3 reflect(const glm::vec3& I, const glm::vec3& N) {