mirror of
https://github.com/hannobraun/Fornjot
synced 2025-11-26 01:12:10 +00:00
Add Mesh::push_vertex
This commit is contained in:
parent
48c7a842a0
commit
e1f79bd171
@ -3,3 +3,9 @@ pub struct Mesh {
|
|||||||
pub vertices: Vec<[f32; 3]>,
|
pub vertices: Vec<[f32; 3]>,
|
||||||
pub triangles: Vec<[u32; 3]>,
|
pub triangles: Vec<[u32; 3]>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Mesh {
|
||||||
|
pub fn push_vertex(&mut self, vertex: [f32; 3]) {
|
||||||
|
self.vertices.push(vertex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ pub fn model() -> anyhow::Result<Mesh> {
|
|||||||
[-0.5, 0.5, 0.5], // 6
|
[-0.5, 0.5, 0.5], // 6
|
||||||
[0.5, 0.5, 0.5], // 7
|
[0.5, 0.5, 0.5], // 7
|
||||||
]
|
]
|
||||||
.map(|vertex| mesh.vertices.push(vertex));
|
.map(|vertex| mesh.push_vertex(vertex));
|
||||||
|
|
||||||
[
|
[
|
||||||
[0, 4, 6], // left
|
[0, 4, 6], // left
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user