diff options
Diffstat (limited to 'engine/src/mesh.rs')
-rw-r--r-- | engine/src/mesh.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/engine/src/mesh.rs b/engine/src/mesh.rs new file mode 100644 index 0000000..67b26cc --- /dev/null +++ b/engine/src/mesh.rs @@ -0,0 +1,29 @@ +use crate::vertex::Vertex; + +#[derive(Debug)] +pub struct Mesh +{ + vertices: Vec<Vertex>, + indices: Option<Vec<u32>>, +} + +impl Mesh +{ + #[must_use] + pub fn new(vertices: Vec<Vertex>, indices: Option<Vec<u32>>) -> 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() + } +} |