From 02c1238dc87d319b198a110b9d4d6551927753ee Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Sun, 10 Dec 2023 17:37:18 +0000 Subject: [PATCH] Explain how Circle mesh is generated --- crates/bevy_render/src/mesh/shape/regular_polygon.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bevy_render/src/mesh/shape/regular_polygon.rs b/crates/bevy_render/src/mesh/shape/regular_polygon.rs index c2e86368b15f3..879c59fabd11e 100644 --- a/crates/bevy_render/src/mesh/shape/regular_polygon.rs +++ b/crates/bevy_render/src/mesh/shape/regular_polygon.rs @@ -50,6 +50,8 @@ impl From for Mesh { let mut indices = Vec::with_capacity((sides - 2) * 3); for i in 1..(sides as u32 - 1) { + // Vertices are generated in CW order above, hence the reversed indices here + // to emit triangle vertices in CCW order. indices.extend_from_slice(&[0, i + 1, i]); }