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::Vect;
use rapier::geometry::Cuboid;
pub struct CuboidView<'a> {
pub raw: &'a Cuboid,
}
macro_rules! impl_ref_methods(
($View: ident) => {
impl<'a> $View<'a> {
pub fn half_extents(&self) -> Vect {
self.raw.half_extents.into()
}
}
}
);
impl_ref_methods!(CuboidView);
pub struct CuboidViewMut<'a> {
pub raw: &'a mut Cuboid,
}
impl_ref_methods!(CuboidViewMut);
impl<'a> CuboidViewMut<'a> {
pub fn sed_half_extents(&mut self, half_extents: Vect) {
self.raw.half_extents = half_extents.into();
}
}