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
|
# Set the default build type if not specified
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
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()
|
endif()
|
||||||
|
|
||||||
set(SRC_FILES
|
set(SRC_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
|
src/main.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/gamecube.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}/includes
|
||||||
${CMAKE_CURRENT_LIST_DIR}/linux
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/raylib
|
${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
|
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
|
${CMAKE_CURRENT_LIST_DIR}/windows/libraylib.a
|
||||||
opengl32
|
opengl32
|
||||||
gdi32
|
gdi32
|
||||||
|
m
|
||||||
winmm
|
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)
|
# Checks if OSX and links appropriate frameworks (Only required on MacOS)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
target_link_libraries(Prog3B "-framework IOKit")
|
target_link_libraries(Prog3B "-framework IOKit")
|
||||||
target_link_libraries(Prog3B "-framework Cocoa")
|
target_link_libraries(Prog3B "-framework Cocoa")
|
||||||
target_link_libraries(Prog3B "-framework OpenGL")
|
target_link_libraries(Prog3B "-framework OpenGL")
|
||||||
endif()
|
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 <stdexcept>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
class gameMatrix
|
namespace Matrix3D
|
||||||
{
|
{
|
||||||
public:
|
using Vec3 = std::array<double, 3>;
|
||||||
// Matrix Multiplikation
|
using Vec4 = std::array<double, 4>;
|
||||||
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& A,
|
using Mat4 = std::array<std::array<double, 4>, 4>;
|
||||||
const std::array<std::array<double,4>,4>& B);
|
|
||||||
|
|
||||||
// Rotationsmatrix um Achse x/y/z
|
class gameMatrix
|
||||||
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis);
|
{
|
||||||
|
public:
|
||||||
// Verschiebung
|
static Mat4 identity();
|
||||||
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos);
|
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