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
use crate::math::Real;
use rapier::parry::shape::Ball;
pub struct BallView<'a> {
pub raw: &'a Ball,
}
macro_rules! impl_ref_methods(
($View: ident) => {
impl<'a> $View<'a> {
pub fn radius(&self) -> Real {
self.raw.radius
}
}
}
);
impl_ref_methods!(BallView);
pub struct BallViewMut<'a> {
pub raw: &'a mut Ball,
}
impl_ref_methods!(BallViewMut);
impl<'a> BallViewMut<'a> {
pub fn set_radius(&mut self, radius: Real) {
self.raw.radius = radius;
}
}