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