Fixing merge commit
This commit is contained in:
commit
a239ad83cc
@ -8,71 +8,37 @@ set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
# Set the default build type if not specified
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
||||
endif()
|
||||
|
||||
set(SRC_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/gamecube.cpp
|
||||
src/main.cpp
|
||||
src/gamecube.cpp
|
||||
src/gamematrix.cpp
|
||||
)
|
||||
|
||||
set(INCLUDE_DIRS
|
||||
#set(INCLUDE_DIRS
|
||||
# ${CMAKE_CURRENT_LIST_DIR}/linux
|
||||
#)
|
||||
|
||||
add_executable(${EXECUTABLE_NAME} ${SRC_FILES})
|
||||
#target_include_directories(${EXECUTABLE_NAME} PRIVATE ${INCLUDE_DIRS})
|
||||
target_include_directories(Prog3B PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/includes
|
||||
${CMAKE_CURRENT_LIST_DIR}/linux
|
||||
${CMAKE_CURRENT_LIST_DIR}/raylib
|
||||
)
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/raylib)
|
||||
add_executable(${EXECUTABLE_NAME} ${SRC_FILES})
|
||||
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${INCLUDE_DIRS})
|
||||
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/windows/libgamematrix.a
|
||||
#${CMAKE_CURRENT_LIST_DIR}/windows/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/windows/libraylib.a
|
||||
opengl32
|
||||
gdi32
|
||||
m
|
||||
winmm
|
||||
)
|
||||
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_x86/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_x86/libraylib.a
|
||||
)
|
||||
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_arm/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_arm/libraylib.a
|
||||
)
|
||||
|
||||
# Checks if OSX and links appropriate frameworks (Only required on MacOS)
|
||||
if (APPLE)
|
||||
target_link_libraries(Prog3B "-framework IOKit")
|
||||
target_link_libraries(Prog3B "-framework Cocoa")
|
||||
target_link_libraries(Prog3B "-framework OpenGL")
|
||||
target_link_libraries(Prog3B "-framework IOKit")
|
||||
target_link_libraries(Prog3B "-framework Cocoa")
|
||||
target_link_libraries(Prog3B "-framework OpenGL")
|
||||
endif()
|
||||
|
||||
add_executable(tests
|
||||
src/tests.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/src/gamecube.cpp
|
||||
)
|
||||
target_include_directories(tests PRIVATE ${INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(tests PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/windows/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/windows/libraylib.a
|
||||
opengl32
|
||||
gdi32
|
||||
winmm
|
||||
)
|
||||
target_link_libraries(tests PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_x86/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_x86/libraylib.a
|
||||
)
|
||||
target_link_libraries(tests PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_arm/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/mac_arm/libraylib.a
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(Prog3B PRIVATE "-framework IOKit")
|
||||
target_link_libraries(Prog3B PRIVATE "-framework Cocoa")
|
||||
target_link_libraries(Prog3B PRIVATE "-framework OpenGL")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
@ -4,16 +4,20 @@
|
||||
#include <stdexcept>
|
||||
#include <cmath>
|
||||
|
||||
class gameMatrix
|
||||
namespace Matrix3D
|
||||
{
|
||||
public:
|
||||
// Matrix Multiplikation
|
||||
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& A,
|
||||
const std::array<std::array<double,4>,4>& B);
|
||||
using Vec3 = std::array<double, 3>;
|
||||
using Vec4 = std::array<double, 4>;
|
||||
using Mat4 = std::array<std::array<double, 4>, 4>;
|
||||
|
||||
// Rotationsmatrix um Achse x/y/z
|
||||
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis);
|
||||
|
||||
// Verschiebung
|
||||
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos);
|
||||
};
|
||||
class gameMatrix
|
||||
{
|
||||
public:
|
||||
static Mat4 identity();
|
||||
static Mat4 matmul(const Mat4& A, const Mat4& B);
|
||||
static Mat4 translate(const Vec3& pos);
|
||||
static Mat4 rot3D(double angle_deg, char axis);
|
||||
};
|
||||
Mat4 operator*(const Mat4& A, const Mat4& B);
|
||||
Vec3 operator*(const Mat4& m, const Vec3& v);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user