use ecs::Component; use crate::vertex::Vertex; #[derive(Debug, Clone, Component)] pub struct Mesh { vertices: Vec, indices: Option>, } impl Mesh { #[must_use] pub fn new(vertices: Vec, indices: Option>) -> Self { Self { vertices, indices } } #[must_use] pub fn vertices(&self) -> &[Vertex] { &self.vertices } #[must_use] pub fn indices(&self) -> Option<&[u32]> { self.indices.as_deref() } }