Files
Graphics-Rasterizer/Matrix.h
IDunnoDev 19639d70d1 Week6 [02/11] - [04/11]
Added Camera Class
Added *= operator to the matrix class
Added Transformation Queue vector to the Model Class
Added Get Vertex, Polygon and Polygon Vertex methods to the Model Class
Added DehomogenizeAllVerticies method to the Model Class
Added GetPolygonVertexCount method to Polygon Class
Added Ability to have multiple models in a "scene" in the Rasterizer
Added DrawWireFrame method to the Rasterizer Class
Added Aspect Ratio and View Matrix to the Rasterizer Class
Added TransformTools namespace to hold shared transformation functions
Added Dehomogenize method to the Vector Class
Moved Transformation methods to a new shared name space
2021-12-11 14:15:02 +00:00

42 lines
989 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);
};