use crate::tuples::Color; #[derive(Debug, PartialEq)] pub struct Material { pub color: Color, pub ambient: f32, pub diffuse: f32, pub specular: f32, pub shininess: f32, } impl Default for Material { /// Creates the default material. /// /// # Examples /// ``` /// use rtchallenge::{materials::Material, tuples::Color}; /// /// let m = Material::default(); /// assert_eq!( /// m, /// Material { /// color: Color::new(1., 1., 1.), /// ambient: 0.1, /// diffuse: 0.9, /// specular: 0.9, /// shininess: 200., /// } /// ); /// ``` fn default() -> Material { Material { color: Color::new(1., 1., 1.), ambient: 0.1, diffuse: 0.9, specular: 0.9, shininess: 200., } } }