diff options
Diffstat (limited to 'engine/src/vertex.rs')
-rw-r--r-- | engine/src/vertex.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/engine/src/vertex.rs b/engine/src/vertex.rs index 37a6c51..456a2a3 100644 --- a/engine/src/vertex.rs +++ b/engine/src/vertex.rs @@ -1,6 +1,5 @@ use std::mem::size_of; -use crate::color::Color; use crate::vector::{Vec2, Vec3}; #[derive(Debug, Clone, Default)] @@ -8,7 +7,6 @@ use crate::vector::{Vec2, Vec3}; pub struct Vertex { pos: Vec3<f32>, - color: Color<f32>, texture_coords: Vec2<f32>, normal: Vec3<f32>, } @@ -17,7 +15,6 @@ pub struct Vertex pub struct Builder { pos: Option<Vec3<f32>>, - color: Option<Color<f32>>, texture_coords: Vec2<f32>, normal: Option<Vec3<f32>>, } @@ -39,14 +36,6 @@ impl Builder } #[must_use] - pub fn color(mut self, color: Color<f32>) -> Self - { - self.color = Some(color); - - self - } - - #[must_use] pub fn texture_coords(mut self, texture_coords: Vec2<f32>) -> Self { self.texture_coords = texture_coords; @@ -66,12 +55,10 @@ impl Builder pub fn build(self) -> Option<Vertex> { let pos = self.pos?; - let color = self.color.unwrap_or_default(); let normal = self.normal.unwrap_or_default(); Some(Vertex { pos, - color, texture_coords: self.texture_coords, normal, }) @@ -93,17 +80,11 @@ impl Vertex Attribute { index: 1, component_type: AttributeComponentType::Float, - component_cnt: AttributeComponentCnt::Three, - component_size: size_of::<f32>() as u32, - }, - Attribute { - index: 2, - component_type: AttributeComponentType::Float, component_cnt: AttributeComponentCnt::Two, component_size: size_of::<f32>() as u32, }, Attribute { - index: 3, + index: 2, component_type: AttributeComponentType::Float, component_cnt: AttributeComponentCnt::Three, component_size: size_of::<f32>() as u32, |