pub struct CompoundShapeEx {
pub children: Vec<(LocalTransform, ChildShapeKind)>,
}Expand description
A CompoundShape variant that stores each child with an explicit
LocalTransform, enabling full 6-DOF placement (translation + rotation).
Fields§
§children: Vec<(LocalTransform, ChildShapeKind)>Children: (transform, shape kind).
Implementations§
Source§impl CompoundShapeEx
impl CompoundShapeEx
Sourcepub fn add_sphere(&mut self, transform: LocalTransform, radius: f64)
pub fn add_sphere(&mut self, transform: LocalTransform, radius: f64)
Add a sphere child with a local transform.
Sourcepub fn add_box(&mut self, transform: LocalTransform, half_extents: [f64; 3])
pub fn add_box(&mut self, transform: LocalTransform, half_extents: [f64; 3])
Add a box child with a local transform.
Sourcepub fn add_capsule(
&mut self,
transform: LocalTransform,
radius: f64,
half_height: f64,
)
pub fn add_capsule( &mut self, transform: LocalTransform, radius: f64, half_height: f64, )
Add a capsule child with a local transform.
Sourcepub fn aabb(&self) -> ([f64; 3], [f64; 3])
pub fn aabb(&self) -> ([f64; 3], [f64; 3])
Compute the union AABB of all children in world space.
Returns (min, max) as [f64; 3] arrays.
Sourcepub fn contains_point(&self, p: [f64; 3]) -> bool
pub fn contains_point(&self, p: [f64; 3]) -> bool
Test if a world-space point is inside any child shape.
Trait Implementations§
Source§impl Clone for CompoundShapeEx
impl Clone for CompoundShapeEx
Source§fn clone(&self) -> CompoundShapeEx
fn clone(&self) -> CompoundShapeEx
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompoundShapeEx
impl Debug for CompoundShapeEx
Auto Trait Implementations§
impl Freeze for CompoundShapeEx
impl RefUnwindSafe for CompoundShapeEx
impl Send for CompoundShapeEx
impl Sync for CompoundShapeEx
impl Unpin for CompoundShapeEx
impl UnsafeUnpin for CompoundShapeEx
impl UnwindSafe for CompoundShapeEx
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.