Files
Graphics-Rasterizer/Matrix.h
IDunnoDev cdb940f6aa Week10 [30/11] - [06/12]
Added active Variable to the Lights Classes
Added updated MD2Loader Class
Added Model Filename and Texture File Name to the Model Class
Added Active Flag to the Model Class
Added DrawMode to the Model Class
Added Texture and UV Variables to the Model Class
Added UV Coordinates to the Polygon3D Class
Added DrawString method to the Rasterizer to write text to the screen space
Added Interpolate and Lerp Methods to the Rasterizer
Added Select statement for drawing a current models draw mode
Added DrawTextured Method to the Rasterizer Class
Added UVCoord Class
Added Texture Class
Added = operator to the Vector3D Class
Added UVCoord to the Vertex Class
Moved Models and Texture Files into a subfolder
Fixed issue with textures not loading properly because of the vector address problem
2021-12-11 20:31:39 +00:00

41 lines
988 B
C++

#pragma once
#include "Vertex.h"
#include <initializer_list>
// Size of the matrix
const int COLS = 4;
const int ROWS = 4;
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 IdentityMatrix();
Matrix& operator= (const Matrix& rhs);
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);
};