pub enum PyColliderShape {
Sphere {
radius: f64,
},
Box {
half_extents: [f64; 3],
},
Plane {
normal: [f64; 3],
distance: f64,
},
Capsule {
radius: f64,
half_height: f64,
},
Cylinder {
radius: f64,
half_height: f64,
},
Cone {
radius: f64,
half_height: f64,
},
}Expand description
Shape variant for a rigid body collider.
Only primitive shapes are supported; they map to underlying collision shapes.
Variants§
Sphere
A sphere with the given radius.
Box
An axis-aligned box with given half-extents.
Plane
An infinite plane defined by a normal and distance from origin.
Fields
Capsule
A capsule (cylinder + two hemispheres) along the Y axis.
Fields
Cylinder
A cylinder aligned with the Y axis.
Cone
A cone aligned with the Y axis, apex pointing up.
Implementations§
Source§impl PyColliderShape
impl PyColliderShape
Sourcepub fn approximate_volume(&self) -> f64
pub fn approximate_volume(&self) -> f64
Compute an approximate volume for mass/inertia estimation.
Sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Whether this shape is a plane (infinite extents).
Trait Implementations§
Source§impl Clone for PyColliderShape
impl Clone for PyColliderShape
Source§fn clone(&self) -> PyColliderShape
fn clone(&self) -> PyColliderShape
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 PyColliderShape
impl Debug for PyColliderShape
Source§impl<'de> Deserialize<'de> for PyColliderShape
impl<'de> Deserialize<'de> for PyColliderShape
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PyColliderShape
impl PartialEq for PyColliderShape
Source§impl Serialize for PyColliderShape
impl Serialize for PyColliderShape
impl StructuralPartialEq for PyColliderShape
Auto Trait Implementations§
impl Freeze for PyColliderShape
impl RefUnwindSafe for PyColliderShape
impl Send for PyColliderShape
impl Sync for PyColliderShape
impl Unpin for PyColliderShape
impl UnsafeUnpin for PyColliderShape
impl UnwindSafe for PyColliderShape
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.