mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Prepare for follow-on change
This commit is contained in:
parent
8fe493c8d1
commit
3ac70f4877
@ -12,8 +12,6 @@ pub fn export(mesh: &Mesh) -> anyhow::Result<()> {
|
||||
|
||||
let triangles = mesh
|
||||
.triangles()
|
||||
.iter()
|
||||
.copied()
|
||||
.map(|triangle| {
|
||||
triangle.map(|index| {
|
||||
index.try_into().expect(
|
||||
|
@ -9,8 +9,8 @@ impl Mesh {
|
||||
&self.vertices
|
||||
}
|
||||
|
||||
pub fn triangles(&self) -> &[Triangle] {
|
||||
&self.triangles
|
||||
pub fn triangles(&self) -> impl Iterator<Item = Triangle> + '_ {
|
||||
self.triangles.iter().copied()
|
||||
}
|
||||
|
||||
pub fn push_vertex(&mut self, vertex: Vertex) {
|
||||
|
@ -271,7 +271,7 @@ impl Renderer {
|
||||
render_pass.set_pipeline(&self.pipeline);
|
||||
render_pass.set_bind_group(0, &self.bind_group, &[]);
|
||||
render_pass.draw_indexed(
|
||||
0..mesh.triangles().len() as u32 * 3,
|
||||
0..mesh.triangles().count() as u32 * 3,
|
||||
0,
|
||||
0..1,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user