pub struct Sphere<T = i32>(/* private fields */);
Expand description
A Sphere
positioned at (x, y, z)
with radius
.
Please see the module-level documentation for examples.
Implementations§
Source§impl<T: Num> Sphere<T>
impl<T: Num> Sphere<T>
Sourcepub fn with_position<P: Into<Point<T, 3>>>(p: P, radius: T) -> Self
pub fn with_position<P: Into<Point<T, 3>>>(p: P, radius: T) -> Self
Constructs a Sphere
at position Point with radius
.
Sourcepub fn set_radius(&mut self, radius: T)
pub fn set_radius(&mut self, radius: T)
Sets the radius
of the sphere.
Source§impl<T> Sphere<T>
impl<T> Sphere<T>
Sourcepub fn as_<U>(&self) -> Sphere<U>where
U: 'static + Copy,
T: AsPrimitive<U>,
pub fn as_<U>(&self) -> Sphere<U>where
U: 'static + Copy,
T: AsPrimitive<U>,
Converts Sphere < T > to Sphere < U >.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Sphere<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Sphere<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Default> FromIterator<T> for Sphere<T>
impl<T: Default> FromIterator<T> for Sphere<T>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Source§impl<'a, T> IntoIterator for &'a Sphere<T>
impl<'a, T> IntoIterator for &'a Sphere<T>
Source§impl<'a, T> IntoIterator for &'a mut Sphere<T>
impl<'a, T> IntoIterator for &'a mut Sphere<T>
Source§impl<T> IntoIterator for Sphere<T>
impl<T> IntoIterator for Sphere<T>
impl<T: Copy> Copy for Sphere<T>
impl<T: Eq> Eq for Sphere<T>
impl<T> StructuralPartialEq for Sphere<T>
Auto Trait Implementations§
impl<T> Freeze for Sphere<T>where
T: Freeze,
impl<T> RefUnwindSafe for Sphere<T>where
T: RefUnwindSafe,
impl<T> Send for Sphere<T>where
T: Send,
impl<T> Sync for Sphere<T>where
T: Sync,
impl<T> Unpin for Sphere<T>where
T: Unpin,
impl<T> UnwindSafe for Sphere<T>where
T: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.