pub enum Collider {
Circle {
radius: f32,
},
Box {
half_w: f32,
half_h: f32,
},
Capsule {
radius: f32,
half_height: f32,
},
Point,
}Expand description
Collision shape for a body.
Variants§
Implementations§
Source§impl Collider
impl Collider
pub fn circle(radius: f32) -> Self
pub fn box_shape(w: f32, h: f32) -> Self
pub fn capsule(radius: f32, height: f32) -> Self
Sourcepub fn compute_inertia(&self, mass: f32) -> f32
pub fn compute_inertia(&self, mass: f32) -> f32
Compute the moment of inertia for this shape and mass.
Sourcepub fn bounding_radius(&self) -> f32
pub fn bounding_radius(&self) -> f32
Bounding radius.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Collider
impl RefUnwindSafe for Collider
impl Send for Collider
impl Sync for Collider
impl Unpin for Collider
impl UnsafeUnpin for Collider
impl UnwindSafe for Collider
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