Bugs fixed. Funktioniert wie geplant. Ich erwarte eine Gehalsterhöhung Chef

This commit is contained in:
Legaeli 2025-11-04 08:33:08 +01:00
parent 3c5d04cbe3
commit 7eedd59f6f
12 changed files with 199 additions and 103 deletions

97
.idea/editor.xml generated
View File

@ -1,6 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BackendCodeEditorSettings">
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />

View File

@ -1 +0,0 @@
empty

Binary file not shown.

View File

@ -1,3 +1,3 @@
Start testing: Nov 03 17:09 Mitteleuropäische Zeit
Start testing: Nov 04 08:32 Mitteleuropäische Zeit
----------------------------------------------------------
End testing: Nov 03 17:09 Mitteleuropäische Zeit
End testing: Nov 04 08:32 Mitteleuropäische Zeit

View File

@ -44,11 +44,11 @@ void gamecube::Draw() const
rlPushMatrix();
// Matrizen für Rotation und Translation erzeugen
auto matrix_a = gameMatrix::translate({ position.x, position.y, position.z});
auto matrix_b = gameMatrix::rot3D(rotation, 'y');
auto matrix_a = Matrix3D::gameMatrix::translate({ position.x, position.y, position.z});
auto matrix_b = Matrix3D::gameMatrix::rot3D(rotation, 'y');
// Matrizen multiplizieren (Translation * Rotation)
auto model = gameMatrix::matmul(matrix_a, matrix_b);
auto model = Matrix3D::gameMatrix::matmul(matrix_a, matrix_b);
// transform for raylib matrix
float f[16];

View File

