use super::ColliderView;
use crate::math::{Rot, Vect};
use rapier::parry::shape::Compound;
#[derive(Copy, Clone)]
pub struct CompoundView<'a> {
pub raw: &'a Compound,
}
impl CompoundView<'_> {
#[inline]
pub fn shapes(&self) -> impl ExactSizeIterator<Item = (Vect, Rot, ColliderView<'_>)> {
self.raw.shapes().iter().map(|(pos, shape)| {
#[cfg(feature = "dim2")]
let rot = pos.rotation.angle();
#[cfg(feature = "dim3")]
let rot = pos.rotation;
(pos.translation, rot, shape.as_typed_shape().into())
})
}
}