bevy_rapier3d/geometry/shape_views/
ball.rs1use crate::math::Real;
2use rapier::parry::shape::Ball;
3
4#[derive(Copy, Clone)]
6pub struct BallView<'a> {
7 pub raw: &'a Ball,
9}
10
11macro_rules! impl_ref_methods(
12 ($View: ident) => {
13 impl<'a> $View<'a> {
14 pub fn radius(&self) -> Real {
16 self.raw.radius
17 }
18 }
19 }
20);
21
22impl_ref_methods!(BallView);
23
24pub struct BallViewMut<'a> {
26 pub raw: &'a mut Ball,
28}
29
30impl_ref_methods!(BallViewMut);
31
32impl BallViewMut<'_> {
33 pub fn set_radius(&mut self, radius: Real) {
35 self.raw.radius = radius;
36 }
37}