fixed version von main.cpp und gamematrix.cpp
This commit is contained in:
parent
ad3ae081a9
commit
7666d43cfc
@ -1,8 +1,8 @@
|
|||||||
#include <gamematrix.h>
|
#include <gamematrix.h>
|
||||||
|
|
||||||
|
|
||||||
static std::array<std::array<double,4>,4> gameMatrix::matmul(const std::array<std::array<double,4>,4>& A,
|
std::array<std::array<double,4>,4> gameMatrix::matmul(const std::array<std::array<double,4>,4>& A,
|
||||||
const std::array<std::array<double,4>,4>& B);{
|
const std::array<std::array<double,4>,4>& B) {
|
||||||
std::array<std::array<double,4>,4> result{};
|
std::array<std::array<double,4>,4> result{};
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
@ -19,8 +19,7 @@ static std::array<std::array<double,4>,4> gameMatrix::matmul(const std::array<st
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static std::array<std::array<double,4>,4> gameMatrix::rot3D(double angle_deg, char axis);
|
std::array<std::array<double,4>,4> gameMatrix::rot3D(double angle_deg, char axis) {
|
||||||
{
|
|
||||||
double angle = angle_deg * M_PI / 180.0; // Grad → Radiant
|
double angle = angle_deg * M_PI / 180.0; // Grad → Radiant
|
||||||
double c = std::cos(angle);
|
double c = std::cos(angle);
|
||||||
double s = std::sin(angle);
|
double s = std::sin(angle);
|
||||||
@ -61,8 +60,7 @@ static std::array<std::array<double,4>,4> gameMatrix::rot3D(double angle_deg, ch
|
|||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<std::array<double,4>,4> gameMatrix::translate(const std::array<double, 3>& pos);
|
std::array<std::array<double,4>,4> gameMatrix::translate(const std::array<double, 3>& pos) {
|
||||||
{
|
|
||||||
std::array<std::array<double,4>,4> T{{
|
std::array<std::array<double,4>,4> T{{
|
||||||
{1, 0, 0, pos[0]},
|
{1, 0, 0, pos[0]},
|
||||||
{0, 1, 0, pos[1]},
|
{0, 1, 0, pos[1]},
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "../../prog_3/includes/gamecube.h"
|
#include "gamecube.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user