bevy_rapier3d/geometry/shape_views/
cone.rs1use crate::math::Real;
2use rapier::parry::shape::Cone;
3
4#[derive(Copy, Clone)]
6pub struct ConeView<'a> {
7 pub raw: &'a Cone,
9}
10
11macro_rules! impl_ref_methods(
12 ($View: ident) => {
13 impl<'a> $View<'a> {
14 pub fn half_height(&self) -> Real {
16 self.raw.half_height
17 }
18
19 pub fn radius(&self) -> Real {
21 self.raw.radius
22 }
23 }
24 }
25);
26
27impl_ref_methods!(ConeView);
28
29pub struct ConeViewMut<'a> {
31 pub raw: &'a mut Cone,
33}
34
35impl_ref_methods!(ConeViewMut);
36
37impl ConeViewMut<'_> {
38 pub fn set_half_height(&mut self, half_height: Real) {
40 self.raw.half_height = half_height;
41 }
42
43 pub fn set_radius(&mut self, radius: Real) {
45 self.raw.radius = radius;
46 }
47}