Fix Windows build
FindGLM now properly searches newer glm packages which doesn't include a "include" folder.
This commit is contained in:
parent
0d89859176
commit
101a20443e
3 changed files with 6 additions and 2 deletions
|
@ -21,7 +21,7 @@ add_executable(raytracer
|
|||
src/main.cpp
|
||||
src/scene.cpp)
|
||||
target_include_directories(raytracer PUBLIC include PRIVATE ${GLM_INCLUDE_DIR})
|
||||
target_link_libraries(raytracer PUBLIC stb SDL2::Core imgui glad)
|
||||
target_link_libraries(raytracer PUBLIC stb SDL2::Main imgui glad)
|
||||
set_target_properties(raytracer PROPERTIES
|
||||
CXX_STANDARD 17
|
||||
CXX_STANDARD_REQUIRED YES
|
||||
|
|
|
@ -25,6 +25,7 @@ if (WIN32)
|
|||
PATHS
|
||||
$ENV{PROGRAMFILES}/include
|
||||
${GLM_ROOT_DIR}/include
|
||||
${GLM_ROOT_DIR}
|
||||
DOC "The directory where glm/glm.hpp resides")
|
||||
else()
|
||||
# Find include files
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "scene.h"
|
||||
|
||||
#include <glm/gtx/perpendicular.hpp>
|
||||
#include <functional>
|
||||
|
||||
constexpr double pi = 3.14159265358979323846l;
|
||||
|
||||
|
@ -112,6 +113,8 @@ Node<T>* find_hit_ray_search(Node<T>& node, const Ray ray, std::vector<Node<T>*>
|
|||
out->push_back(&node);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -161,7 +164,7 @@ std::tuple<glm::vec3, glm::vec3> orthogonal_system(const glm::vec3& v1) {
|
|||
|
||||
glm::vec3 hemisphere(const double u1, const double u2) {
|
||||
const double r = sqrt(1.0 - u1 * u1);
|
||||
const double phi = 2 * M_PI * u2;
|
||||
const double phi = 2 * pi * u2;
|
||||
|
||||
return glm::vec3(cos(phi) * r, sin(phi) * r, u1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue