blob: e07ed3519080a2170f3918a535e6cc7a3ac16e97 (
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
30
31
|
use ecs::Component;
use crate::vertex::Vertex;
#[derive(Debug, Clone, Component)]
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()
}
}
|