pub struct Sphere {
pub center: Vec3,
pub radius: f32,
}Expand description
World-space sphere for standalone overlap queries.
Fields§
§center: Vec3Center in world units.
radius: f32Positive radius.
Implementations§
Source§impl Sphere
impl Sphere
Sourcepub fn new(center: Vec3, radius: f32) -> Self
pub fn new(center: Vec3, radius: f32) -> Self
Creates a sphere. Panics for a nonfinite center or invalid radius.
Sourcepub fn overlap(&self, other: &Self) -> Option<Penetration3D>
pub fn overlap(&self, other: &Self) -> Option<Penetration3D>
Positive overlap; normal moves this sphere away from the other.
Sourcepub fn overlap_box(&self, other: &Aabb3) -> Option<Penetration3D>
pub fn overlap_box(&self, other: &Aabb3) -> Option<Penetration3D>
Positive overlap against a box, including a center inside the box. Empty or flat boxes have no positive overlap.
Trait Implementations§
impl Copy for Sphere
impl StructuralPartialEq for Sphere
Auto Trait Implementations§
impl Freeze for Sphere
impl RefUnwindSafe for Sphere
impl Send for Sphere
impl Sync for Sphere
impl Unpin for Sphere
impl UnsafeUnpin for Sphere
impl UnwindSafe for Sphere
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