pub struct Sphere<V: VectorSpace> {
pub pos: V,
pub rad: V::Scalar,
}Expand description
The sphere collider.
Fields§
§pos: VThe position of the sphere collider.
rad: V::ScalarThe radius of the sphere collider.
Implementations§
Trait Implementations§
Source§impl<V: InnerSpace> Collider for Sphere<V>
impl<V: InnerSpace> Collider for Sphere<V>
Source§fn check_collision(&self, other: &Self) -> bool
fn check_collision(&self, other: &Self) -> bool
Checks the collision between two colliders.
Defaults to a check of the return value of collision info.
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.
impl<V: Copy + VectorSpace> Copy for Sphere<V>
Auto Trait Implementations§
impl<V> Freeze for Sphere<V>
impl<V> RefUnwindSafe for Sphere<V>
impl<V> Send for Sphere<V>
impl<V> Sync for Sphere<V>
impl<V> Unpin for Sphere<V>
impl<V> UnwindSafe for Sphere<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