diff options
author | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 12:09:49 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 12:09:49 +0300 |
commit | f704384b9938215f818c1c2006ad9b233c0d7c00 (patch) | |
tree | a6dae17c016229a1b4902584db2da7c725fdb9b8 /src/camera.rs | |
parent | a63a5fd647a2117885e70954181ea7164e470bb3 (diff) | |
download | pistol-f704384b9938215f818c1c2006ad9b233c0d7c00.tar.gz |
feat: increase screen size
Diffstat (limited to 'src/camera.rs')
-rw-r--r-- | src/camera.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/camera.rs b/src/camera.rs index d87abe2..30d338e 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -12,16 +12,16 @@ pub fn rotate_z(vec: Vector, angle: f32) -> Vector { } } -const WIDTH: i32 = 120; +const WIDTH: i32 = 180; const HEIGHT: i32 = 60; #[derive(Debug)] -pub struct Buffer (pub [[char; 120]; 60]); +pub struct Buffer (pub [[char; 180]; 60]); impl fmt::Display for Buffer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for i in 0..60 { - for j in 0..120 { + for j in 0..180 { write!(f, "{}", self.0[i][j])?; } writeln!(f)?; @@ -80,7 +80,8 @@ impl Camera { } pub fn rorate_around_point(& mut self, point: Vector) { - self.position = rotate_z(self.position - point, 2.0 * PI / 60.0) + point; + let rotations_per_round = 2.0; + self.position = rotate_z(self.position - point, rotations_per_round * 2.0 * PI / 60.0) + point; self.direction = (point - self.position).normalize(); } |