diff --git a/Matrix.h b/Matrix.h index b9b9d18..314b0a0 100644 --- a/Matrix.h +++ b/Matrix.h @@ -7,7 +7,7 @@ template class MatrixOf { public: MatrixOf(unsigned int rows, unsigned int cols); - MatrixOf(unsigned int rows, unsigned int cols, T *source) + MatrixOf(unsigned int rows, unsigned int cols, const T *source) : MatrixOf(rows, cols) { Set(source); } @@ -60,7 +60,7 @@ public: static Vector3 Multiply(const MatrixOf *m, Vector3 v); Vector3 operator*(const Vector3 v) const; - T Get(unsigned int rowIx, unsigned int colIx) { + T Get(unsigned int rowIx, unsigned int colIx) const { unsigned int dataIx = rowIx * this->cols + colIx; return this->data[dataIx]; } @@ -71,7 +71,7 @@ public: } // This function does not check on source size! - void Set(T *source) { + void Set(const T *source) { unsigned int matrixSize = this->cols * this->rows; for (unsigned int dataIx = 0; dataIx < matrixSize; dataIx++) this->data[dataIx] = source[dataIx];