generated from freudenreichan/Programmieren_3b
gamematrix hinzufügen
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
#include "gamematrix.h"
|
||||
#include "raylib.h"
|
||||
#include <rlgl.h>
|
||||
|
||||
struct Vec3
|
||||
{
|
||||
float x, y, z;
|
||||
};
|
||||
|
||||
class gamecube
|
||||
{
|
||||
public:
|
||||
gamecube(const Vec3 &pos, Color col);
|
||||
void Update(float flipSpeed);
|
||||
void FlipForward();
|
||||
void FlipBackward();
|
||||
bool IsFlipped() const;
|
||||
bool IsMatched() const;
|
||||
void SetMatched(bool m);
|
||||
void Draw() const;
|
||||
Vec3 GetPosition() const;
|
||||
float GetRotationY() const;
|
||||
Color GetColor() const { return color; }
|
||||
|
||||
private:
|
||||
Vec3 position;
|
||||
Color color;
|
||||
bool flipped = false;
|
||||
bool matched = false;
|
||||
bool flippingForward = false;
|
||||
bool flippingBackward = false;
|
||||
float rotation = 0.0f;
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#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>& A,
|
||||
const std::array<std::array<double,4>,4>& B);
|
||||
|
||||
// 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);
|
||||
};
|
||||
Reference in New Issue
Block a user