Skip to content

Commit

Permalink
Fix index buffer capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf committed Feb 1, 2024
1 parent 536197c commit 611f844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_render/src/mesh/primitives/dim2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl Capsule2dMeshBuilder {
let vertex_count = 2 * self.resolution;

// Six extra indices for the two triangles between the hemicircles
let mut indices = Vec::with_capacity((vertex_count - 2) * 3 + 6);
let mut indices = Vec::with_capacity((self.resolution - 2) * 2 * 3 + 6);
let mut positions = Vec::with_capacity(vertex_count);
let normals = vec![[0.0, 0.0, 1.0]; vertex_count];
let mut uvs = Vec::with_capacity(vertex_count);
Expand Down

0 comments on commit 611f844

Please sign in to comment.