use crate::mesh::{CylinderMeshBuilder, Mesh};
#[deprecated(
since = "0.13.0",
note = "please use the `Cylinder` primitive in `bevy_math` instead"
)]
#[derive(Clone, Copy, Debug)]
pub struct Cylinder {
pub radius: f32,
pub height: f32,
pub resolution: u32,
pub segments: u32,
}
impl Default for Cylinder {
fn default() -> Self {
Self {
radius: 0.5,
height: 1.0,
resolution: 16,
segments: 1,
}
}
}
impl From<Cylinder> for Mesh {
fn from(c: Cylinder) -> Self {
CylinderMeshBuilder::new(c.radius, c.height, c.resolution)
.segments(c.segments)
.build()
}
}