Struct vek::geom::repr_c::Sphere [−][src]
pub struct Sphere<P, E> { pub center: Vec3<P>, pub radius: E, }
Expand description
Sphere (3D), represented by center and radius.
Fields
center: Vec3<P>
radius: E
Implementations
impl<P, E> Sphere<P, E>
[src]
impl<P, E> Sphere<P, E>
[src]pub fn surface_area(self) -> E where
E: Copy + One + FloatConst + Add<Output = E> + Mul<Output = E>,
[src]
pub fn surface_area(self) -> E where
E: Copy + One + FloatConst + Add<Output = E> + Mul<Output = E>,
[src]Gets this sphere’s surface area.
impl<P, E> Sphere<P, E>
[src]
impl<P, E> Sphere<P, E>
[src]pub fn unit(center: Vec3<P>) -> Self where
E: One,
[src]
pub fn unit(center: Vec3<P>) -> Self where
E: One,
[src]Creates a new
Sphere
from center
and a radius
equal to one.
pub fn point(center: Vec3<P>) -> Self where
E: Zero,
[src]
pub fn point(center: Vec3<P>) -> Self where
E: Zero,
[src]Creates a new
Sphere
from center
and a radius
equal to zero.
impl<T: Real + Add<T, Output = T>> Sphere<T, T>
[src]
impl<T: Real + Add<T, Output = T>> Sphere<T, T>
[src]pub fn contains_point(self, p: Vec3<T>) -> bool where
T: PartialOrd,
[src]
pub fn contains_point(self, p: Vec3<T>) -> bool where
T: PartialOrd,
[src]Does this shape contain the given point ?
pub fn collides_with_sphere(self, other: Self) -> bool where
T: PartialOrd,
[src]
pub fn collides_with_sphere(self, other: Self) -> bool where
T: PartialOrd,
[src]Does this shape collide with another ?
pub fn collision_vector_with_sphere(self, other: Self) -> Vec3<T>
[src]
pub fn collision_vector_with_sphere(self, other: Self) -> Vec3<T>
[src]Gets a vector that tells how much this shape penetrates another.
Trait Implementations
impl<'de, P, E> Deserialize<'de> for Sphere<P, E> where
P: Deserialize<'de>,
E: Deserialize<'de>,
[src]
impl<'de, P, E> Deserialize<'de> for Sphere<P, E> where
P: Deserialize<'de>,
E: Deserialize<'de>,
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<P: Copy, E: Copy> Copy for Sphere<P, E>
[src]
impl<P: Eq, E: Eq> Eq for Sphere<P, E>
[src]
impl<P, E> StructuralEq for Sphere<P, E>
[src]
impl<P, E> StructuralPartialEq for Sphere<P, E>
[src]
Auto Trait Implementations
impl<P, E> RefUnwindSafe for Sphere<P, E> where
E: RefUnwindSafe,
P: RefUnwindSafe,
E: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, E> Send for Sphere<P, E> where
E: Send,
P: Send,
E: Send,
P: Send,
impl<P, E> Sync for Sphere<P, E> where
E: Sync,
P: Sync,
E: Sync,
P: Sync,
impl<P, E> Unpin for Sphere<P, E> where
E: Unpin,
P: Unpin,
E: Unpin,
P: Unpin,
impl<P, E> UnwindSafe for Sphere<P, E> where
E: UnwindSafe,
P: UnwindSafe,
E: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,