blob: 67b26cc2807f775f6be7d5276ac572273bea9de0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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()
}
}
|