pub struct Sphere<V: VectorSpace> {
pub center: V,
pub radius: V::Scalar,
}Expand description
A sphere collider defined by a center point and radius.
Fields§
§center: VThe center of the sphere.
radius: V::ScalarThe radius of the sphere.
Implementations§
Trait Implementations§
Source§impl<V: Copy + InnerSpace> BoundingVolume for Sphere<V>
impl<V: Copy + InnerSpace> BoundingVolume for Sphere<V>
Source§impl<V: Copy + InnerSpace> Collider for Sphere<V>
impl<V: Copy + InnerSpace> Collider for Sphere<V>
Source§fn check_collision(&self, other: &Self) -> bool
fn check_collision(&self, other: &Self) -> bool
Checks if two colliders collide.
By default just checks if a collision info is found, so implementing this manually might be more effcient.
Source§fn collision_info(&self, other: &Self) -> Option<CollisionInfo<V>>
fn collision_info(&self, other: &Self) -> Option<CollisionInfo<V>>
Returns collision info if colliders intersect, otherwise
None.Source§impl<V: Copy + InnerSpace, T: Transform<V>> Transformable<T> for Sphere<V>
impl<V: Copy + InnerSpace, T: Transform<V>> Transformable<T> for Sphere<V>
Source§fn transformed(&self, transform: &T) -> Self
fn transformed(&self, transform: &T) -> Self
Returns a new collider with the transform applied.
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> UnsafeUnpin 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