pub struct Compound {
pub children: Vec<(Transform, Arc<dyn Shape>)>,
}Expand description
A compound shape made of multiple sub-shapes, each with its own transform.
Fields§
§children: Vec<(Transform, Arc<dyn Shape>)>Sub-shapes with their local transforms.
Implementations§
Trait Implementations§
Source§impl Shape for Compound
impl Shape for Compound
Source§fn bounding_box(&self) -> Aabb
fn bounding_box(&self) -> Aabb
Compute the axis-aligned bounding box of this shape (in local space).
Source§fn support_point(&self, direction: &Vec3) -> Vec3
fn support_point(&self, direction: &Vec3) -> Vec3
Compute the support point in the given direction (for GJK).
Source§fn center_of_mass(&self) -> Vec3
fn center_of_mass(&self) -> Vec3
Compute the center of mass in local space.
Source§fn inertia_tensor(&self, mass: Real) -> Mat3
fn inertia_tensor(&self, mass: Real) -> Mat3
Compute the inertia tensor for the given mass.
Source§fn ray_cast(
&self,
ray_origin: &Vec3,
ray_direction: &Vec3,
max_toi: Real,
) -> Option<RayHit>
fn ray_cast( &self, ray_origin: &Vec3, ray_direction: &Vec3, max_toi: Real, ) -> Option<RayHit>
Cast a ray against this shape (in local space).
Returns the first intersection within
max_toi.Source§fn mass_properties(&self, density: Real) -> MassProperties
fn mass_properties(&self, density: Real) -> MassProperties
Compute full mass properties for a given density.
Auto Trait Implementations§
impl Freeze for Compound
impl !RefUnwindSafe for Compound
impl Send for Compound
impl Sync for Compound
impl Unpin for Compound
impl UnsafeUnpin for Compound
impl !UnwindSafe for Compound
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.