We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7820b5e commit 60709c5Copy full SHA for 60709c5
crates/bevy_render/src/mesh/shape/cone.rs
@@ -40,6 +40,7 @@ impl From<Cone> for Mesh {
40
fn from(c: Cone) -> Self {
41
debug_assert!(c.top_radius >= 0.0);
42
debug_assert!(c.bottom_radius >= 0.0);
43
+ debug_assert!(!(c.bottom_radius == 0.0 && c.top_radius == 0.0));
44
debug_assert!(c.height > 0.0);
45
debug_assert!(c.resolution > 2);
46
debug_assert!(c.segments > 0);
@@ -107,6 +108,10 @@ impl From<Cone> for Mesh {
107
108
109
let radius = if top { c.top_radius } else { c.bottom_radius };
110
111
+ if radius == 0.0 {
112
+ return;
113
+ }
114
+
115
for i in 0..c.resolution {
116
let theta = i as f32 * step_theta;
117
let (sin, cos) = theta.sin_cos();
0 commit comments