From 9ce6f05ba71b4d72b96e7d642afa16f3a0eca3fe Mon Sep 17 00:00:00 2001 From: webbaer Date: Mon, 24 Nov 2025 17:12:30 +0100 Subject: [PATCH] fixed version von main.cpp und gamematrix.cpp --- src/gamematrix.cpp | 10 ++++------ src/main.cpp | 12 +++++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gamematrix.cpp b/src/gamematrix.cpp index ad99c98..028c1f2 100644 --- a/src/gamematrix.cpp +++ b/src/gamematrix.cpp @@ -1,8 +1,8 @@ #include -static std::array,4> gameMatrix::matmul(const std::array,4>& A, - const std::array,4>& B);{ +std::array,4> gameMatrix::matmul(const std::array,4>& A, + const std::array,4>& B) { std::array,4> result{}; for (int i = 0; i < 4; ++i) { @@ -19,8 +19,7 @@ static std::array,4> gameMatrix::matmul(const std::array,4> gameMatrix::rot3D(double angle_deg, char axis); -{ +std::array,4> gameMatrix::rot3D(double angle_deg, char axis) { double angle = angle_deg * M_PI / 180.0; // Grad → Radiant double c = std::cos(angle); double s = std::sin(angle); @@ -61,8 +60,7 @@ static std::array,4> gameMatrix::rot3D(double angle_deg, ch return R; } -static std::array,4> gameMatrix::translate(const std::array& pos); -{ +std::array,4> gameMatrix::translate(const std::array& pos) { std::array,4> T{{ {1, 0, 0, pos[0]}, {0, 1, 0, pos[1]}, diff --git a/src/main.cpp b/src/main.cpp index 650003f..7ceea07 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -#include "../../prog_3/includes/gamecube.h" +#include "gamecube.h" #include #include @@ -21,15 +21,17 @@ int main() camera.fovy = 45.0f; camera.projection = CAMERA_PERSPECTIVE; + // cubePairs = {}; // Nur 3 Farben für 3 Paare - Color colors[] = { RED, GREEN, BLUE }; + Color colors[] = { RED, GREEN, BLUE, YELLOW, PINK }; // 6 Karten-Positionen im 3x2 Raster - std::vector positions = {{-2, 0, -2}, {0, 0, -2}, {2, 0, -2},{-2, 0, 0}, {0, 0, 0}, {2, 0, 0}}; + std::vector positions = {{-2, 0, -2}, {0, 0, -2}, {2, 0, -2},{-2, 0, 0}, {0, 0, 0}, + {2, 0, 0},{2,0,-4},{0,0,-4},{-2,0,-4},{-4,0,-2}}; // Farben doppelt in einen Pool legen und mischen std::vector colorPool; - for (int i = 0; i < 3; i++) + for (int i = 0; i <5; i++) { colorPool.push_back(colors[i]); colorPool.push_back(colors[i]); @@ -44,7 +46,7 @@ int main() // Karten/Würfel erstellen std::vector cubes; - for (int i = 0; i < 6; i++) + for (int i = 0; i < 10; i++) cubes.emplace_back(positions[i], colorPool[i]); gamecube* first = nullptr;