pub struct BoundingSphere {
pub center: Vec3,
pub radius: f32,
}Expand description
A sphere enclosing a set of geometry; the shape cameras frame against.
Fields§
§center: Vec3Sphere center.
radius: f32Sphere radius; never negative.
Implementations§
Source§impl BoundingSphere
impl BoundingSphere
Sourcepub fn from_points(points: &[Vec3]) -> Self
pub fn from_points(points: &[Vec3]) -> Self
Encloses a set of points in two O(n) passes: centroid, then the
farthest distance from it. Not minimal, but tight enough for camera
framing and never smaller than the points it covers. The centroid
accumulates in f64 so summing a million single-precision coordinates
does not drift; only the result returns to f32.
Trait Implementations§
Source§impl Clone for BoundingSphere
impl Clone for BoundingSphere
impl Copy for BoundingSphere
Source§impl Debug for BoundingSphere
impl Debug for BoundingSphere
Source§impl PartialEq for BoundingSphere
impl PartialEq for BoundingSphere
impl StructuralPartialEq for BoundingSphere
Auto Trait Implementations§
impl Freeze for BoundingSphere
impl RefUnwindSafe for BoundingSphere
impl Send for BoundingSphere
impl Sync for BoundingSphere
impl Unpin for BoundingSphere
impl UnsafeUnpin for BoundingSphere
impl UnwindSafe for BoundingSphere
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more