pub enum CollisionShape {
Sphere {
radius: f32,
},
Box {
half_extents: Vec3,
},
Capsule {
radius: f32,
half_height: f32,
},
ConvexHull(Vec<Vec3>),
}Expand description
Collision shapes supported by the physics engine.
Variants§
Implementations§
Source§impl CollisionShape
impl CollisionShape
pub fn sphere(radius: f32) -> Self
pub fn box_shape(half: Vec3) -> Self
pub fn capsule(radius: f32, half_height: f32) -> Self
Sourcepub fn compute_inverse_inertia_tensor(&self, mass: f32) -> Mat3
pub fn compute_inverse_inertia_tensor(&self, mass: f32) -> Mat3
Compute the inverse inertia tensor for this shape and mass.
Sourcepub fn bounding_radius(&self) -> f32
pub fn bounding_radius(&self) -> f32
Bounding radius.
Sourcepub fn aabb_half_extents(&self) -> Vec3
pub fn aabb_half_extents(&self) -> Vec3
AABB half-extents.
Trait Implementations§
Source§impl Clone for CollisionShape
impl Clone for CollisionShape
Source§fn clone(&self) -> CollisionShape
fn clone(&self) -> CollisionShape
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 moreAuto Trait Implementations§
impl Freeze for CollisionShape
impl RefUnwindSafe for CollisionShape
impl Send for CollisionShape
impl Sync for CollisionShape
impl Unpin for CollisionShape
impl UnsafeUnpin for CollisionShape
impl UnwindSafe for CollisionShape
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.