added some methods

This commit is contained in:
2024-05-07 02:12:16 +03:00
parent 4827f80257
commit 8765f83434
3 changed files with 16 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ namespace uml
at(i, j) = other.at(i, j);
}
matrix::matrix(const size_t rows, const size_t columns, float *pRaw)
matrix::matrix(const size_t rows, const size_t columns, const float *pRaw)
{
m_rows = rows;
m_columns = columns;
@@ -285,4 +285,15 @@ namespace uml
{screenWidth / 2.f, screenHeight / 2.f, 0.f, 1.f},
});
}
const float * matrix::raw() const
{
return m_pData.get();
}
void matrix::set_from_raw(const float *pRawMatrix)
{
for (size_t i = 0; i < m_columns*m_rows; ++i)
at(i / m_rows, i % m_columns) = pRawMatrix[i];
}
}