mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-11 05:18:26 +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
|
let triangles = mesh
|
||||||
.triangles()
|
.triangles()
|
||||||
.iter()
|
|
||||||
.copied()
|
|
||||||
.map(|triangle| {
|
.map(|triangle| {
|
||||||
triangle.map(|index| {
|
triangle.map(|index| {
|
||||||
index.try_into().expect(
|
index.try_into().expect(
|
||||||
|
@ -9,8 +9,8 @@ impl Mesh {
|
|||||||
&self.vertices
|
&self.vertices
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn triangles(&self) -> &[Triangle] {
|
pub fn triangles(&self) -> impl Iterator<Item = Triangle> + '_ {
|
||||||
&self.triangles
|
self.triangles.iter().copied()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn push_vertex(&mut self, vertex: Vertex) {
|
pub fn push_vertex(&mut self, vertex: Vertex) {
|
||||||
|
@ -271,7 +271,7 @@ impl Renderer {
|
|||||||
render_pass.set_pipeline(&self.pipeline);
|
render_pass.set_pipeline(&self.pipeline);
|
||||||
render_pass.set_bind_group(0, &self.bind_group, &[]);
|
render_pass.set_bind_group(0, &self.bind_group, &[]);
|
||||||
render_pass.draw_indexed(
|
render_pass.draw_indexed(
|
||||||
0..mesh.triangles().len() as u32 * 3,
|
0..mesh.triangles().count() as u32 * 3,
|
||||||
0,
|
0,
|
||||||
0..1,
|
0..1,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user