diff options
author | HampusM <hampus@hampusmat.com> | 2023-10-23 22:23:25 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-10-23 22:23:25 +0200 |
commit | 386aad9dac7c22cabb0f1bbba33d248c40bb0310 (patch) | |
tree | 1f4379ab50ffc85e9ad511b9fe9e9dd8a7f8c321 /engine/src/matrix.rs | |
parent | fee2320189d6e758748a939c56d539043cbffde6 (diff) |
feat(engine): add perspective
Diffstat (limited to 'engine/src/matrix.rs')
-rw-r--r-- | engine/src/matrix.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/src/matrix.rs b/engine/src/matrix.rs index 7e161f2..c060b59 100644 --- a/engine/src/matrix.rs +++ b/engine/src/matrix.rs @@ -10,6 +10,15 @@ pub struct Matrix<Value, const ROWS: usize, const COLUMNS: usize> impl<Value, const ROWS: usize, const COLUMNS: usize> Matrix<Value, ROWS, COLUMNS> { + pub fn new() -> Self + where + Value: Default + Copy, + { + Self { + items: [[Value::default(); ROWS]; COLUMNS], + } + } + /// Sets the value at the specified cell. pub fn set_cell(&mut self, row: usize, column: usize, value: Value) { |