bevy_rapier3d/geometry/shape_views/
convex_polyhedron.rs1use crate::math::Vect;
2use rapier::parry::shape::ConvexPolyhedron;
3
4#[derive(Copy, Clone)]
6pub struct ConvexPolyhedronView<'a> {
7 pub raw: &'a ConvexPolyhedron,
9}
10
11impl ConvexPolyhedronView<'_> {
12 pub fn points(&self) -> impl ExactSizeIterator<Item = Vect> + '_ {
14 self.raw.points().iter().map(|pt| (*pt).into())
15 }
16
17 }
19
20pub struct ConvexPolyhedronViewMut<'a> {
22 pub raw: &'a mut ConvexPolyhedron,
24}
25
26impl ConvexPolyhedronViewMut<'_> {
27 pub fn points(&self) -> impl ExactSizeIterator<Item = Vect> + '_ {
29 self.raw.points().iter().map(|pt| (*pt).into())
30 }
31
32 }