Struct vek::geom::repr_simd::Sphere [−][src]
Sphere (3D), represented by center and radius.
Fields
center: Vec3<P>
radius: E
Implementations
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]
E: Copy + One + FloatConst + Add<Output = E> + Mul<Output = E>,
Gets this sphere's surface area.
pub fn volume(self) -> E where
E: Copy + One + FloatConst + Add<Output = E> + Mul<Output = E> + Div<Output = E>,
[src]
E: Copy + One + FloatConst + Add<Output = E> + Mul<Output = E> + Div<Output = E>,
Gets this sphere's volume.
impl<P, E> Sphere<P, E>
[src]
pub fn new(center: Vec3<P>, radius: E) -> Self
[src]
Creates a new
Sphere
from center
and radius
.
pub fn unit(center: Vec3<P>) -> Self where
E: One,
[src]
E: One,
Creates a new
Sphere
from center
and a radius
equal to one.
pub fn point(center: Vec3<P>) -> Self where
E: Zero,
[src]
E: Zero,
Creates a new
Sphere
from center
and a radius
equal to zero.
pub fn diameter(self) -> E where
E: Copy + Add<Output = E>,
[src]
E: Copy + Add<Output = E>,
Gets the value of twice the radius.
pub fn rect3(self) -> Rect3<P, E> where
P: Sub<P, Output = P> + From<E> + Copy,
E: Copy + Add<E, Output = E>,
[src]
P: Sub<P, Output = P> + From<E> + Copy,
E: Copy + Add<E, Output = E>,
Gets the bounding rectangle for this shape.
impl<T> Sphere<T, T> where
T: Copy + Add<T, Output = T> + Sub<T, Output = T>,
[src]
T: Copy + Add<T, Output = T> + Sub<T, Output = T>,
impl<T: Real + Add<T, Output = T>> Sphere<T, T>
[src]
pub fn contains_point(self, p: Vec3<T>) -> bool where
T: PartialOrd,
[src]
T: PartialOrd,
Does this shape contain the given point ?
pub fn collides_with_sphere(self, other: Self) -> bool where
T: PartialOrd,
[src]
T: PartialOrd,
Does this shape collide with another ?
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<P: Clone, E: Clone> Clone for Sphere<P, E>
[src]
impl<P: Copy, E: Copy> Copy for Sphere<P, E>
[src]
impl<P: Debug, E: Debug> Debug for Sphere<P, E>
[src]
impl<P: Default, E: Default> Default for Sphere<P, E>
[src]
impl<'de, P, E> Deserialize<'de> for Sphere<P, E> where
P: Deserialize<'de>,
E: Deserialize<'de>,
[src]
P: Deserialize<'de>,
E: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<P: Eq, E: Eq> Eq for Sphere<P, E>
[src]
impl<P: Hash, E: Hash> Hash for Sphere<P, E>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<P: PartialEq, E: PartialEq> PartialEq<Sphere<P, E>> for Sphere<P, E>
[src]
impl<P, E> Serialize for Sphere<P, E> where
P: Serialize,
E: Serialize,
[src]
P: Serialize,
E: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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,
[src]
E: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, E> Send for Sphere<P, E> where
E: Send,
P: Send,
[src]
E: Send,
P: Send,
impl<P, E> Sync for Sphere<P, E> where
E: Sync,
P: Sync,
[src]
E: Sync,
P: Sync,
impl<P, E> Unpin for Sphere<P, E> where
E: Unpin,
P: Unpin,
[src]
E: Unpin,
P: Unpin,
impl<P, E> UnwindSafe for Sphere<P, E> where
E: UnwindSafe,
P: UnwindSafe,
[src]
E: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,