Fixed Mat and CMakeLists

This commit is contained in:
Arron David Nelson 2024-07-27 18:51:19 -07:00
parent 6522994a1f
commit 3970b8d402
2 changed files with 21 additions and 16 deletions

View File

@ -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 ()

View File

@ -332,14 +332,14 @@ namespace ehs
static Mat4<T> YawRotate(const T angle)
{
T radians = Math::Rads(angle);
T radians = Math::Rads<T>(angle);
Mat4<T> result;
result.data[0] = Math::Cos(radians);
result.data[2] = -Math::Sin(radians);
result.data[0] = Math::Cos<T>(radians);
result.data[2] = -Math::Sin<T>(radians);
result.data[5] = 1;
result.data[8] = Math::Sin(radians);
result.data[10] = Math::Cos(radians);
result.data[8] = Math::Sin<T>(radians);
result.data[10] = Math::Cos<T>(radians);
result.data[15] = 1;
return result;
@ -347,7 +347,7 @@ namespace ehs
static Mat4<T> RollRotate(const T angle)
{
T radians = Math::Rads(angle);
T radians = Math::Rads<T>(angle);
Mat4<T> result;
result.data[0] = Math::Cos(radians);
@ -367,7 +367,7 @@ namespace ehs
static Mat4<T> 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<T>(Math::Rads(fov) / 2.0f);
Mat4<T> result;
result[0] = 1.0f / (aspect * tanHalfFovy);
@ -380,7 +380,7 @@ namespace ehs
static Mat4<T> 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<T>(Math::Rads(fov) / 2.0f);
Mat4<T> result;
result[0] = 1.0f / (aspect * tanHalfFovy);