diff options
Diffstat (limited to 'engine/src/material.rs')
-rw-r--r-- | engine/src/material.rs | 68 |
1 files changed, 9 insertions, 59 deletions
diff --git a/engine/src/material.rs b/engine/src/material.rs index f71cee5..5e360cd 100644 --- a/engine/src/material.rs +++ b/engine/src/material.rs @@ -5,67 +5,17 @@ use crate::data_types::dimens::Dimens; use crate::texture::{Id as TextureId, Texture}; #[derive(Debug, Clone, Component)] +#[non_exhaustive] pub struct Material { - ambient: Color<f32>, - diffuse: Color<f32>, - specular: Color<f32>, - ambient_map: TextureId, - diffuse_map: TextureId, - specular_map: TextureId, - textures: Vec<Texture>, - shininess: f32, -} - -impl Material -{ - #[must_use] - pub fn ambient(&self) -> &Color<f32> - { - &self.ambient - } - - #[must_use] - pub fn diffuse(&self) -> &Color<f32> - { - &self.diffuse - } - - #[must_use] - pub fn specular(&self) -> &Color<f32> - { - &self.specular - } - - #[must_use] - pub fn ambient_map(&self) -> &TextureId - { - &self.ambient_map - } - - #[must_use] - pub fn diffuse_map(&self) -> &TextureId - { - &self.diffuse_map - } - - #[must_use] - pub fn specular_map(&self) -> &TextureId - { - &self.specular_map - } - - #[must_use] - pub fn textures(&self) -> &[Texture] - { - &self.textures - } - - #[must_use] - pub fn shininess(&self) -> f32 - { - self.shininess - } + pub ambient: Color<f32>, + pub diffuse: Color<f32>, + pub specular: Color<f32>, + pub ambient_map: TextureId, + pub diffuse_map: TextureId, + pub specular_map: TextureId, + pub textures: Vec<Texture>, + pub shininess: f32, } /// [`Material`] builder. |