Fixed Mat and CMakeLists
This commit is contained in:
parent
6522994a1f
commit
3970b8d402
@ -215,7 +215,7 @@ elseif (IS_OS_LINUX)
|
|||||||
src/io/Usb_LNX.cpp include/ehs/io/Usb_LNX.h
|
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")
|
if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland")
|
||||||
add_compile_definitions(EHS_WS_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)
|
if (IS_OS_LINUX)
|
||||||
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local")
|
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/.local")
|
||||||
|
install(TARGETS EHS_Dyn LIBRARY DESTINATION "bin")
|
||||||
elseif (IS_OS_WINDOWS)
|
elseif (IS_OS_WINDOWS)
|
||||||
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS")
|
set(CMAKE_INSTALL_PREFIX "${USER_HOME_DIRECTORY}/EHS")
|
||||||
|
install(TARGETS EHS_Dyn LIBRARY DESTINATION "lib")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
install(TARGETS EHS_Stc DESTINATION LIB)
|
install(TARGETS EHS_Stc DESTINATION "lib")
|
||||||
install(TARGETS EHS_Dyn RUNTIME DESTINATION BIN)
|
install(TARGETS EHS_Dyn RUNTIME DESTINATION "bin")
|
||||||
install(TARGETS EHS_Dyn LIBRARY DESTINATION LIB)
|
install(TARGETS StrToHash DESTINATION "bin")
|
||||||
install(TARGETS StrToHash DESTINATION BIN)
|
|
||||||
|
|
||||||
file(GLOB DLL_FILES "${CMAKE_CURRENT_BINARY_DIR}/*.dll")
|
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)
|
find_package(ZLIB REQUIRED)
|
||||||
if (ZLIB_FOUND)
|
if (ZLIB_FOUND)
|
||||||
@ -280,16 +281,20 @@ else ()
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_link_libraries(EHS_Stc OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB)
|
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)
|
if (IS_OS_WINDOWS)
|
||||||
|
target_link_libraries(EHS_Dyn avrt ws2_32)
|
||||||
target_link_libraries(StrToHash ws2_32 avrt EHS_Stc)
|
target_link_libraries(StrToHash ws2_32 avrt EHS_Stc)
|
||||||
elseif (IS_OS_LINUX)
|
elseif (IS_OS_LINUX)
|
||||||
if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland")
|
if (LINUX_WINDOW_SYSTEM STREQUAL "Wayland")
|
||||||
|
target_link_libraries(EHS_Dyn wayland-client)
|
||||||
target_link_libraries(StrToHash wayland-client)
|
target_link_libraries(StrToHash wayland-client)
|
||||||
elseif (LINUX_WINDOW_SYSTEM STREQUAL "XCB")
|
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)
|
target_link_libraries(StrToHash xcb xcb-cursor xcb-xfixes xcb-xinput)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
target_link_libraries(EHS_Dyn asound)
|
||||||
target_link_libraries(StrToHash z asound EHS_Stc)
|
target_link_libraries(StrToHash z asound EHS_Stc)
|
||||||
endif ()
|
endif ()
|
@ -332,14 +332,14 @@ namespace ehs
|
|||||||
|
|
||||||
static Mat4<T> YawRotate(const T angle)
|
static Mat4<T> YawRotate(const T angle)
|
||||||
{
|
{
|
||||||
T radians = Math::Rads(angle);
|
T radians = Math::Rads<T>(angle);
|
||||||
|
|
||||||
Mat4<T> result;
|
Mat4<T> result;
|
||||||
result.data[0] = Math::Cos(radians);
|
result.data[0] = Math::Cos<T>(radians);
|
||||||
result.data[2] = -Math::Sin(radians);
|
result.data[2] = -Math::Sin<T>(radians);
|
||||||
result.data[5] = 1;
|
result.data[5] = 1;
|
||||||
result.data[8] = Math::Sin(radians);
|
result.data[8] = Math::Sin<T>(radians);
|
||||||
result.data[10] = Math::Cos(radians);
|
result.data[10] = Math::Cos<T>(radians);
|
||||||
result.data[15] = 1;
|
result.data[15] = 1;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -347,7 +347,7 @@ namespace ehs
|
|||||||
|
|
||||||
static Mat4<T> RollRotate(const T angle)
|
static Mat4<T> RollRotate(const T angle)
|
||||||
{
|
{
|
||||||
T radians = Math::Rads(angle);
|
T radians = Math::Rads<T>(angle);
|
||||||
|
|
||||||
Mat4<T> result;
|
Mat4<T> result;
|
||||||
result.data[0] = Math::Cos(radians);
|
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)
|
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;
|
Mat4<T> result;
|
||||||
result[0] = 1.0f / (aspect * tanHalfFovy);
|
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)
|
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;
|
Mat4<T> result;
|
||||||
result[0] = 1.0f / (aspect * tanHalfFovy);
|
result[0] = 1.0f / (aspect * tanHalfFovy);
|
||||||
|
Loading…
Reference in New Issue
Block a user