Add percent complete readout in terminal
This commit is contained in:
@@ -58,6 +58,14 @@ impl PerspectiveCamera {
|
||||
dir: Vec3::new(sensor_x, sensor_y, 1.0).normalize(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn percent_complete(&self, row: u32) -> f64 {
|
||||
let float_row = row as f64;
|
||||
let float_scene_height = self.scene_height as f64;
|
||||
let float_scene_width = self.scene_width as f64;
|
||||
|
||||
((float_row * float_scene_width) / (float_scene_width * float_scene_height)) * 100.0
|
||||
}
|
||||
}
|
||||
|
||||
impl RaySource for PerspectiveCamera {
|
||||
|
||||
Reference in New Issue
Block a user