@ -1,88 +1,87 @@
#include "gamematrix.h"
namespace Matrix3D {
class gameMatrix {
public:
///
/// @param matrix1 - First matrix
/// @param matrix2 - Second matrix
/// @return Returns the multiplication of matrix 1 and matrix 2.
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& matrix1,
const std::array<std::array<double,4>,4>& matrix2) {
using namespace Matrix3D;
std::array<std::array<double,4>,4> matrix3 = {};
if (matrix1[0].size() != matrix2.size()) {
throw std::invalid_argument("Number of columns of matrix 1 must be equal to number of rows of matrix 2");
};
for (int i = 0; i < matrix1.size(); i++) {
std::array<double,4> temp_array = {};
for (int j = 0; j < matrix2[i].size(); j++) {
double temp = 0;
for (int k = 0; k < matrix2.size(); k++) {
temp += matrix1[i][k] * matrix2[k][j];
}
temp_array[j] = temp;
}
matrix3[i] = temp_array;
}
return matrix3;
}
///
/// @param angle_deg Rotation angle
/// @param axis Rotation axis (x, y, z)
/// @return Returns a rotation matrix based on a given angle and axis.
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis) {
if (axis != 'x' && axis != 'y' && axis != 'z') {
throw std::invalid_argument("Invalid axis");
};
const auto angle_rad = angle_deg * M_PI / 180;
std::array<std::array<double,4>,4> rotationMatrix = {};
switch (axis) {
case 'x': {
std::array<std::array<double,4>,4> rMx = {{
{1, 0, 0, 0},
{0, cos(angle_rad), -sin(angle_rad), 0},
{0, sin(angle_rad), cos(angle_rad), 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMx;
}
break;
case 'y': {
std::array<std::array<double,4>,4> rMy = {{
{cos(angle_rad), 0, sin(angle_rad), 0},
{0, 1, 0, 0},
{-sin(angle_rad), 0, cos(angle_rad), 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMy;
}
break;
case 'z': {
std::array<std::array<double,4>,4> rMz = {{
{cos(angle_rad), -sin(angle_rad), 0, 0},
{sin(angle_rad), cos(angle_rad), 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMz;
}
break;
}
return rotationMatrix;
};
///
/// @param pos 3 point vector (x, y, z)
/// @return Returns a 4x4 translation matrix base on a given vector.
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos) {
std::array<std::array<double,4>,4> transMatrix = {{{1, 0, 0, pos[0]}, {0, 1, 0, pos[1]}, {0, 0, 1, pos[2]}, {0, 0, 0, 1}}};
return transMatrix;
};
///
/// @param matrix1 - First matrix
/// @param matrix2 - Second matrix
/// @return Returns the multiplication of matrix 1 and matrix 2.
std::array<std::array<double,4>,4> gameMatrix::matmul(const std::array<std::array<double,4>,4>& matrix1,
const std::array<std::array<double,4>,4>& matrix2) {
std::array<std::array<double,4>,4> matrix3 = {};
if (matrix1[0].size() != matrix2.size()) {
throw std::invalid_argument("Number of columns of matrix 1 must be equal to number of rows of matrix 2");
};
for (int i = 0; i < matrix1.size(); i++) {
std::array<double,4> temp_array = {};
for (int j = 0; j < matrix2[i].size(); j++) {
double temp = 0;
for (int k = 0; k < matrix2.size(); k++) {
temp += matrix1[i][k] * matrix2[k][j];
}
temp_array[j] = temp;
}
matrix3[i] = temp_array;
}
return matrix3;
}
///
/// @param angle_deg Rotation angle
/// @param axis Rotation axis (x, y, z)
/// @return Returns a rotation matrix based on a given angle and axis.
std::array<std::array<double,4>,4> gameMatrix::rot3D(double angle_deg, char axis) {
if (axis != 'x' && axis != 'y' && axis != 'z') {
throw std::invalid_argument("Invalid axis");
};
const auto angle_rad = angle_deg * M_PI / 180;
std::array<std::array<double,4>,4> rotationMatrix = {};
switch (axis) {
case 'x': {
std::array<std::array<double,4>,4> rMx = {{
{1, 0, 0, 0},
{0, cos(angle_rad), -sin(angle_rad), 0},
{0, sin(angle_rad), cos(angle_rad), 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMx;
}
break;
case 'y': {
std::array<std::array<double,4>,4> rMy = {{
{cos(angle_rad), 0, sin(angle_rad), 0},
{0, 1, 0, 0},
{-sin(angle_rad), 0, cos(angle_rad), 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMy;
}
break;
case 'z': {
std::array<std::array<double,4>,4> rMz = {{
{cos(angle_rad), -sin(angle_rad), 0, 0},
{sin(angle_rad), cos(angle_rad), 0, 0},
{0, 0, 1, 0},
{0, 0, 0, 1}
}};
rotationMatrix = rMz;
}
break;
}
return rotationMatrix;
};
///
/// @param pos 3 point vector (x, y, z)
/// @return Returns a 4x4 translation matrix base on a given vector.
std::array<std::array<double,4>,4> gameMatrix::translate(const std::array<double, 3>& pos) {
std::array<std::array<double,4>,4> transMatrix = {{{1, 0, 0, pos[0]}, {0, 1, 0, pos[1]}, {0, 0, 1, pos[2]}, {0, 0, 0, 1}}};
return transMatrix;
};

View File

@ -4,21 +4,23 @@
#include <stdexcept>
#include <cmath>
class gameMatrix
{
public:
// Matrix Multiplikation
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& matrix1,
const std::array<std::array<double,4>,4>& matrix2);
namespace Matrix3D {
class gameMatrix
{
public:
// Matrix Multiplikation
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& matrix1,
const std::array<std::array<double,4>,4>& matrix2);
// Rotationsmatrix um Achse x/y/z
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis);
// 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);
// Verschiebung
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos);
private:
//TODO: Was für eine Rolle spielen Vec3 und Mat4???
struct Vec3 {double x,y,z;};
std::array<std::array<double,4>,4> Mat4 {};
};
private:
//TODO: Was für eine Rolle spielen Vec3 und Mat4???
struct Vec3 {double x,y,z;};
std::array<std::array<double,4>,4> Mat4 {};
};
}