From 386aad9dac7c22cabb0f1bbba33d248c40bb0310 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 23 Oct 2023 22:23:25 +0200 Subject: feat(engine): add perspective --- engine/src/matrix.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engine/src/matrix.rs') 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 impl Matrix { + 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) { -- cgit v1.2.3-18-g5258