Struct mgf::Sphere
[−]
[src]
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]
fn rotate(self, r: Quaternion<f32>) -> Self
[src]
Rotates the sphere about the origin
Trait Implementations
impl BoundedBy<AABB> for Sphere
[src]
impl Mul<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, s: f32) -> Self
[src]
Performs the *
operation.
impl Div<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, s: f32) -> Self
[src]
Performs the /
operation.
impl Add<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, s: f32) -> Self
[src]
Performs the +
operation.
impl Sub<f32> for Sphere
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, s: f32) -> Self
[src]
Performs the -
operation.
impl<RHS: BoundedBy<Sphere>> Contains<RHS> for Sphere
[src]
impl Bound for Sphere
[src]
fn combine(a: &Sphere, b: &Sphere) -> Sphere
[src]
Produce a bound that encloses the two arguments.
fn rotate(&self, _: Quaternion<f32>) -> Sphere
[src]
Rotation to a bounding sphere does nothing.
fn surface_area(&self) -> f32
[src]
Return a measure of the area of the object.
impl Contacts<Moving<Component>> for Sphere
[src]
fn contacts<F: FnMut(Contact)>(
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
[src]
&self,
rhs: &Moving<Component>,
callback: F
) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
Returns the last contact found, if one exists.
impl Contains<Point3<f32>> for Sphere
[src]
fn contains(&self, p: &Point3<f32>) -> bool
[src]
Returns true if the current object contains the argument.
impl Intersects<Ray> for Sphere
[src]
fn intersection(&self, rhs: &Ray) -> Option<Intersection>
[src]
Returns an Intersection if one exists.
impl Intersects<Segment> for Sphere
[src]
fn intersection(&self, rhs: &Segment) -> Option<Intersection>
[src]
Returns an Intersection if one exists.
impl Contacts<Moving<Sphere>> for Sphere
[src]
fn contacts<F: FnMut(Contact)>(
&self,
sphere: &Moving<Sphere>,
callback: F
) -> bool
[src]
&self,
sphere: &Moving<Sphere>,
callback: F
) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
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 contacts<F: FnMut(Contact)>(
&self,
rhs: &Moving<Capsule>,
callback: F
) -> bool
[src]
&self,
rhs: &Moving<Capsule>,
callback: F
) -> bool
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
Returns the last contact found, if one exists.
impl Copy for Sphere
[src]
impl Clone for Sphere
[src]
fn clone(&self) -> Sphere
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Sphere
[src]
impl MinDistance<Point3<f32>> for Sphere
[src]
impl Add<Vector3<f32>> for Sphere
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, v: Vector3<f32>) -> Self
[src]
Performs the +
operation.
impl Sub<Vector3<f32>> for Sphere
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, v: Vector3<f32>) -> Self
[src]
Performs the -
operation.
impl AddAssign<Vector3<f32>> for Sphere
[src]
fn add_assign(&mut self, v: Vector3<f32>)
[src]
Performs the +=
operation.
impl SubAssign<Vector3<f32>> for Sphere
[src]
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
Performs the -=
operation.
impl Shape for Sphere
[src]
fn center(&self) -> Point3<f32>
[src]
Returns the center of mass of the geometry, assuming a regular density.
fn set_pos(&mut self, p: Point3<f32>)
[src]
Sets the center of the shape to p.