Files
Graphics-Rasterizer/Matrix.h
2021-12-11 13:18:04 +00:00

39 lines
921 B
C++

#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);
};