pub struct Capsule<V: VectorSpace> {
pub start: V,
pub end: V,
pub rad: V::Scalar,
}Expand description
The capsule collider defined as a convex hull around two spheres having the same radius.
Fields§
§start: VThe position of one sphere.
end: VThe position of the other sphere.
rad: V::ScalarThe radius of the spheres.
Implementations§
Source§impl<V: InnerSpace> Capsule<V>
impl<V: InnerSpace> Capsule<V>
Trait Implementations§
Source§impl<V: InnerSpace> Collider for Capsule<V>
impl<V: InnerSpace> Collider for Capsule<V>
Source§fn collision_info(&self, other: &Self) -> Option<CollisionInfo<Self::Vector>>
fn collision_info(&self, other: &Self) -> Option<CollisionInfo<Self::Vector>>
If both colliders collide, returns some collision info, else returns none.
Source§fn check_collision(&self, other: &Other) -> bool
fn check_collision(&self, other: &Other) -> bool
Checks the collision between two colliders.
Defaults to a check of the return value of collision info.
impl<V: Copy + VectorSpace> Copy for Capsule<V>
Auto Trait Implementations§
impl<V> Freeze for Capsule<V>
impl<V> RefUnwindSafe for Capsule<V>
impl<V> Send for Capsule<V>
impl<V> Sync for Capsule<V>
impl<V> Unpin for Capsule<V>
impl<V> UnwindSafe for Capsule<V>
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