Initial Upload Week 4 [19/10]

This commit is contained in:
IDunnoDev
2021-12-11 13:18:04 +00:00
committed by iDunnoDev
parent 608719d73f
commit 7c62126ede
18 changed files with 1170 additions and 0 deletions

38
Matrix.h Normal file
View File

@ -0,0 +1,38 @@
#pragma once
#include "Vertex.h"
#include <initializer_list>
// Size of the matrix
const int COLS = 3;
const int ROWS = 3;
class Matrix
{
public:
Matrix();
Matrix(std::initializer_list<float> inputList);
// Take in an array of floats matching the cols and rows
Matrix(const float arrayIn[ROWS][COLS]);
Matrix(const Matrix& other);
~Matrix();
float GetM(const int row, const int column) const;
float GetMatrixCell(const int row, const int column) const;
void SetM(const int row, const int column, const float value);
void SetMatrixCell(const int row, const int column, const float value);
void FromArray(const float arrayIn[ROWS][COLS]);
Matrix& operator= (const Matrix& rhs);
bool operator==(const Matrix& other) const;
const Matrix operator*(const Matrix& other) const;
const Vertex operator*(const Vertex& other) const;
private:
float _matrix[ROWS][COLS];
void Copy(const Matrix& other);
};