[][src]Struct mgf::Sphere

pub struct Sphere {
    pub c: Point3<f32>,
    pub r: f32,
}

A point and a distance.

Like AABBs, spheres are closed volumes.

Fields

c: Point3<f32>

The center point of the sphere.

r: f32

The radius of the sphere.

Methods

impl Sphere[src]

pub fn new(center: Point3<f32>, radius: f32) -> Self[src]

Create a new sphere.

Trait Implementations

impl Bound for Sphere[src]

impl BoundedBy<AABB> for Sphere[src]

impl BoundedBy<Sphere> for Triangle[src]

impl BoundedBy<Sphere> for Rectangle[src]

impl BoundedBy<Sphere> for AABB[src]

Taking the bounding sphere of an AABB creates a sphere that contains all of the extreme points of the AABB. Thus, a bounding sphere for an AABB created from another bounding sphere will be larger in size than the original sphere.

impl BoundedBy<Sphere> for Capsule[src]

impl BoundedBy<Sphere> for OBB[src]

impl BoundedBy<Sphere> for Component[src]

impl BoundedBy<Sphere> for Compound[src]

impl Overlaps<Sphere> for AABB[src]

impl Overlaps<AABB> for Sphere[src]

impl Overlaps<Sphere> for Sphere[src]

impl Contains<Point3<f32>> for Sphere[src]

impl Contains<Sphere> for Sphere[src]

An important consequence of Spheres being closed: two spheres with the same center and radius contain each other.

impl<P: Particle> Intersects<Sphere> for P[src]

impl Contacts<Moving<Component>> for Sphere[src]

fn last_contact(&self, rhs: &RHS) -> Option<Contact>[src]

Returns the last contact found, if one exists.

impl Contacts<Moving<Sphere>> for Sphere[src]

fn last_contact(&self, rhs: &RHS) -> Option<Contact>[src]

Returns the last contact found, if one exists.

impl Contacts<Moving<Capsule>> for Sphere[src]

fn last_contact(&self, rhs: &RHS) -> Option<Contact>[src]

Returns the last contact found, if one exists.

impl Shape for Sphere[src]

fn set_pos(&mut self, p: Point3<f32>)[src]

Sets the center of the shape to p.

impl Volumetric for Sphere[src]

fn rotate<R: Rotation3<f32>>(self, _: R) -> Sphere[src]

Rotation to a bounding sphere does nothing.

fn rotate_about<R: Rotation3<f32>>(self, r: R, p: Point3<f32>) -> Self[src]

Rotates the object around a point.

impl Convex<Point3<f32>> for Sphere[src]

impl Inertia for Sphere[src]

impl Clone for Sphere[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<Sphere> for Component[src]

impl Copy for Sphere[src]

impl Debug for Sphere[src]

impl Add<f32> for Sphere[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Vector3<f32>> for Sphere[src]

type Output = Self

The resulting type after applying the + operator.

impl Sub<f32> for Sphere[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Vector3<f32>> for Sphere[src]

type Output = Self

The resulting type after applying the - operator.

impl Mul<f32> for Sphere[src]

type Output = Self

The resulting type after applying the * operator.

impl Div<f32> for Sphere[src]

type Output = Self

The resulting type after applying the / operator.

impl AddAssign<Vector3<f32>> for Sphere[src]

impl SubAssign<Vector3<f32>> for Sphere[src]

Auto Trait Implementations

impl Send for Sphere

impl Sync for Sphere

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.