csci5607/assignment-1/src/scene_data.rs

40 lines
597 B
Rust
Raw Normal View History

2023-01-31 07:38:03 +00:00
use crate::vec3::Vec3;
2023-01-31 07:15:22 +00:00
2023-01-31 19:50:23 +00:00
#[derive(Debug)]
2023-01-31 07:15:22 +00:00
pub struct Sphere {
pub center: Vec3,
pub radius: f64,
}
2023-01-31 19:50:23 +00:00
#[derive(Debug)]
2023-01-31 07:15:22 +00:00
pub enum Object {
Sphere(Sphere),
Cylinder {
center: Vec3,
direction: Vec3,
radius: f64,
length: f64,
},
}
2023-01-31 19:50:23 +00:00
#[derive(Debug, Default)]
2023-01-31 07:15:22 +00:00
pub struct Scene {
pub eye_pos: Vec3,
pub view_dir: Vec3,
pub up_dir: Vec3,
/// Horizontal field of view (in degrees)
pub hfov: f64,
pub image_width: usize,
pub image_height: usize,
/// Background color
pub bkg_color: Vec3,
/// Material color
pub mtl_color: Vec3,
pub objects: Vec<Object>,
}