1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::math::Real;
use rapier::parry::shape::Cylinder;
pub struct CylinderView<'a> {
pub raw: &'a Cylinder,
}
macro_rules! impl_ref_methods(
($View: ident) => {
impl<'a> $View<'a> {
pub fn half_height(&self) -> Real {
self.raw.half_height
}
pub fn radius(&self) -> Real {
self.raw.radius
}
}
}
);
impl_ref_methods!(CylinderView);
pub struct CylinderViewMut<'a> {
pub raw: &'a mut Cylinder,
}
impl_ref_methods!(CylinderViewMut);
impl<'a> CylinderViewMut<'a> {
pub fn set_half_height(&mut self, half_height: Real) {
self.raw.half_height = half_height;
}
pub fn set_radius(&mut self, radius: Real) {
self.raw.radius = radius;
}
}