From 3970b8d402c0b47d35e0a7418faf4426ec0a98b5 Mon Sep 17 00:00:00 2001 From: Karutoh Date: Sat, 27 Jul 2024 18:51:19 -0700 Subject: [PATCH] Fixed Mat and CMakeLists --- CMakeLists.txt | 21 +++++++++++++-------- include/ehs/Mat4.h | 16 ++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd0f2b1..2651d36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,7 +215,7 @@ elseif (IS_OS_LINUX) src/io/Usb_LNX.cpp include/ehs/io/Usb_LNX.h ) - set(LINUX_WINDOW_SYSTEM "Wayland" CACHE STRING "Linux Window System") + #set(LINUX_WINDOW_SYSTEM "Wayland" CACHE STRING "Linux Window System") if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland") add_compile_definitions(EHS_WS_WAYLAND) @@ -251,19 +251,20 @@ target_include_directories(EHS_Dyn PUBLIC ${PROJECT_SOURCE_DIR}/include) if (IS_OS_LINUX) set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local") + install(TARGETS EHS_Dyn LIBRARY DESTINATION "bin") elseif (IS_OS_WINDOWS) set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS") + install(TARGETS EHS_Dyn LIBRARY DESTINATION "lib") endif () -install(TARGETS EHS_Stc DESTINATION LIB) -install(TARGETS EHS_Dyn RUNTIME DESTINATION BIN) -install(TARGETS EHS_Dyn LIBRARY DESTINATION LIB) -install(TARGETS StrToHash DESTINATION BIN) +install(TARGETS EHS_Stc DESTINATION "lib") +install(TARGETS EHS_Dyn RUNTIME DESTINATION "bin") +install(TARGETS StrToHash DESTINATION "bin") file(GLOB DLL_FILES "${CMAKE_CURRENT_BINARY_DIR}/*.dll") -install(FILES ${DLL_FILES} DESTINATION BIN) +install(FILES ${DLL_FILES} DESTINATION "bin") -install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION INCLUDE) +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION "include") find_package(ZLIB REQUIRED) if (ZLIB_FOUND) @@ -280,16 +281,20 @@ else () endif () target_link_libraries(EHS_Stc OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) -target_link_libraries(EHS_Dyn OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB avrt ws2_32) +target_link_libraries(EHS_Dyn OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB) if (IS_OS_WINDOWS) + target_link_libraries(EHS_Dyn avrt ws2_32) target_link_libraries(StrToHash ws2_32 avrt EHS_Stc) elseif (IS_OS_LINUX) if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland") + target_link_libraries(EHS_Dyn wayland-client) target_link_libraries(StrToHash wayland-client) elseif (LINUX_WINDOW_SYSTEM STREQUAL "XCB") + target_link_libraries(EHS_Dyn xcb xcb-cursor xcb-xfixes xcb-xinput) target_link_libraries(StrToHash xcb xcb-cursor xcb-xfixes xcb-xinput) endif () + target_link_libraries(EHS_Dyn asound) target_link_libraries(StrToHash z asound EHS_Stc) endif () \ No newline at end of file diff --git a/include/ehs/Mat4.h b/include/ehs/Mat4.h index a2b620d..91c38dc 100644 --- a/include/ehs/Mat4.h +++ b/include/ehs/Mat4.h @@ -332,14 +332,14 @@ namespace ehs static Mat4 YawRotate(const T angle) { - T radians = Math::Rads(angle); + T radians = Math::Rads(angle); Mat4 result; - result.data[0] = Math::Cos(radians); - result.data[2] = -Math::Sin(radians); + result.data[0] = Math::Cos(radians); + result.data[2] = -Math::Sin(radians); result.data[5] = 1; - result.data[8] = Math::Sin(radians); - result.data[10] = Math::Cos(radians); + result.data[8] = Math::Sin(radians); + result.data[10] = Math::Cos(radians); result.data[15] = 1; return result; @@ -347,7 +347,7 @@ namespace ehs static Mat4 RollRotate(const T angle) { - T radians = Math::Rads(angle); + T radians = Math::Rads(angle); Mat4 result; result.data[0] = Math::Cos(radians); @@ -367,7 +367,7 @@ namespace ehs static Mat4 RH_Perspective(const T fov, const T aspect, const T zNear, const T zFar) { - const float tanHalfFovy = tan(Math::Rads(fov) / 2.0f); + const T tanHalfFovy = Math::Tan(Math::Rads(fov) / 2.0f); Mat4 result; result[0] = 1.0f / (aspect * tanHalfFovy); @@ -380,7 +380,7 @@ namespace ehs static Mat4 LH_Perspective(const T fov, const T aspect, const T zNear, const T zFar) { - const float tanHalfFovy = Math::Tan(Math::Rads(fov) / 2.0f); + const T tanHalfFovy = Math::Tan(Math::Rads(fov) / 2.0f); Mat4 result; result[0] = 1.0f / (aspect * tanHalfFovy);